你可以在R中如何安装一个包?

huangapple go评论130阅读模式
英文:

How can I install a package in R?

问题

我尝试在R中安装NHANES-RAW80Hz包,但它不起作用。R指出的问题如下:

正在将包安装到'C:/Users/x/AppData/Local/R/win-library/4.2'
(因为未指定'lib')
警告:install.packages中无法打开压缩文件'NHANES-RAW80Hz-0.0.3/DESCRIPTION',可能原因是'找不到文件或目录'
install.packages中的错误:无法打开连接。

我认为问题可能来自.zip文件中的错误,但我已经与作者联系,她没有回复我。
下载该文件的链接是:https://clevengerkimberly.github.io/2022-10-19-nhanesraw/

我尝试更改.zip文件中的顺序,但这并没有起作用,因为该包已安装在R中,但当我尝试使用library函数激活它时,程序会显示:
library(NHANES-RAW80Hz):没有名为'NHANES-RAW80Hz'的包

有人知道如何安装这个包吗?
谢谢大家!

英文:

I tried to install the NHANES-RAW80Hz package in R but it does not work. The problem that indicates R is the following:

Installing package into ‘C:/Users/x/AppData/Local/R/win-library/4.2’
(as ‘lib’ is unspecified)
Warning in install.packages :
cannot open compressed file 'NHANES-RAW80Hz-0.0.3/DESCRIPTION', probable reason 'No such file or directory'
Error in install.packages : cannot open the connection.

I think that the problem comes from a error in the .zip file, but I have contacted with the auther and she didn't reply me.
The link to download the file is: https://clevengerkimberly.github.io/2022-10-19-nhanesraw/

I tried to change the order in the .zip folder, but It did not work because the package is installed in R but when I try to active it witch the library function, the program says:
library(NHANES-RAW80Hz) : there is no package called ‘NHANES-RAW80Hz’

Someone know how can I install this package?
Thank you guys!!

答案1

得分: 0

我成功重现了您的错误(下载文件,使用RStudio的软件包窗格从zip安装)。错误消息表明文件夹中的软件包嵌套层次太深。

  • NHANES-RAW80Hz-0.0.3.zip解压缩到NHANES-RAW80Hz-0.0.3
  • 转到子文件夹NHANES.RAW80Hz
  • 压缩这个子文件夹 -> NHANES.RAW80Hz.zip
  • 从这个zip文件安装。
英文:

I was able to reproduce your error (downloaded file, using RStudio packages pane to install from zip). The error message indicates that the package in the folder is nested too deply.

  • Unpack NHANES-RAW80Hz-0.0.3.zip to NHANES-RAW80Hz-0.0.3
  • Navigate to subfolder NHANES.RAW80Hz
  • Zip this subfolder -> NHANES.RAW80Hz.zip
  • Install from this zip

huangapple
  • 本文由 发表于 2023年3月9日 16:36:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75682128.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定