R not finding package even after package installation
Do .libPaths()
, close every R runing, check in the first directory, remove the zoo
package restart R and install
zoo
again. Of course you need to have sufficient rights.
Updated R, copied library, still can't find packages, and can't seem to install all dependencies
The tidyverse
package hardly contains anything: its main purpose is to get a bunch of other packages loaded. Removing it and updating it won't help update the other packages. You could do what @phago29 suggested in their comment, but an easier way is just to update everything. Run this command in an R session:
update.packages(ask = FALSE, checkBuilt = TRUE)
A few notes:
If you have admin capabilities, run as admin, and it will update your main library. If you don't, it'll install new copies in your user account.
Even though you're saying
ask = FALSE
, it may ask some questions about whether you can build packages from source. Answer "Yes" if your system is set up to do that, "No" if not. If you're not sure, try "Yes", and if you get install failures, run it again and say "No".)This is likely to run for a while, so go away and have a coffee or something.
Error: there is no package called ... and trying to use install.packages to solve it
Error in library(readr) : there is no package called 'readr'
This means that you don't have the package readr
installed on your computer.
You then installed it with
install.packages('readr', dependencies = TRUE, repos='http://cran.rstudio.com/')
which is good. Most packages are not "stand-alone", they use other packages too, called dependencies. Because you used the default dependencies = TRUE
, all the dependencies (and their dependencies) were also installed.
You can look at the CRAN page for readr
: https://CRAN.R-project.org/package=readr to see its dependencies (anything in the "Depends" or "Imports" fields is required). And of course you need the dependencies of those dependencies, etc. Now that readr
is installed along with its dependencies, you can run library(readr)
to load it.
Packages won't install through RStudio
If the problem persists, go to C:\Program Files\R\R-4.0.3 and right click on the 'library' folder. Go to 'properties', and click on the 'security' tab. Edit the access rights to give yourself (user) rights to edit.
Related Topics
How to Add Another Layer/New Series to a Ggplot
Add Moving Average Plot to Time Series Plot in R
Colorize Parts of the Title in a Plot
In R, How to Subset a Data.Frame by Values from Another Data.Frame
Plots with Good Resolution for Printing and Screen Display
Sub-Assign by Reference on Vector in R
Control Number of Decimal Places on Xtable Output in R
R Shiny Error: Object Input Not Found
In Ggplot2, How to Add Additional Legend
Pandoc Insert Appendix After Bibliography
Calculate Sum of a List of Variables by Group
Programmatically Insert Text, Headers and Lists with R Markdown
Apply Function to Each Column in a Data Frame Observing Each Columns Existing Data Type
Run R Script from .Bat (Batch File)