1. Try compiling this document using the “Knit HTML” button. What files are produced?
  2. Edit the output to be “pdf_document” and recompile. What files are produced?
  3. Edit the output to be “word_document” and recompile. What files are produced?
  4. What does the label “chunk1” do in the following code chunk?
x = rnorm(100)
plot(x)

This is a primary header. Add a secondary header with ## on the line below and recompile.

  1. Change fig.height to something larger/smaller and see what happens
x = rnorm(100)
plot(x)

  1. Add a chunk option of fig.align=“center” to center this plot
x = rnorm(100)
plot(x)

  1. Add a chunk option of echo=FALSE and see what happens

  1. Uncomment this code and recompile the document. Then add a chunk command cache=TRUE and recompile. What files are created? Try compiling one more time.
#Sys.sleep(10)
  1. Check out the docs at: http://rmarkdown.rstudio.com/ and look under formats. See if you can create and compile an R markdown presentation. How about a parameterized report?

See https://www.rstudio.com/resources/rstudioconf-2018/parameterized-r-markdown-reports-with-rstudio-connect/ to learn more about parameterized reports. Check out the lecturs for how to make presentations.

  1. Add the command devtools::session_info() to this chunk and look at the output
devtools::session_info()
## ─ Session info ───────────────────────────────────────────────────────────────
##  setting  value                       
##  version  R version 4.0.3 (2020-10-10)
##  os       macOS Mojave 10.14.6        
##  system   x86_64, darwin17.0          
##  ui       X11                         
##  language (EN)                        
##  collate  en_US.UTF-8                 
##  ctype    en_US.UTF-8                 
##  tz       America/New_York            
##  date     2021-07-12                  
## 
## ─ Packages ───────────────────────────────────────────────────────────────────
##  package     * version date       lib source                            
##  bslib         0.2.4   2021-01-25 [1] CRAN (R 4.0.2)                    
##  cachem        1.0.4   2021-02-13 [1] CRAN (R 4.0.2)                    
##  callr         3.7.0   2021-04-20 [1] CRAN (R 4.0.2)                    
##  cli           2.5.0   2021-04-26 [1] CRAN (R 4.0.2)                    
##  codetools     0.2-18  2020-11-04 [1] CRAN (R 4.0.2)                    
##  crayon        1.4.1   2021-02-08 [1] CRAN (R 4.0.3)                    
##  desc          1.3.0   2021-03-05 [1] CRAN (R 4.0.2)                    
##  devtools      2.3.2   2020-09-18 [1] CRAN (R 4.0.2)                    
##  digest        0.6.27  2020-10-24 [1] CRAN (R 4.0.2)                    
##  ellipsis      0.3.2   2021-04-29 [1] CRAN (R 4.0.2)                    
##  evaluate      0.14    2019-05-28 [1] CRAN (R 4.0.0)                    
##  fastmap       1.1.0   2021-01-25 [1] CRAN (R 4.0.2)                    
##  fs            1.5.0   2020-07-31 [1] CRAN (R 4.0.2)                    
##  glue          1.4.2   2020-08-27 [1] CRAN (R 4.0.2)                    
##  highr         0.9     2021-04-16 [1] CRAN (R 4.0.2)                    
##  htmltools     0.5.1.1 2021-01-22 [1] CRAN (R 4.0.2)                    
##  jquerylib     0.1.3   2020-12-17 [1] CRAN (R 4.0.2)                    
##  jsonlite      1.7.2   2020-12-09 [1] CRAN (R 4.0.2)                    
##  knitr         1.33.6  2021-06-17 [1] Github (yihui/knitr@11eeb43)      
##  lifecycle     1.0.0   2021-02-15 [1] CRAN (R 4.0.2)                    
##  magrittr      2.0.1   2020-11-17 [1] CRAN (R 4.0.2)                    
##  memoise       2.0.0   2021-01-26 [1] CRAN (R 4.0.2)                    
##  pkgbuild      1.2.0   2020-12-15 [1] CRAN (R 4.0.2)                    
##  pkgload       1.1.0   2020-05-29 [1] CRAN (R 4.0.0)                    
##  prettyunits   1.1.1   2020-01-24 [1] CRAN (R 4.0.0)                    
##  processx      3.5.2   2021-04-30 [1] CRAN (R 4.0.2)                    
##  ps            1.6.0   2021-02-28 [1] CRAN (R 4.0.2)                    
##  purrr         0.3.4   2020-04-17 [1] CRAN (R 4.0.0)                    
##  R6            2.5.0   2020-10-28 [1] CRAN (R 4.0.2)                    
##  remotes       2.4.0   2021-06-02 [1] CRAN (R 4.0.2)                    
##  rlang         0.4.11  2021-04-30 [1] CRAN (R 4.0.2)                    
##  rmarkdown     2.9.1   2021-06-17 [1] Github (rstudio/rmarkdown@bafed5e)
##  rprojroot     2.0.2   2020-11-15 [1] CRAN (R 4.0.2)                    
##  sass          0.3.1   2021-01-24 [1] CRAN (R 4.0.2)                    
##  sessioninfo   1.1.1   2018-11-05 [1] CRAN (R 4.0.2)                    
##  stringi       1.6.2   2021-05-17 [1] CRAN (R 4.0.2)                    
##  stringr       1.4.0   2019-02-10 [1] CRAN (R 4.0.0)                    
##  testthat      3.0.1   2020-12-17 [1] CRAN (R 4.0.2)                    
##  usethis       2.0.1   2021-02-10 [1] CRAN (R 4.0.2)                    
##  withr         2.4.2   2021-04-18 [1] CRAN (R 4.0.2)                    
##  xfun          0.24    2021-06-15 [1] CRAN (R 4.0.2)                    
##  yaml          2.2.1   2020-02-01 [1] CRAN (R 4.0.0)                    
## 
## [1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library