unexpected behaviour of RStudio View of list-columns

I've created a dataframe (tibble) from a nested list and I'm perplexed by the RStudio View of the list-column.

Here's an example of what I mean:

df <- structure(list(dimension_name = c("KAZALNIK", "OBMOČJA","LETO"),
levels = list(structure(list(values = "1", valueTexts = "Delež vzorcev"),
class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -1L)), structure(list(
  values = c("1", "2", "3"), valueTexts = c("Mala", "Srednja", "Velika")),
  class = c("tbl_df","tbl", "data.frame"), row.names = c(NA, -3L)), structure(list(
    values = c("2012", "2013", "2014", "2015"), valueTexts = c("12","13", "14", "15")),
    class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -4L)))), class = c("tbl_df", "tbl", "data.frame"), row.names = c(NA, -3L))

the second column are all nested dataframes (tibbles) with two columns.

Yet in the RStudio View I see this:
image

If I look at str(df) I cannot see anything different about the third row - or third element of the listcolumn, and I'm going crazy :slight_smile:

str(df)
tibble [3 x 2] (S3: tbl_df/tbl/data.frame)
 $ dimension_name: chr [1:3] "KAZALNIK" "OBMOČJA" "LETO"
 $ levels        :List of 3
  ..$ : tibble [1 x 2] (S3: tbl_df/tbl/data.frame)
  .. ..$ values    : chr "1"
  .. ..$ valueTexts: chr "Delež vzorcev"
  ..$ : tibble [3 x 2] (S3: tbl_df/tbl/data.frame)
  .. ..$ values    : chr [1:3] "1" "2" "3"
  .. ..$ valueTexts: chr [1:3] "Mala" "Srednja" "Velika"
  ..$ : tibble [4 x 2] (S3: tbl_df/tbl/data.frame)
  .. ..$ values    : chr [1:4] "2012" "2013" "2014" "2015"
  .. ..$ valueTexts: chr [1:4] "12" "13" "14" "15"

I would expect all three rows to read "2 variables".

Granted, the object performs as expected, it's just that I don't understand why the IDE is acting the way it is and am worried I am missing something.

Edit2: I'm using RStudio 2022.07.0 Build 540 Spotted Wakerobin Preview (64285800, 2022-06-23)

(Edit1: to make the example data more clear)

Doesn't do that on RStudio 2022.02.3+492 "Prairie Trillium": I do have the expected "2 variables" with your example df.

1 Like

Same here. Idiocyncratic thing in @ maja installation?

1 Like

Considering the "Early Adopter Group for Evaluating RStudio" badge, that could be a bug that's coming for us all in the next version of RStudio!

1 Like

Same thing happens in Rstudio 2022.07.0 Build 548 just installed today running Linux Ubuntu 18.04.
Screenshot from 2022-07-15 23-28-33

1 Like

Yeah, sorry, I should have included the version, I am indeed on a preview release due to a bug in the most recent official release, but completely slipped my mind. (I've edited my OP to reflect that).

Thanks @DavidW for confirming, I guess I'll open an issue on github then!

This thread can now be closed, thanks!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.