40
Error in exists(cacheKey, where = .rs.WorkingDataEnv, inherits = FALSE) : 
  invalid first argument

I used the rm() function in R to delete a couple of data frames. They were successfully deleted. However, this prompt kept popping up anytime I ran a new code.

1

4 Answers 4

32

I faced the same error today. For me, it was fixed after restarting Rstudio. You could simply restart by clicking on Session -> Restart R in the top bar. After that, I was able to run my code again without any error.

9

This error message is now fixed in RStudio versions 2023.06.1-524 and later. https://github.com/rstudio/rstudio/issues/13188 refers.

4

This seems to be a problem with the IDE (R-Studio). I was able to solve the problem after updating R-Studio to the latest build: 2023.06 Mountain Hydrangea, in the link below:

2023.06 Mountain Hydrangea

2
  • 6
    Still getting the same bug with this version - annoying hopefully it gets fixed soon
    – Markm0705
    Commented Jul 6, 2023 at 0:11
  • 1
    The fix starts with build 2023.06.1+437, so you shouldn't have problem beyond that version number.
    – MS Berends
    Commented Jul 7, 2023 at 18:17
2

Closing and reopening the script worked for me.

Not the answer you're looking for? Browse other questions tagged or ask your own question.