The r2resize package is available on CRAN and can be installed as shown below
install.packages(r2resize)
Attach library
library(r2resize)
The r2resize can be used within the R Markdown or Quarto document using an R chunk as shown below
r2resize::add.resizer()
or by using the available options. An example of how the available options can be used is show below
::add.resizer(
r2resizetheme.color = "black",
position = "top",
font.size = "12px",
font.color = "darkblue",
tables = TRUE,
images = TRUE,
line.color = "orange",
line.width = 150
)
Elit pellentesque habitant morbi tristique senectus et netus et malesuada. Amet massa vitae tortor condimentum lacinia quis vel eros.
Imperdiet nulla malesuada pellentesque elit eget gravida. Turpis massa sed elementum tempus egestas.
Libero id faucibus nisl tincidunt. Ultrices tincidunt arcu non sodales neque sodales ut etiam. Ut placerat orci nulla pellentesque dignissim enim sit amet. Tempus quam pellentesque nec nam.
library(DT)
datatable(iris)
Egestas purus viverra accumsan in. Eu ultrices vitae auctor eu augue ut lectus. Leo integer malesuada nunc vel risus commodo.
Column 1 | Column 2 | Column 3 | Column 4 | Column 5 |
---|---|---|---|---|
1 | 23 | 1 | 45 | 6 - 12 |
3 | 4 | 5 | NA | 4 - 5.5 |
7 | 7 | 5 | 0 | 5 - 34 |
head1 | head2 | head3 | head4 | head5 |
---|---|---|---|---|
1 | 23 | 1 | A | AA |
3 | 4 | 5 | B | BB |
7 | 7 | 5 | C | CC |