R markdown df_print options

后端 未结 1 1242
时光取名叫无心
时光取名叫无心 2021-02-07 22:50

I have a R markdown document in RStudio, where a data.table is printed. I want to set the data frame print options to control printed number of rows and columns, as described h

1条回答
  •  一向
    一向 (楼主)
    2021-02-07 23:19

    The knitr::opts_chunk$set(rows.print=25) option setting applies only to subsequent chunks, hence in the minimal example it doesn't change the setting.

    The option can be set in the chunk as shown in chunk1 or globally in opts_chunk for subsequent chunks.

    ```{r chunk1, rows.print=15}
    knitr::opts_chunk$set(echo = TRUE, rows.print=25)
    cars #15 rows printed
    ```
    
    ```{r chunk2}
    cars #25 rows printed
    ```
    

    0 讨论(0)
提交回复
热议问题