找不到功能“年份".从zip文件R安装后 [英] Could not find function "year" after installation from zip file R

查看:75
本文介绍了找不到功能“年份".从zip文件R安装后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用R,并且在没有互联网连接的服务器上工作.因此,我不得不搜索如何从zip文件安装软件包.我想使用lubridate软件包.

I'm using R and working on a server without internet connection. So I had to search how to install packages from a zip file. I wanted to use the lubridate package.

install.packages("V:/R/lubridate_1.3.3.zip", repos=NULL)

然后我尝试使用

library(lubridate) 
year(data$date)

,但是我收到了错误package or namespace load failed for "lubridate".还有function year could not be found.

but I received an error that package or namespace load failed for "lubridate". And the function year could not be found.

我忘了任何步骤吗?

推荐答案

如果从CRAN镜像使用install.packages安装软件包,则会自动安装导入和依赖关系树.如果下载zip并进行脱机安装,那显然是不可能的.因此,您也必须下载并安装所有这些软件包.

If you install a package with install.packages from a CRAN mirror, the imports and dependency tree is installed automatically. If you download the zip and do an offline installation that's obviously not possible. Thus, you have to download and install all these packages, too.

您可以从 lubridate的CRAN页面中找到主要依赖项和导入. /a>,然后按照链接获取整棵树.或者,您可以从MRAN中获得它.

如果我什么都没错过,则需要plyr,stringer,memoise,Rcpp,stringi,magrittr和摘要.

If I didn't miss anything, you need plyr, stringr, memoise, Rcpp, stringi, magrittr, and digest.

对于具有大依赖关系树的软件包,此方法可能也不可行.在这种情况下,您可以使用此SO答案中的功能.

This method is also probably not really feasible for packages with big dependency trees. You could use the function from this SO answer in such a case.

这篇关于找不到功能“年份".从zip文件R安装后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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