R Markdown inline output format for a nested tibble

Hello, I got different tibble displays between the rendered output and the R Markdown inline output:

For a nested tibble, it can be rendered as follows:

library(tibble)
df1 <- tibble(
  g = c(1, 2, 3),
  data = list(
    tibble(x = 1, y = 2),
    tibble(x = 4:5, y = 6:7),
    tibble(x = 10)
  )
)
df1
#> # A tibble: 3 × 2
#>       g data            
#>   <dbl> <list>          
#> 1     1 <tibble [1 × 2]>
#> 2     2 <tibble [2 × 2]>
#> 3     3 <tibble [1 × 1]>

Created on 2022-09-20 with reprex v2.0.2

Each row shows the nested tibble's row and column number (i.e., the tibble's shape).

However, in the R markdown inline output, the shape information doesn't show up:

I've found that if I set paged.print = FALSE in the chunk option, the inline output would be the same as the rendered output:

May I ask, is it possible to show each row tibble's shape information under the setting of page.print = TRUE?

Thank you very much for your kind guidance!

sessionInfo()
#> R version 4.2.1 (2022-06-23)
#> Platform: x86_64-apple-darwin17.0 (64-bit)
#> Running under: macOS Big Sur ... 10.16
#> 
#> Matrix products: default
#> BLAS:   /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRblas.0.dylib
#> LAPACK: /Library/Frameworks/R.framework/Versions/4.2/Resources/lib/libRlapack.dylib
#> 
#> locale:
#> [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8
#> 
#> attached base packages:
#> [1] stats     graphics  grDevices utils     datasets  methods   base     
#> 
#> loaded via a namespace (and not attached):
#>  [1] rstudioapi_0.14   knitr_1.40        magrittr_2.0.3    R.cache_0.16.0   
#>  [5] rlang_1.0.5       fastmap_1.1.0     fansi_1.0.3       stringr_1.4.1    
#>  [9] styler_1.7.0      highr_0.9         tools_4.2.1       xfun_0.32        
#> [13] R.oo_1.25.0       utf8_1.2.2        cli_3.4.0         withr_2.5.0      
#> [17] htmltools_0.5.3   yaml_2.3.5        digest_0.6.29     tibble_3.1.8     
#> [21] lifecycle_1.0.2   purrr_0.3.4       R.utils_2.12.0    vctrs_0.4.1      
#> [25] fs_1.5.2          glue_1.6.2        evaluate_0.16     rmarkdown_2.16   
#> [29] reprex_2.0.2      stringi_1.7.8     compiler_4.2.1    pillar_1.8.1     
#> [33] R.methodsS3_1.8.2 pkgconfig_2.0.3

Created on 2022-09-20 with reprex v2.0.2

I believe this is an issue or limitation in rmarkdown::paged_table

Possibly related to

I'll open a new one to track this: Show string representation of list column with tibbles in paged_table like with print method · Issue #2412 · rstudio/rmarkdown · GitHub

Thank you !

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.