0

I updated R to version 4.3.0 a few days ago. Since then have off and on run into this problem where instead of seeing a character string, R thinks I am referring to an object and tells me the object is not found. An example is when I ran

plot_sim_result(sim = readRDS(file.path(sim.dir, "sim.rds")),
                ...)

it gives this error:

Error in plot_sim_result(sim = readRDS(file.path(sim.dir, "sim.rds")),  : 
  object '"sim.rds"' not found

If I run either

file.path(sim.dir, "sim.rds")

or

readRDS(file.path(sim.dir, "sim.rds"))

it has no problem.

The funny thing is R starts out dealing with this kind of request just fine, and then some time into the session it starts doing this. I shut R down and open it up again, and it keeps doing it.

This problem happens with other functions, too. The common thread is that the character string is an argument in the function.

I am using R 4.3.0 on a MacBook, macOS Big SUR 11.7.6. Rstudio tells me it's up to date.

Thank you for any pointers to what may be going on and how to fix it.

  • It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input and desired output that can be used to test and verify possible solutions. What exactly does this `plot_sim_result` function do? Does it use non-standard evaluation? – MrFlick May 01 '23 at 15:00
  • Thank you, MrFlick. I'll try to come up with a reproducible example but the problem is that it's not reproducible. If I do some other stuff and come back the problem may go away. And everything is fine for a while, then I run into it again, with a different function. plot_sim_result() makes a plot of some simulation results that I store in that file sim.rds. It does not use nonstandard evaluation. – Trang Q. Nguyen May 01 '23 at 15:11
  • The funny thing about this instance of the problem right now is that when I resorted to reading the file into an object tmp, then feed tmp to the sim argument instead of the path, the error runs to the next input of the function that is a character string (plot.type = "bias"), saying object '"bias"' not found. Anyway, I'll figure out how to ask the question better. – Trang Q. Nguyen May 01 '23 at 15:12

0 Answers0