I am using R Markdown to create a report using R chunks.
When loading bsplus package and mtcars dataset, I try to create an accordion. Here is the example:
head <- head(mtcars)
tail <- tail(mtcars)
bs_accordion(id ="Data: mtcars") %>%
bs_append(title = "Head of mtcars", content = head) %>%
bs_append(title = "Tail of mtcars", content = tail)
I would like the accordion to display the objects head and tail, which represent datasets for the first 6 rows and last 6 rows of the mtcars dataset respectively.
However, I get this result:
As you can see, only one text line is shown. So my question is:
How can I show R objects, as data frames, matrix, PCA analysis, plots, etc, in this bsplus functions?
This problem happens as well with bs_collapse, bs_accordion and bs_append.
I am using R Markdown to create a report using R chunks.
When loading
bsplus
package andmtcars
dataset, I try to create an accordion. Here is the example:I would like the accordion to display the objects
head
andtail
, which represent datasets for the first 6 rows and last 6 rows of themtcars
dataset respectively.However, I get this result:
As you can see, only one text line is shown. So my question is:
How can I show R objects, as data frames, matrix, PCA analysis, plots, etc, in this
bsplus
functions?This problem happens as well with
bs_collapse
,bs_accordion
andbs_append
.