Skip to content

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

Open

Description

@paleomariomm

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.

Activity

  1. ijlyttle commented on May 17, 2020

    @ijlyttle
    Owner

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions