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:

  1. don't knit file rstudio "knit" button:

    library(knitr) knit('your_file.rmd')

this take recent environment account , error should gone.

  1. 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

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -