Error in working directory in R Markdown

Hey hey !

I'm a beginner on R Markdown, I want to make within a project a .Rmd summary of several df and objects compiled in several scripts of my R project.

So I followed the following tuto :

By changing directly in the working directory in the menu (Tools -> Global Options -> R Markdown).

When I compile in the console my .Rmd no error appears but if I knit my .Rmd in HTML format it gives me an error as soon as I call the first df:
Error in eval(expr, envir, encols) :
object 'data' not found
Calls: Anonymous> .. withVisible -> eval_with_user_handlers -> eval -> eval
Execution stopped

I wonder if it's not a directory problem, the 'data' df in question is in my environment.
However when I look at my Knit Directory I am in Project Directory.

I hope to have been clear, good day to you

I don't think this is a directory problem.

Your data object needs to be define or made available inside your Rmd document. When rendering a document, it will be done in a clean and fresh background session. So data that are in your R environment won't be available anymore. You need to make them available either by putting the code that creates them into the Rmd or by loading the object in the document.

Hope it helps

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.