Object x not found

Hi. I sometimes get an error msg like "object x not found", despite my having used that object successfully in the previous line. After trying everything I can think of, I decide to give up for awhile, close RStudio, and come back later. Suddenly the error msg disappears.

What could explain this, and what should I have done diffently?

1 Like

There are many things that could cause it. When you close and reopen RStudio, maybe something wasn't saved as a variable as it was before you close it. So, when you compiled again, the rotine works. Other thing is that when you close the RStudio, sometimes the directory doesn't save. So, you could run the codes with another previous directory that you've worked with. Bugs can occur, they're quite normal, especially when your code is huge. Don't discard this possibility.