I would like to know how do I export the results of an R-code to a panel developed in HTML?
I would like to know how do I export the results of an R-code to a panel developed in HTML?
You can make good dashboards with the flexdashboard
package. I'll put an example below, but of course you can do much more complex things, for example: link
First, install the package using
install.packages("flexdashboard")
Then run this here to create a file template.
rmarkdown::draft("dashboard.Rmd", template = "flex_dashboard", package = "flexdashboard")
It will create a file named dashboard.Rmd
with a template code, well apprehended with the below. There you can put your code to generate the graphics the way you want.
For example:
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
'''{r setup, include=FALSE}
library(flexdashboard)
'''
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
'''{r}
plot(mtcars$disp, mtcars$drat)
'''
Column {data-width=350}
-----------------------------------------------------------------------
### Chart B
'''{r}
plot(mtcars$qsec, mtcars$cyl)
'''
### Chart C
'''{r}
plot(mtcars$mpg, mtcars$drat)
'''
Then press ctrl
+ shift
+ K
or click the knit
button in RStudio. This will generate an html, just like the one below.
Youcanconfigurejustabouteverything.Thedocumentationisverygood.Readmorehere: link