Split R package into two packages without disrupting user experience
Suppose I am currently developing a package called mypackage
. Over time, many other features have landed there and I want to reorganize it. So I would like to create a new package called newpackage
, in which I would move some of the features mypackage
(and include them later).
The problem is that I don't want the original users to mypackage
get errors object not found
when they want to use one of the moved functionality.
So, I thought about the following:
- create
newpackage
and move functions - add to
mypackage
file DESCRIPTION:Depends: newpackage
This way, when people install, update, or download mypackage
, newpackage
it will also be installed or downloaded, and all functions will be available.
Do you think this will work or will there be some problems that I am not thinking about?
Thank!
source to share
Isn't it that it's not a good idea to remove functions from a package without flagging them first to be deprecated ?! So, you may be continuing as planned, but before you remove them from mypackage
, you can first mark them as depreciated there and then remove them from it finally in the next version of the package. And during the migration phase, you could use the package namespace to reference the function in already newpackage
, as you planned.
source to share