WSpiller/RadialMR

install_local error

Closed this issue · 2 comments

When I try to install this offline, using install_local('RadialMR-master.zip'), I get the error 'Could not resolve host: api.github.com'. Of course this happens because there is no internet connection, but is there any way to circumvent this?

There are quite a few ways to do this.

  1. Install a binary version of the package from our https://mrcieu.r-universe.dev

    If you are on Windows or Mac run

    install.packages("RadialMR", repos = c("https://mrcieu.r-universe.dev", "https://cran.r-project.org"))

    If you are on Ubuntu Linux follow the instructions here (changing the package name).

  2. Download the binary package from https://mrcieu.r-universe.dev then install locally.

    E.g. on an Apple Silicon Mac the binary version is at https://mrcieu.r-universe.dev/bin/macosx/big-sur-arm64/contrib/4.3/RadialMR_1.1.tgz download that then run

    # setwd() to directory where .tgz file is saved
    download.file('https://mrcieu.r-universe.dev/bin/macosx/big-sur-arm64/contrib/4.3/RadialMR_1.1.tgz', destfile = 'RadialMR_1.1.tgz')
    install.packages('RadialMR_1.1.tgz', repos = NULL)

    You can find the URLs for Windows etc by going to https://mrcieu.r-universe.dev/RadialMR and hovering over the links for the .zip/.tgz/.tar.gz files (URL shown at bottom of page or right click and Copy Link Address).

    windows-url

  3. Create the binary package locally then install

    Fork this repo then clone it down to your machine - or simply download the repo as a zip file and extract as you seem to have already done.

    Open the directory containing the repo and double click the RadialMR.Rproj file - it will open in RStudio Desktop as an RStudio project.

    In the R console in RStudio run

    devtools::install_dev_deps()

    Then there are several ways to create the binary package - the easiest being to go to the Build pane, click More, click Build Binary Package.

    rstudio-radialmr

    You'll see the compressed archive saved in the directory above the RadialMR directory.

    Screenshot 2024-04-02 at 18 47 01

    Then use install.packages('../RadialMR_1.1.tgz', repos = NULL) to install.

Hope this helps.

Closing as answer provided.