Code entered into R Notedbook:
Code:
---
title: "test"
output: html_notebook
---
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir=WORKING.DIRECTORY)
summary(cars)
head(cars)
On
Make sure you actually run the code chunks you want to see displayed and save the file:
I've also set root.dir to the result of getwd(). This doesn't change the result as far as displaying the tables, but here is the whole file for reference:
---
title: "test"
output: html_notebook
editor_options:
chunk_output_type: inline
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
knitr::opts_knit$set(root.dir=getwd())
```
```{r}
summary(cars)
head(cars)
```
Try using
getwd()instead of WORKING.DIRECTORY.Generate new code chunk:
The keyboard shortcut to do this is Ctrl + Alt + I (OS X: Cmd + Option + I)
Output:
Created on 2020-07-25 by the reprex package (v0.3.0)