-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathcreateD1Object.Rd
More file actions
38 lines (35 loc) · 1.04 KB
/
createD1Object.Rd
File metadata and controls
38 lines (35 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/D1Client.R
\name{createD1Object}
\alias{createD1Object}
\alias{createD1Object,D1Client,D1Object-method}
\title{Create the Object in the DataONE System}
\usage{
createD1Object(x, d1Object, ...)
\S4method{createD1Object}{D1Client,D1Object}(x, d1Object)
}
\arguments{
\item{x}{: D1Client}
\item{d1Object}{A D1Object instance to upload to DataONE}
\item{...}{(not yet used)}
}
\value{
TRUE if the object was successfully uploaded, FALSE if not.
}
\description{
Create the Object in the DataONE System
}
\examples{
\dontrun{
library(dataone)
library(uuid)
d1c <- D1Client("STAGING", "urn:node:mnStageUCSB2")
data <- readLines(system.file("extdata/strix-pacific-northwest.xml", package="dataone"))
dataRaw <- charToRaw(paste(data, collapse="\n"))
newid <- sprintf("urn:node:\%s", UUIDgenerate())
d1o <- new("D1Object", id=newid, data=dataRaw, format="text/plain")
d1o <- setPublicAccess(d1o)
# Upload the object to DataONE (requires authentication)
uploaded <- createD1Object(d1c, d1o)
}
}