CoCalc Public FilesPublic / r-beamer-demo.RmdOpen with one click!
Author: Hal Snyder
Views : 95
Description: Create Beamer slides with R markdown - Rmd
Compute Environment: Ubuntu 18.04 (Deprecated)

title: Rmd Beamer Example author: John Doe date: July 9, 2018

Example of Beamer Slides from R Markdown


  • Instructions
  • An image
  • Two R code chunks
  • An equation typeset in LaTeX
  • References

How to Create Beamer Slides from an Rmd file

  • put title information in yaml prologue (optional)
  • open a .term file and run these commands
  • rendered view in Rmd editor may not look right - view the pdf file to see slides
  $ R
  > library(rmarkdown)
  > render("filename.Rmd", beamer_presentation())
  > quit()
  $ open filename.pdf


NASA Exoplanet Exploration Program


Radius of planet: rp=rs×ΔBBr_p=r_s{\times}{\sqrt{\frac{{\Delta}B}{B}}}

Radius of planet's orbit: r=GMsP24π23r=\sqrt[3]{\frac{G{M_s}{P^2}}{4{{\pi}^2}}}

R Code Chunk 1

Get Data

qry  <- paste0("table=exoplanets&select=",
site <- paste0("",
url <- paste0(site, "?", qry)
exo <- read.csv(url, stringsAsFactors=F)
exo$pl_discmethod <- as.factor(exo$pl_discmethod)

R Code Chunk 2

Yield for different methods of discovery. Use log scale on vertical axis

exot <- table(exo$pl_discmethod)
exoto <- exot[order(exot,decreasing = T)]

par(mar=c(12.5,3,3.5, 0.3), cex.main=1.5)
  main="Exoplanets Discovered vs. Method",
  log="y", ylim=c(1,3000))


Beamer User Guide \newline

R Markdown Presentations with Beamer \newline

R function to create beamer slides \newline

NASA Exoplanet Exploration Program \newline