Paging of tables in RStudio IDE rmarkdown/source mode


Would anyone have a hint on how to force paging for chunks output of tables, while editing R Mardown file in RStudio (source mode)?

I'm confronted with that situation where I'm using RStudio IDE to interactively work through R Mardown files. This is to emphasize I'm just knitting some chunks here and there, and not the full document. I'm using the source mode. I'm not sure what the IDE uses to output tables, but I fail forcing the default 10 paging to get more rows shown. Are there chunk options or function arguments I could use to force the default 10-rows paging?

As a very very basic regex, lets say I'm editing this in source mode and I want to see more than 10 rows when running the chunk in the IDE:

data.frame(x = 1:15)

Thank you for your help. Any more wise comment on how tables outputs are dispatched depending on the context (knitting chunks in the IDE vs. knitting the full Rmd as html) would be appreciated too. Tables rendering is unfortunately something I keep struggling with. I find it quite confusing where to tweak it once you escape plain R and console output... print() methods arguments for data.frame or tibble? kable arguments? chunk options? And which of those -or combination of those!- will actually work only if you set results='asis' for the chunk and/or fully knit and/or set some general option...

If I understand you correctly you want to see all 15 rows of your data.frame, but you see only 10.
I cannot recreate that problem.
Creating a new Rmarkdown (html) file with the RStudio menu structuur, I can run the cars chunk (only) and see in all variants 15 rows. I am not aware of any options that would limit the output to only (e.g.) 10 rows.
My code:

title: "Untitled"
author: "My name"
date: "2022-10-28"
output: html_document

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)

## R Markdown

This is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see <>.

When you click the **Knit** button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:

```{r cars}
df1 <- data.frame(x = 1:15) 
data.frame(x = 1:15)

Thank you for your interest.
Here is a screenshot with your code (including chunk with options), which I just ran: output with 10-rows paging.
My goal is to have the 15 rows without paging (or a chosen paging) in that context.

Hello @mcar176 ,
I only see this when I knit the whole document (and not when I run the chunk with the green triangle) and then I see the data right justified on the screen: different settings somewhere?
Otherwise I just see the simple print output (three times).

See ?rmarkdown::paged_table.
To get more rows (e.g. 12) directly in your output (you can always request 'next' in the table) use


Thank you for mentionning ?rmarkdown::paged_table.
Unfortunately the output of my chunk still shows 10 rows (proof attached). I haven't set any other option. Knitting the full document shows more than 10 rows in the fully rendered document. But I'm trying (and failing) to output more than 10 rows while working interactively and running chunks from the IDE (as shown in both screenshots). Obviously there's the next button I can still click on. But this is what I'm trying to get rid off or tweak: I'm on that project where I'm often dealing with short tables (but longer than 10 rows), and this is annoying not to be able to have the full output to check while coding (without knitting the full document and looking at the full html output in a new window)

As last suggestions:

  1. what do you see when you only use the following (seeing the three boxes paged_df, data.frame and data.frame but only one output) :
df1 <- data.frame(x = 1:15) 
  1. do you see an option with value 10 somewhere? You notice I am getting desperate :grinning:
    You can look at the options with the following command but the output will be a lot of screens:

I appreciate your help and I checked each output of your suggested code before answering but it's true my screenshot didn't show they were the same. I added one. We'll see if someone has a solution or an explanation. Best regards

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.