update_object: Update an object with a new file.

Description Usage Arguments Value Examples

View source: R/editing.R

Description

This is a convenience wrapper around 'dataone::updateObject' which copies in fields from the old object's System Metadata such as the rightsHolder and accessPolicy and updates only what needs to be changed.

Usage

1
update_object(mn, pid, path, format_id = NULL, new_pid = NULL, sid = NULL)

Arguments

mn

(MNode) The Member Node to update the object on.

pid

(character) The PID of the object to update.

path

(character) The full path to the file to update with.

format_id

(character) Optional. The format ID to set for the object. When not set, guess_format_id will be used to guess the format ID. Should be a DataONE format ID.

new_pid

(character) Optional. Specify the PID for the new Object. Defaults to automatically generating a new, random UUID-style PID.

sid

(character) Optiona. Specify a Series ID (SID) to use for the new Object.

Value

(character) The PID of the updated object.

Examples

1
2
3
4
5
6
7
8
## Not run: 
cn <- CNode("STAGING2")
mn <- getMNode(cn,"urn:node:mnTestKNB")
pid <- "urn:uuid:23c7cae4-0fc8-4241-96bb-aa8ed94d71fe"
my_path <- "/home/Documents/myfile.csv"
new_pid <- update_object(mn, pid, my_path, format_id = "text/csv")

## End(Not run)

NCEAS/arcticdatautils documentation built on April 12, 2018, 1:57 a.m.