posit-dev / posit-dev/positron

vctrs records in R environment pane

Open
#748 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: kernels lang: r
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

Follow up to this comment: https://github.com/rstudio/positron/pull/559#discussion_r1195182114

> rcd <- new_rcrd(list(x = 1:10, y = letters[1:10]),  class = "mylist")
> length(rcd)
[1] 10

This creates a record of size 10 with 2 fields. But the environment pane only shows the record as a boring list:

image

even if it has a format() method:

> format.mylist <- function(x, ...) paste("(", field(x, "x"), ", ", field(x, "y"), ")", sep = "")
> rcd <- new_rcrd(list(x = 1:10, y = letters[1:10]),  class = "mylist")
> rcd
<mylist[10]>
 [1] (1, a)  (2, b)  (3, c)  (4, d)  (5, e)  (6, f)  (7, g)  (8, h)  (9, i) 
[10] (10, j)

Should it look more like format(rcd):

fmt <- format(rcd)
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the environment pane's handling of R objects and the discussion linked from posit-dev/positron#559. Reproduce the vctrs::new_rcrd example from the issue and compare the pane's display with format(rcd). Done means the record is presented using its formatted representation instead of as a generic list.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript
Domain
frontend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.