Package development workflow

If you're tweaking functions in one of your packages while working on another project let's say is called Analysis, how do you update the package in the Analysis project? I'm currently pushing changes to the package directory to GitHub and then installing from GitHub in the Analysis project. Is there a better way?

1 Like

I can think of various ways to handle this 2-project workflow, and your solution certainly works.

I think one big way it could be improved is to avoid going through GitHub each time you make an update to the package. Since both projects are on the same machine, you could directly install and use the local copy. This would also allow you to test out the new change you made to the package without having to first commit the change to the Git repository.

As an example, imagine that your package is located at ~/projects/mypkg. To test out the latest changes you've made, you can install it for use in your project Analysis by running devtools::install("~/projects/mypkg"). And if you are making frequent updates to mypkg, it may make more sense to quickly load the package functions with devtools::load_all("~/projects/mypkg").

1 Like

Thanks... exactly what I was looking for. I had a blind spot to the fact that you can specify the path with load_all... I've always used load_all() only in the package directory.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.