For each knitr code chunk option below

  1. Add the option to the code chunk it accompanies.
  2. Rerender the file to see what the option does. If you cannot tell, rerender the file both with and without the code chunk.
  3. Describe in your own words what the option does.

eval

carmeans1 <- colMeans(cars)
1 + 1

Description:


results

carmeans2 <- colMeans(cars)
1 + 1
# Hint: compare the difference between eval and results
# exists() states whether an object exists 
# with the given name
exists("carmeans1") # "created" with eval=FALSE
exists("carmeans2") # "created" with results='hide'

Description:


echo

plot(cars)

Description:


fig.width and fig.height

When adding multiple arguments to a code chunk, separate the arguments by a comma.

plot(cars)

Description:


message

# packages like to print messages when they load
library(forecast)

Description:


warning

warning("This function returns a warning!")

Description:




rstudio/reportsWS documentation built on May 28, 2019, 5:42 a.m.