Ian_T
November 4, 2023, 12:00am
1
Upon start up in R studio, the R console shows:
Error: could not find function "update.packages"
I attempted to render a document with R markdown, though an error message was returned:
Error: could not find function "update.packages"
Not sure that a discrepancy in the file paths using find.package("utils") and path.package("utils") is a contributing factor/issue
Any help is greatly appreciated.
R version 4.3.2 (2023-10-31 ucrt) -- "Eye Holes"
R studio (2023.09.1 Build 494)
Platform: x86_64-w64-mingw32/x64 (64-bit)
I do not think you can update packages in an Rmd document /environment.
If you want to update packages you should do it in the General Environment, that is the one that loads automatically when you start RStudio normally.
Gabor
November 4, 2023, 2:56pm
3
You mean you did not run that function yourself? Do you have update.packages()
in your .Rprofile
file?
Ian_T
November 4, 2023, 8:24pm
4
The update .packages() command comes up during start up, I didn't put it in the Rmd document, when pressing the knit but the render tab opens and shows the error message.
R on start up
Render tab after pressing knit
Ian_T
November 4, 2023, 8:37pm
5
I did not run that function, that is what shows on start up. update.packages() is not in my .Rprofile file.
Gabor
November 4, 2023, 9:58pm
6
Sorry, I meant your user's profile, not the system profile, i.e. what is the output of this?
writeLines(readLines("~/.Rprofile"))
Make sure that you omit sensitive information!
Also, please copy and paste the output between markdown fences, i.e. three ``` characters, like this :
```
<your output>
```
Ian_T
November 4, 2023, 11:07pm
7
The output I received are:
writeLines(readLines("~/.Rprofile"))
update.packages(ask = FALSE)
Gabor
November 5, 2023, 6:56am
8
Yes, so you do have update.packages()
in your profile. Remove that line from ~/.Rprofile
.
Ian_T
November 5, 2023, 12:36pm
9
That worked! thanks so much I have some research to do on what .RProfile is and why it is important.
Gabor
November 5, 2023, 2:03pm
10
Every time an R process starts up, it runs the code from your .Rprofile
. See
?.Rprofile
system
Closed
November 12, 2023, 2:03pm
11
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.