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

查看:299
本文介绍了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:\Users\U122337.BOSTONADVISORS\AppData\Local\Temp\Rtmp404t8Y\downloaded_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,检查第一个目录,删除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天全站免登陆