Trying to knit in r studio and getting this error

Error in spread(Data_Extract_From_WDI_names, "Series Name", "2018") :
object 'Data_Extract_From_WDI_names' not found
Calls: ... withVisible -> eval_with_user_handlers -> eval -> eval -> spread
Execution halted

and Im confused on how to fix it

When you knit an Rmd document the code gets executed in a clean environment other than the one you are currently working on so the mentioned data frame doesn't exist there. You need to include the necessary code to import the data frame into memory, in your Rmd document itself, for example, if the data frame comes from a csv file you would include something like this: your_data_frame <- read.csv("path_to_file.csv").

1 Like

it came from an excel file

and I have this above
datw = readxl::read_excel("~/Desktop/Data_Extract_From_WDI_names.xlsx", sheet = "Data")

We don't really have enough info to help you out. Could you ask this with a minimal REPRoducible EXample (reprex)? A reprex makes it much easier for others to understand your issue and figure out how to help.

If you've never heard of a reprex before, you might want to start by reading this FAQ:

1 Like

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.