I'd like to include a JSON tree in my rmarkdown result. Here's a reproducible example:
library(plotly)
p <- ggplot(mtcars, aes(x = wt, y = mpg)) +
geom_point() + geom_smooth()
plotly_json(p)
The object created by calling plotly_json(p)
is "jsonedit" "htmlwidget"
.
While using this piece of code before knitting the result is presented in the Viewer. This is the way I want the result presented in html file.
However, having knitted the document to html I get the same result but in text form.