What mode should I use to install R packages? Source or Binary?

32 Views Asked by At

In the past, my R defaulted to installing from source, so I learnt (by habit) to say NO to "source" prompt. Lately, R doesn't prompt me. It just defaults to binary.

  1. Can some knowledge soul confirm for me if R automatically switches to compile from source if it doesn't find the binary version?

  2. I saw some suggest to disable "Source" installing somewhere (may be .Rprofile file). Is this hack okay?

  3. In the .Rprofile file, you can list download mirrors with your preferred mode:

    options(repos = c(
      binary = "https://packagemanager.posit.co/cran/latest", // for windows
      source = "https://packagemanager.posit.co/cran/latest",
      CRAN = "https://cloud.r-project.org",
    ))
    

    Is this the only option to have it switch?

  4. Sometimes the package is archived so I have to download it as tar.gz. Does R need to compile this compressed file from source? Can't tar.gz be installed as binary? I have the impression that Centos RPM does that ...

0

There are 0 best solutions below