Using Data from Environment in R Markdown -
this question has answer here:
im trying use data global environment in r markdown. when call 'summary(mydata)'
gives me error:
object 'mydata' not found
i got work in many different scripts, not easy me create .r
file each result.
so, can call data defined on global environment in r markdown?
thank you.
there 2 ways load data "mydata" .rmd file:
don't knit file rstudio "knit" button:
library(knitr) knit('your_file.rmd')
this take recent environment account , error should gone.
store "mydata" "mydata.rdata" , load manually in rmd file
```{r load mydata, include=false} load("mydata.rdata")
if way can use "knit" button rstudio.
i hope 1 of ways solution you.
Comments
Post a Comment