Hi! I have a really odd problem with my R installation which I am not able to rectify even after reinstalling R on my system.
Upon starting Rstudio or an R interpreter in terminal I get the normal printout of current R version. However there is also an Error: object 'il' not found message. This message has persisted even after I uninstalled and reinstalled all R packages on my system, R itself, and Rstudio too. Here's how it looks like when I start R:
I am able to use most of R libraries without issue, however:
I can't install packages via install.packages(). This prompts the Error: object 'il' not found error to halt execution of the installation. However, I can install packages through the terminal via sudo apt install r-cran-*.
I cannot use the "knit" button in Rstudio. This prompts the Error: object 'il' not found error again.
When I try to manually knit via knitr::knit(), it only generates an md output.
I have tried to rectify the problem by:
Checking whether I had an .Rprofile that caused the error. I had no .Rprofile files. I created one which just prints "Loading custom .Rprofile" to see whether the object not found error occurs before or after .Rprofile is loaded. It occurs before any .Rprofile is loaded.
I reset Rstudio settings to default.
I uninstalled r-base-core, all r-cran- packages on my system, deleted user specific packages previous installed via install.packages() under my home directory, uninstalled Rstudio. Then I reinstalled all of them. The issue remains.
I am not sure how I'm even supposed to troubleshoot this cryptic error message. Any help would be appreciated.
Is there a way I can do a more thorough uninstall ensuring I've purged absolutely everything R related?
Thanks for the troubleshooting suggestions. I tried them:
traceback() gives "No traceback available.".
Same error from terminal as from inside Rstudio.
Can't find any il object in library/base/R/Rprofile. Looks pretty normal. I tried printing some text at the end of the Rprofile, and the error about the missing object occurs after that text is printed.
Installed another version of R (4.1.3.1 and 3.6.3-2). Unfortunately same error again.
I have no custom .Renviron. And looks normal when it's recreated in /usr/lib/R/etc
Really strange. I must have probably messed something up on my system installing/removing other libraries. R used to work fine. Feeling this is gonna be hard to debug.
I wish markdown/knitting worked, then I could just ignore it, as I can manage without installing through install.packages(). Very obscure that this only affects certain specific functionality and persists over reinstalls.