Installing a package offline from GitHub

前端 未结 5 1948
[愿得一人]
[愿得一人] 2020-12-14 18:06

I\'m trying to port some packages to an R installation on an offline (Windows) computer.

From CRAN (let\'s say data.table), the process: 1) download .zip

5条回答
  •  臣服心动
    2020-12-14 18:51

    Not sure if this is a solution or a workaround. Given a zip file of the source of an R package directory structure:

    On a shell:

    ~$ unzip data.table-master.zip
    ## optional renaming
    ~$ mv data.table-master data.table
    ## create the new
    ~$ tar czf data.table.tar.gz data.table
    

    There are likely other tools that allow you to extract and re-archive them in a different format. Since I tend towards shell-level access and control, I tend towards these simple tools.

    In R:

    install.packages("data.table.tar.gz", type="source", repos=NULL)
    

    (This will not succeed unless all dependencies are already installed.)

提交回复
热议问题