bsplus functions only show text lines and not R outputs
Opened this issue · 1 comments
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
.
The content
argument has to be HTML (or will be rendered as HTML).
As I get back into this (sorry for delay), maybe the best thing will be to emphasize this in the documentation.