How do I convert R code to HTML?


#1

Hello everyone,

I would like to perform calculations in R and then have data be available in an html document (such as an array). Does anyone know how to bridge the barrier between a dataframe and HTML code?

Thank you!


#2

I think what you want is rmarkdown. Lots of tutorials there.


#3

Have you tried nextjournal (nextjournal.com)? It might help!


#4

Thank you for responding! I am actually using one of R Markdown's output formats called Flexdashboard. My issue is that I would like to save data as a JSON within the markdown document (HTML) to be accessed by another program. Do you have any suggestions?


#5

This looks like a great resource! I'm working in Flexdashboard right now.


#6

Can you post a simple reprex?


#7

Maybe have a look at the packages xtable or stargazer.


#8

Can you be more precise on this ? what do you want to achieve ?
To expose data between program, making an API is one solution and plumber :package: is great for that !

EDIT: For reference, there is another thread about that. How to save JSON Data into R Markdown