Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

matrix-columns don't show up correctly in View() or with paged printing in RMarkdown #835

Closed
Aariq opened this issue Jan 11, 2021 · 3 comments

Comments

@Aariq
Copy link

Aariq commented Jan 11, 2021

I'm not sure if this is an issue with tibble, utils, rmarkdown, or Rstudio itself, so please excuse me if this is in the wrong place. If you create a tibble with a matrix-column (like a list-column, but the column is a matrix), only the first column of the matrix shows up in View() with no indication that there is more to see.

library(tibble)
library(readr)
set.seed(123)
my_matrix <- matrix(rnorm(100), nrow = 10)
tbl <- tibble(x = letters[1:10], mat_col = my_matrix)
tbl
#> # A tibble: 10 x 2
#>    x     mat_col[,1]   [,2]   [,3]    [,4]    [,5]    [,6]    [,7]   [,8]
#>    <chr>       <dbl>  <dbl>  <dbl>   <dbl>   <dbl>   <dbl>   <dbl>  <dbl>
#>  1 a         -0.560   1.22  -1.07   0.426  -0.695   0.253   0.380  -0.491
#>  2 b         -0.230   0.360 -0.218 -0.295  -0.208  -0.0285 -0.502  -2.31 
#>  3 c          1.56    0.401 -1.03   0.895  -1.27   -0.0429 -0.333   1.01 
#>  4 d          0.0705  0.111 -0.729  0.878   2.17    1.37   -1.02   -0.709
#>  5 e          0.129  -0.556 -0.625  0.822   1.21   -0.226  -1.07   -0.688
#>  6 f          1.72    1.79  -1.69   0.689  -1.12    1.52    0.304   1.03 
#>  7 g          0.461   0.498  0.838  0.554  -0.403  -1.55    0.448  -0.285
#>  8 h         -1.27   -1.97   0.153 -0.0619 -0.467   0.585   0.0530 -1.22 
#>  9 i         -0.687   0.701 -1.14  -0.306   0.780   0.124   0.922   0.181
#> 10 j         -0.446  -0.473  1.25  -0.380  -0.0834  0.216   2.05   -0.139
#> # … with 2 more variables: [,9] <dbl>, [,10] <dbl>

Created on 2021-01-11 by the reprex package (v0.3.0)

But with View():
Screen Shot 2021-01-11 at 2 09 58 PM

Similarly, in RMarkdown documents with paged printing of dataframes, only an empty in-line viewer box shows up.
Screen Shot 2021-01-11 at 2 12 03 PM

possibly related: tidyverse/readr#1171

@krlmlr
Copy link
Member

krlmlr commented Feb 14, 2021

Thanks. We can't control what happens in the RStudio viewer here. We could in theory change tibble::view() to give a better experience here. Otherwise https://github.com/rstudio/rstudio/ has an issue tracker where this would be more appropriate.

@krlmlr
Copy link
Member

krlmlr commented Feb 23, 2021

I'd rather avoid dealing with this in view().

@krlmlr krlmlr closed this as completed Feb 23, 2021
@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants