Interesting, it doesn't do that on my R 4.2.2 (nor 4.2.1, 4.2.0, 4.1.2, 4.1.0 that I had on my computer). What version are you using? Make sure you can reproduce in the R terminal (not Rstudio), with the --vanilla
flag.
I do believe so.
I don't understand enough, I just feel that's similar to other problems we've seen on this forum (e.g. this one where you helpfully participated), where R gets installed in OneDrive and that causes problems. If that's the case, it won't be so much a bug in R's code for parent.frame()
, but rather a problem that requires Windows configuration.
I did mention "if, like me, you're not familiar with C code, [...] useless". For me, it's useless, but that's because I'm not familiar with C nor the R internals; on a function like parent.frame()
I could spend hours staring at the code having no idea what's happening. Obviously, for other people (e.g. the R Core team), it would be perfectly clear and meaningful.
I honestly wouldn't understand nor care enough. But if you think it might be useful to other people finding this thread because of a similar problem, sure, it would be nice for them!