add_as_ | R Documentation |
knitrContainer
Functions to transform and add objects to
knitrContainer
.
Objects, that can be included in R list
,
can also be
included in knitrContainer
.
add_as_heading()
subfamily functions have separate description
page.
add_as_is(container = NULL, obj)
add_as_plotly_widget(container = NULL, obj)
add_as_pander(container = NULL, obj, ...)
add_as_text(container = NULL, obj)
add_as_strings(container = NULL, obj)
add_as_code(container = NULL, obj, comment = FALSE, highlight = FALSE)
add_as_code_r(container = NULL, obj, comment = FALSE, highlight = "r")
add_as_code_js(container = NULL, obj, comment = FALSE, highlight = "js")
add_as_output(container = NULL, obj, comment = TRUE, highlight = FALSE)
add_as_data(
container = NULL,
obj,
give.name = match.call()$obj %>% c %>% as.character %>% make.names %>%
substr(1, 60)
)
add_as_cmd(container = NULL, obj)
add_as_cmd_str(container = NULL, obj)
container |
|
obj |
An object to be added to the |
... |
Options to be passed to |
comment |
Either logical or a string: |
highlight |
Either |
give.name |
A string, that gives a name of a data set passed as
|
Following functions convert and format an object obj
such that it could
be appropriatly printed (or evaluated) by applying function
print_all
().
add_as_is()
includes object obj
in the container
without
transformation ("as is"). Function print_all
will print
it using regular print
function. Note that in R Markdaown Rmd
file knitr
chunk option results='asis'
may distort the
"beautiful" formatting of the printed object. This function is appropriate
to ingludde ggplot2 plots, if they have to be displayed as gg
plots and not plotly
plots.
add_as_text()
converts obj
to character
,
formats as text and includes it in the container
. Function
print_all
will print it as text ('as-is').
add_as_heading()
converts obj
to
character
,
formats it as a heading of section and includes it in the
container
.
Function print_all
will print it as text.
add_as_plotly_widget()
converts plotly objects
to plotly htmlwidget (details in as_widget
) and
includes it in the container
. Function print_all
will
print it as plotly htmlwidget and attach html
dependencies.
add_as_pander()
formats supported types of obj
with An R Pandoc
Writer's function pander
and includes it in the
container
. Function print_all
will print the object
as text.
add_as_strings
converts input to vectors of chatacter and saves every
vector as sepatate strings (i.e. separate paragraphs).
add_as_code()
saves object as text and prints it formatted as code
(i.e., as formatted text).
add_as_code_r()
saves object as text and prints it formatted as
R code text.
add_as_code_js()
saves object as text and prints it formatted as
Java Script code.
add_as_output()
saves object as text and prints it formatted as
output text.
add_as_data()
adds object (data frame, list, vector, etc.) to the
container.
When function print_all
the object is not printed, but just
extracted and assigned in the environment env
(by default to the
parent frame) to the object which name is entered as value of parameter
give.name
.
add_as_cmd()
takes unquoted expression and
converts it to a string.
The expression is going to be evaluated when function
print_all
is applied.
add_as_cmd_str()
is the same as add_as_cmd()
, just object
must be entered entered as a string.
Vilmantas Gegzna
Other knitrContainer
functions:
Join()
,
add_as_heading()
,
as.knitrContainer()
,
knitrContainer-class
,
print_all()
,
print()
,
summary()
# Find examples in link `knitrContainer-class`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.