View source: R/clone_package.R
copy_package | R Documentation |
This function is a convenience wrapper around clone_package()
that
copies a package rather than cloning it. The distinction is that new PIDs will
always be generated, and the system metadata will reflect a stand-alone package
rather than a clone. This function copies a data package from one DataONE Member Node to another,
with new identifiers This can also be used to restore an older version of a package
to a Member Node, provided that the user subsequently obsoletes the version of
the package that they used to create the copy using obsolete_package()
.
copy_package(
resource_map_pid,
from,
to,
public = FALSE,
clone_children = FALSE
)
resource_map_pid |
(character) Object pid |
from |
(D1Client) D1Client to clone package from. (Token must be set for this node) |
to |
(D1Client) D1Client to clone package to. (Token must be set for this node) |
public |
(logical) Optional. Will set public read access. Defaults to |
clone_children |
(logical) Optional. Will clone all children recursively if TRUE. Defaults to |
Dominic Mullen, dmullen17@gmail.com
clone_package()
obsolete_package()
## Not run:
# First set up the member nodes we're copying between
# (in this example they are the same but could be different)
to <- dataone::D1Client("STAGING", "urn:node:mnTestARCTIC")
from <- dataone::D1Client("STAGING", "urn:node:mnTestARCTIC")
# Choose a package to copy (here a new one is created)
package <- arcticdatautils::create_dummy_package(to@mn)
copied_package <- clone_package(resource_map_pid = package$resource_map,
from = from,
to = to)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.