“installation of package 'FILE_PATH' had non-zero exit status” in R

前端 未结 9 619
感情败类
感情败类 2020-12-01 09:31

By installing the package in R using the following command:

install.packages(\'FILE_PATH\', repos=NULL, type = \"source\")

I got the follow

相关标签:
9条回答
  • 2020-12-01 09:59

    Try use this:

        apt-get install r-base-dev
    

    It will be help. After then I could makeinstall.packages('//package_name')

    0 讨论(0)
  • 2020-12-01 10:01

    Simple install following libs on your linux.
    curl: sudo apt-get install curl
    libssl-dev: sudo apt-get install libssl-dev
    libcurl: sudo apt-get install libcurl4-openssl-dev
    xml2: sudo apt-get install libxml2-dev

    0 讨论(0)
  • 2020-12-01 10:03

    I had the same problem, but the answer from @little_chemist helped me sorting it out. When installing packages from a file in a unix OS (Ubuntu 18.04 for me), the file can not be zipped. You are using:

    install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, type="source")
    

    I noticed the solution was as simple as unzipping the package. Additionally, unzip all (installation related?) packages inside, as @little_chemist points out. Then use install.packages:

    install.packages("/home/p/Research/14_bivpois-Rcode", repos = NULL, type="source")
    

    Hope it helps!

    0 讨论(0)
  • 2020-12-01 10:04

    The .zip file provided by the authors is not a valid R package, and they do state that the source is for "direct use" in R (by which I assume they mean it's necessary to load the included functions manually). The non-zero exit status simply indicates that there was an error during the installation of the "package".

    You can extract the archive manually and then load the functions therein with, e.g., source('bivpois.table.R'), or you can download the .RData file they provide and load that into the workspace with load('.RData'). This does not install the functions as part of a package; rather, it loads the functions into your global environment, making them temporarily available.

    You can download, extract, and load the .RData from R as follows:

    download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip', 
                  f <- tempfile())
    unzip(f, exdir=tempdir())
    load(file.path(tempdir(), '.RData'))
    

    If you want the .RData file to be available in the current working directory, to be loaded in the future, you could use the following instead:

    download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip', 
                  f <- tempfile())
    unzip(f, exdir=tempdir())
    file.copy(file.path(tempdir(), '.RData'), 'bivpois.RData')
    # the above copies the .RData file to a file called bivpois.RData in your current 
    # working directory.
    load('bivpois.RData')
    

    In future R sessions, you can just call load('bivpois.RData').

    0 讨论(0)
  • 2020-12-01 10:09

    Did you check the gsl package in your system. Try with this:

    ldconfig-p | grep gsl
    

    If gsl is installed, it will display the configuration path. If it is not in the standard path /usr/lib/ then you need to do the following in bash:

    export PATH=$PATH:/your/path/to/gsl-config 
    

    If gsl is not installed, simply do

    sudo apt-get install libgsl0ldbl
    sudo apt-get install gsl-bin libgsl0-dev
    

    I had a problem with the mvabund package and this fixed the error

    Cheers!

    0 讨论(0)
  • 2020-12-01 10:11

    You can try using command : install.packages('*package_name', dependencies = TRUE)

    For example is you have to install 'caret' package in your R machine in linux : install.packages('caret', dependencies = TRUE)

    Doing so, all the dependencies for the package will also be downloaded.

    0 讨论(0)
提交回复
热议问题