uploadDataObject: Upload a DataObject to a DataONE member node.

uploadDataObjectR Documentation

Upload a DataObject to a DataONE member node.

Description

Upload a DataObject to a DataONE member node.

Usage

uploadDataObject(x, ...)

## S4 method for signature 'D1Client'
uploadDataObject(
  x,
  do,
  replicate = as.logical(FALSE),
  numberReplicas = NA,
  preferredNodes = NA,
  public = as.logical(FALSE),
  accessRules = NA,
  quiet = TRUE,
  ...
)

Arguments

x

A D1Client instance.

...

(Not yet used.)

do

The DataObject instance to be uploaded to DataONE.

replicate

A value of type "logical", if TRUE then DataONE will replicate this object to other member nodes

numberReplicas

A value of type "numeric", for number of supported replicas.

preferredNodes

A list of "character", each of which is the node identifier for a node to which a replica should be sent.

public

A "logical" value - if TRUE then the uploaded object will be publicly readable.

accessRules

Access rules of 'data.frame' that will be added to the access policy

quiet

A 'logical'. If TRUE (the default) then informational messages will not be printed.

Value

id The id of the DataObject that was uploaded

See Also

D1Client class description.

Examples

## Not run: 
library(dataone)
library(datapack)
testdf <- data.frame(x=1:10,y=11:20)
csvfile <- tempfile(pattern = "file", tmpdir = tempdir(), fileext = ".csv")
write.csv(testdf, csvfile, row.names=FALSE)
d1c <- D1Client("STAGING", "urn:node:mnStageUCSB2")
do <- new("DataObject", format="text/csv", mnNodeId=getMNodeId(d1c), filename=csvfile)
# Upload a single DataObject to DataONE (requires authentication)
newId <- uploadDataObject(d1c, do, replicate=FALSE, preferredNodes=NA ,  public=TRUE)

## End(Not run)

dataone documentation built on June 11, 2022, 1:06 a.m.