How to suppress large tibbles from creating huge html files

I am using Rnotebook basically as an analysis tool.
I habitually type the tibble's name to check its contents.
If there is a huge tibble, the rnotebook.nb.html file becomes very large to generate whole tibble contents.
Thus I should type head(mytibble) to reduce my notebook file for watching the preview.
Is there any way to suppress or reduce the tibble contents of the Rnotebook/Rmarkdown html in global options?

This is an example:

library(tidyverse)
library(tidymodels)

hotels <- read_csv('https://tidymodels.org/start/case-study/hotels.csv')
#head(hotels)  # small html generated
hotels   # large html generated

splits <- initial_split(hotels, strata = children)
hotel_other <- training(splits)
hotel_test <- testing(splits)
val_set <- validation_split(hotel_other,  strata = children,  prop = 0.80)

val_set  # very large html which can't be reduced by head()

I found a not pretty but simple solution.

Because "df_print: tibble" in Rnotebook doesn't work,
I forced the option to be set.

options( paged.print = FALSE)

html_notebook format only works with df_print = paged. You need to use html_document to change the print method.

However, I believe you can control the option of the paged table output. See ?rmarkdown::paged_table() or https://bookdown.org/yihui/rmarkdown/html-document.html#paged-printing

These options can be passed as R option, or knitr option (at chunk level or globally using knitr::opts_chunk$set()

Maybe one of the available option can help 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.