I see better. Basically what you need to do is to first, download the code, second, get into the code directory and follow the instructions to create a package, as if it was a package you just wrote.
For downloading the code, easiest is to go on the Github page, click on the green <> Code
button and select Download ZIP
. If you're familiar with git
, you can also fork the repo and make a local clone.
Now, you have the zip file on your computer, unzip it, and create a new RStudio project in that existing directory (RStudio is not necessary, but can help for the first pass).
When you're in this Project, run devtools::check()
(you might need to install {devtools}
). This is a wrapper for R CMD CHECK
, I'll come back to it. If everything worked well, you'll see a lot of text as many aspects of the package are tested, and it should end with 0 errors (on my computer it also has 1 warning and 3 notes, we can ignore them for now).
Then, run devtools::build()
, this should be much faster, and end by giving you the path to the tarball it just created! If you want the tarball to be installable on Windows easily, instead run devtools::build(binary = TRUE)
, the file created will be .zip
instead of .tar.gz
. You can now say that you fulfilled your goal and stop here.
To install this package on a separate (Windows) computer, run:
install.packages("C:\path\to\RDCOMClient_0.96-1.zip")
If you want to understand better, what I just used is the approach described in the r-pkgs book. I highly recommend that you read the first part, especially the structure chapter.
Now, we "cheated" a bit, because we used the devtools
wrappers. Actually check()
and build()
themselves are calling R CMD CHECK
and R CMD BUILD
, which is the more "traditional" way of building packages. To understand all of it, you need to read the "Writing R extensions" manual.
In brief, as previously, make sure the code is downloaded and ready. Then open a Windows terminal (e.g. cmd
), then use cd
and dir
to navigate to the directory with the package, and run this command:
R CMD check .
You should see about the same text as with devtools::check()
from within R. In my case, this check failed with a LaTeX error, which is not unexpected, so I won't try harder. If you wish to, you can check the R CMD BUILD
section of the manual.