Search code examples
rinstallationpackagezip

How can I install a package in R?


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!!


Solution

  • 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