Compling a Report to Word from R

I am not sure which chunk of code to give you for this particular error. However, I need to finish this report, and any help would be greatly appreciated.

The error is as follows:
Error in eval(expr, envir, enclos) : object 'Trends' not found
Calls: ... handle -> withCallingHandlers -> withVisible -> eval -> eval
Execution halted

can be checked with

ls()

to see if there is an object named Trends in the global environment. If not, is there such a named object anywhere in the script? If this is an Rmd document, change the questions to relate to the scope of the chunk in which the error arises.

1 Like

When you knit an Rmd document to any output format (i.e. Docx, PDF, html, etc) the code gets executed in a clean environment other than the one you are currently working in, so if you haven't included code for defining/importing the Trends object in your Rmd file it is not going to exist in the new working environment.

2 Likes

This topic was automatically closed 7 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.