Description Usage Arguments Details Note
Changing the page size and adding two column support for HTML RMarkdown documents is relatively easy but requires either altering an external .html file or a fair bit of typing in your .Rmd file. These functions make it easier to add these supports, fine-tuned to each .Rmd file.
setup2cols()
sets the size of the left and right columns
setup_pagewidth()
sets the width of the page
begin_left()
and begin_right
begin column support
end_left()
and end_right
ends column support
br()
is thrown in for good measure as line breaks in Rmarkdown are finicky. Just call br()
in an r chunk with the option results='asis'
1 2 3 4 5 6 7 8 9 10 11 12 13 | setup2cols(left = 50, right = 50)
begin_left()
begin_right()
end_left()
end_right()
setup_pagewidth(width = 1700)
br(n = 1)
|
left |
Integer, percent of the page width to devote to the left column, default is 50 |
right |
Integer, percent of the page width to devote to the right column, default is 50 |
width |
Integer, page width in px |
n |
Integer, number of line breaks to include, deafult is 1 |
To use these functions put setup2cols()
and/or setup_pagewidth()
in a r chunk with the option
results='asis'
at the beginning of your document. Then, when you want column output, make another r chunk
(also with results='asis'
) and surround your desired output with begin_left()
and end_left()
.
These functions were designed to be used with a for loop, hence why results='hold'
is not used.
To use ggplot objects with begin_left()
and begin_right()
pass them through plot()
.
To use kable objects pass them through htmltools::knit_print.html()
.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.