Sarah N
Sarah N

Reputation: 536

R package development - old version of function used in project

I am developing a package locally with devtools in RStudio. After modifying a function, when I try to call it from a project, R keeps using the old version of the function.

My workflow is to:

But the modification I just did would not be effective. What is wrong with this workflow?

Upvotes: 4

Views: 857

Answers (1)

alexwhitworth
alexwhitworth

Reputation: 4907

?devtools::build:

Building converts a package source directory into a single bundled file. If binary = FALSE this creates a tar.gz package that can be installed on any platform, provided they have a full development environment (although packages without source code can typically be install out of the box). If binary = TRUE, the package will have a platform specific extension (e.g. .zip for windows), and will only be installable on the current platform, but no development environment is needed.

My reading of this is that you still need to devtools::install() your package. Building just creates the binary, it doesn't install the new version.

Upvotes: 1

Related Questions