Search code examples
rgithubpackagedevtools

Do packages installed from Github need Rtools?


I am creating my first package, which shall be installed through Github. I thought that Rtools was needed only for the person creating it. However, people that tried to install it using Github were asked to update Rtools. Is this really necessary?

Doing some research, I found this: https://community.rstudio.com/t/missing-rtools-should-i-be-worried/27817

One of the answers says the following:

"This means that if you are going to install packages that need compilation, you also have to install Rtools in your system. "

This is the repo with the package: https://github.com/datazoompuc/PNAD_Covid/tree/master/R/datazoom_pnad_covid

What does this actually mean? How do I know that my package needs compilation?


Solution

  • I thought that Rtools was needed only for the person creating it.

    Yes, if and only if you distribute it as a binary. Then the creator uses Rtools to compile and link, and the user just installs, and enjoys.

    That is how CRAN works as CRAN compiles for Windows users.

    GitHub, however, is foremost a source repository so the installation from GitHub is using a source mode ... and every user will need to compile, and hence have Rtools. (Unless the package and all its depedencies are R-code only.)

    You can also have a package repository on GitHub using e.g. the drat package to create it, but that is getting us a little further from the original question.