ijlyttle / bsplus

Shiny and R Markdown addons to Bootstrap 3
http://ijlyttle.github.io/bsplus/
Other
146 stars 23 forks source link

bsplus functions only show text lines and not R outputs #53

Open paleomariomm opened 6 years ago

paleomariomm commented 6 years ago

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:

enter image description here

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.

ijlyttle commented 4 years ago

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.