I have a dataframe in R called df
. This is available across all .r files in the R session. I want to knitr some of the results from this dataframe into a .Rmd file. I'm using the following code:
```{r}
names(df)
```
If I highlight and run the line: names(df)
within the .Rmd file, it correctly prints out the names of df
: [1] "ISIN" "CF" "DATE"
. But if I click on Knit HTML
, it outputs in HTML:
## NULL
How do I get a .Rmd document to access Global Environment variables?