I am trying to figure out how the R development process using RStudio (and Windoze) should look in case I want to customize an existing package for personal use. So let's say there is package X (which I have installed using packages.install from cran/rforge whatever) with function y which I use from within my function z (in some file ~/myRFile.R).
So what I would have done is the following:
- Remove the installed package (using remove.packages(X))
- Fetch the source from rforge/github etc. and save it in ~/downloadedPackage.
Now I am starting to struggle what I have to do next. What's the best way link my existing file (~/myRFile.R) to the source in ~/downloadedPackage? I know I could probably figure out in which R file function y was and load it using source("~/downloadedPackage/theFileWithFunctionY.R") but I cannot imagine that this is the right way to do so, or is it? I would imagine there is a way to "load"/"source" all the code at once? What I also tried was just to use
install.packages("~\downloadedPackage")
library(downloadedPackage)
but this just gives me "installing package... warning package is not available (as binary package for R...)". Furthermore I assume that installing the package everytime a small change is made during the development process is suboptimal anyways (for instance I guess it would be much harder to debug the code once it is installed).
So I am not really looking for step by step instructions on how to build a package, but rather on the big picture of how to set up the optimal process and toolchain in order to
- modify
- test
- reinstall
an existing R package.
Btw: I am most familiar with the Java buildtools/process in case it is easier to explain it by reference to another set of buildtools (javac, ant, maven, gradle, etc.).