The normal invocation is something like move( myobj, ., 0/another.task)
-- note the lack of quotes around myobj
. To move objects with names that have to be quoted, or to move several objects at the same time, specify the what
argument: e.g. move( what=c( "myobj", "%myop%"), ., 0/another.task)
. Note that move
is playing fast and loose with standard argument matching here; it correctly interprets the .
as from
, rather than x
. This well-meaning subversion can lead to unexpected trouble if you deviate from the paradigms in Examples. If in doubt, you can always name from
and to
.
move
can also handle moves in and out of packages being live-edited (see maintain.packages
). If you want to specify a move to/from your package "whizzbang", the syntax of to
and from
should be ..whizzbang
(i.e. the actual environment where the pre-installed package lives). An alternative for those short of typing practice is maintained.packages$whizzbang
. No quotes in either case.
If move
finds an object with the same name in the destination, you will be asked whether to overwrite it. If you say no, the object will not be moved. If you want to force overwriting of a large number of objects, set overwrite.by.default=TRUE
.
By default, move
will delete the original object after it has safely arrived in its destination. It's normally only necessary (and more helpful) to have just one instance of an object; after all, if it needs to be accessed by several different tasks, you can just move
it to an ancestral task. However, if you really do want a duplicate, you can avoid deletion of the original by setting copy=TRUE
.
You will be prompted for whether to save
the source and destination tasks, if they are attached somewhere, but not in position 1. Normally this is a good idea, but you can always say no, and call Save.pos
later. If the source and/or destination are not attached, they will of course be saved automatically. The top workspace (i.e. current task) .GlobalEnv
is never saved automatically; you have to call Save
yourself.
move
is not meant to be called within other functions.