New to R, how do I fix "install packages" problem?

Hi, new to R and have been receiving the message:

"Error in Install.packages("rpart.plot") :
could not find function "Install.packages""

when trying to install rpart.plot. The fix seems to be here: Error: could not find function "install.packages" for R markdown; but the post is lacking detail. How do I "Look for it [an '.Rprofile with an install command on it'] and remove the command."?

Looks like you were doing Install.packages() (with a capital "I") rather than install.packages() with a lower-case "I" which is the right way to call it.

2 Likes

Hey, To address the error message regarding the inability to find the install.packages function when installing rpart.plot in R, you need to locate and edit your .Rprofile file. This file may contain a command to install packages automatically. Search for any lines containing install.packages in the .Rprofile file and remove or comment out these lines. After saving the changes and restarting R, attempt to install rpart.plot again using the install.packages function to resolve the issue. e.g: on the sublime by longinus

Thank you that got it!

Thanks! For future reference, how do I find .RProfile?

Locate the .Rprofile File : The .Rprofile file is a hidden file in your R home directory that contains R startup settings. Depending on your operating system, the location of this file may vary. You can typically find it in your user directory or R home directory.

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.