0

I have a question for the community.

Am I required to have a line to import a file whenever I knit an R Notebook file? The dataframe I'd like to use is already in memory as part of my global environment, but unless I include an import line I get the following error in the render tab of the console pane in RStudio:

Error ... : object 'my_df' not found
Calls: <Anonymous>... withCallingHandlers -> withVisible -> eval -> eval ->  filter
Execution halted

This error occurs at the beginning of my notebook where I'm reassigning a filtered object for analysis. Currently I have to import the object (it's an xlsx file) before I knitting completes successfully.

Any thoughts? Thanks!

benh56
  • 37
  • 5
  • 1
    Yes. Documents are knitted in a separate process and do not share your current global environment. Documents must be self-sufficient (ie they must import explicitly all the data they need). – MrFlick Jan 06 '22 at 20:17
  • Thank you, that answers my question perfectly! – benh56 Jan 06 '22 at 21:01

0 Answers0