Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

R not finding package even after package installation

I have always worked with the zoo package, that I have installed a long time ago. Today, I created a new R script, and ran library(zoo) and got the following error:

 > library(zoo)  Error in library(zoo) : there is no package called ‘zoo’ 

Odd.. Still, I tried reinstalling the package using install.packages("zoo"), and get the following:

 > install.packages("zoo")  Installing package(s) into ‘C:/Users/U122337.BOSTONADVISORS/Documents/R/win-library/2.15’  (as ‘lib’ is unspecified)  --- Please select a CRAN mirror for use in this session ---  trying URL 'http://cran.cnr.Berkeley.edu/bin/windows/contrib/2.15/zoo_1.7-10.zip'  Content type 'application/zip' length 874474 bytes (853 Kb)  opened URL  downloaded 853 Kb   package ‘zoo’ successfully unpacked and MD5 sums checked  Warning: cannot remove prior installation of package ‘zoo’  The downloaded binary packages are in     C:\Users\U122337.BOSTONADVISORS\AppData\Local\Temp\Rtmp404t8Y\downloaded_packages 

When I try uploading the package, I get the error again that the zoo package doesn't exist.

I have no idea what's happening. I exited the GUI and restarted it, same problem. I have always worked with this package, and I have no idea why this is happening now.

like image 802
Mayou Avatar asked Oct 16 '13 15:10

Mayou


People also ask

Why packages are not installing in R?

You need to set your library path to a folder that exists. Show activity on this post. In my case antivirus which was stopping r studio to download and install. For that we can either add exception in antivirus for r studio or disable antivirus and install.

How check R package is installed or not?

packages() Calling installed. packages() returns a detailed data frame about installed packages, not only containing names, but also licences, versions, dependencies and more.


1 Answers

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.

like image 150
statquant Avatar answered Sep 20 '22 10:09

statquant