Loading an R Package from a Custom directory

后端 未结 5 2087
温柔的废话
温柔的废话 2020-12-25 12:57

If I download an \"package-name\".tar.gz file from CRAN website, gunzip and untar it into a custom directory, how do I load that package from within R? I cannot extract the

5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-25 13:40

    Try using Hadley Wickham's devtools package, which allows loading packages from a given directory:

    library(devtools)
    
    # load package w/o installing
    load_all('/some/package/diR')
    
    # or invoke 'R CMD INSTALL'
    install('/some/package/diR')
    

提交回复
热议问题