R即使在安装包后也找不到包 [英] R not finding package even after package installation

查看:43
本文介绍了R即使在安装包后也找不到包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直使用 zoo 包,我很久以前就安装了这个包.今天,我创建了一个新的 R 脚本,运行 library(zoo) 并得到以下错误:

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’

奇怪.. 不过,我尝试使用 install.packages("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:UsersU122337.BOSTONADVISORSAppDataLocalTempRtmp404t8Ydownloaded_packages

当我尝试上传包时,我再次收到 zoo 包不存在的错误.

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

我不知道发生了什么.我退出 GUI 并重新启动它,同样的问题.我一直在使用这个包,但我不知道为什么现在会发生这种情况.

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.

推荐答案

.libPaths(),关闭每一个R运行,check in第一个目录,去掉zoo> 包重新启动 R 和 install zoo 再次.当然你需要有足够的权限.

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.

这篇关于R即使在安装包后也找不到包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆