I am new to the R community and i have been learning by myself with online ressources the R language and some of its packages for a month or so with the aim to automate preliminar data processing in order to have an overview of experiemental results. I managed to process my data and now i wish to create a basic report that will contain plots and some of my dataframes.
I have learned how to import raw data from excel files, tidy and manipulate them as data frames using several of the tidyverse's packages and producing ggplots. I have created an Rproject in a way that helps me organise all my files.
Now I want to create a basic PDF or HTML report that will contain some of the dataframes and ggplots i have produced . After struggling with gridextra i think Rmarkdown could be an elegant solution to my problem. But as far as i've read on Rmarkdown's basics, i cant manage to import my r script objects and variables into my Rmd file. I know that i can save and load my r objects using save() and load() functions but it does not work when i use load() into my r chunks of code to import them.
Ps: i am working on Rstudio.
Can anyone help me on that matter, if you have any advices and ressources please share them i am all ears. Thanks in advance.
Hi M_AcostaCH thank you for your answer.
According to what i see in your screenshot you seem to do your R data manipulations directly in the code chunks of the Rmarkdown file. I wanted to really separate the data manipulations and the report. And as you can see in my screenshot, i just imported the r script of my rproject into the Rmarkdown file in order to select the objects of the global environement that it produced. To do so i used the R function source().
I dont know if its a good way to work but compartimentalize the different steps helps me.
Ofcourse, you could put the data in one chunk, for run well the code, and when you make a Rmarkdown file put like hidden data. Its indicate that the data is not show in the final file but its necesary for run well the code.
I see that you use include=F, but in my case Im use echo=F for indicate that the run the chunk but dont show the script in the final file. In this case the plot run but not show the code.
Maybe you could use this for load the object or data, but dont show in the final file.