DwCArchive | R Documentation |
R6 class representing a complete data structure for a Darwin Core archive
R6Class
object.
The DwcArchive
class serves a base class to all Darwin Core
archive file types. This class supports all kinds of Darwin Core archive files
but may miss some of the specialised functionality of the more specialist
classes. See https://dwc.tdwg.org/text/the Darwin core archive guide
for more information on the structure of Darwin core archive files.
new()
Create a new DwCAchive
object
DwCArchive$new(coreDwC, extDwC = NULL, metadata = NULL)
coreDwC
A DwCGeneric
(or derived class) object that represents the
table that corresponds to the 'core' table. Alternatively, this parameter can be
character
scalar giving the location of the Darwin core archive file to
initialize the object from
extDwC
A list
of DwCGeneric
(or derived class) objects that represent
the tables used as extension objects in the Darwin Core archive. If coreDwC
is a character scalar then extDwC
can also be a character scalar that contains the
default file encodings for the files in the Darwin core archive
metadata
A DwCMetadata
object that contains the metadata for the archive
exportAsDwCArchive()
Export the archive as a Darwin core archive file
DwCArchive$exportAsDwCArchive( fileName, quote = TRUE, sep = "\t", eol = "\n", na = "", dec = ".", qmethod = "escape", fileEncoding = "", emlLocation = "eml.xml" )
fileName
A character
string containing the file location of the output Darwin Core Archive.
quote
A logical
scalar or a numeric
vector. If TRUE
, any character or factor
columns will be surrounded by double quotes. If a numeric
vector, its elements are taken as the
indeces of columns to quote. In both cases, row and column names are quoted if they are written. If FALSE
,
nothing is quoted.
sep
The field seperator stirng. Values within each row are separated by this string.
eol
The character(s) to print at the end of each line (row).
na
The string to use for missing values in the data.
dec
The string to use for decimal points in numeric or complex columns: must be a single character
qmethod
A character string specifying how to deal with embedded double quote characters when
quoting strings. Must be one of "escape"
, in which case the quote character is escaped in C style by a
backslash, or "double"
, in which case it is doubled
fileEncoding
A character string. If non-empty, declares the encoding to be used on a file so the character data can be re-encoded as they are written
emlLocation
The location to store the EML metadata in the Darwin Core archive
print()
Print the archive information
DwCArchive$print()
getNumberExtensions()
Retrieve the number of extensions used in the archive
DwCArchive$getNumberExtensions()
An integer
scalar containing the number of extensions used in the archive
getCoreTable()
Retrieve the core table in the archive
DwCArchive$getCoreTable()
An object derived from DwCGeneric
that contains the core table information
getExtensionTables()
Retrieve an extension table from the archive
DwCArchive$getExtensionTables(extIndex = NULL)
extIndex
Either an integer
vector giving the indeces of the extension tables to
retrieve from the archive or a character
vector giving the names of the tables to
retrieve from the archive. If this parameter is NULL
then all extension tables are
retrieved
A list
of objects derived from DwCGeneric
that contains the extension table
information
getMetadata()
Retrieve the metadata for the archive
DwCArchive$getMetadata()
A DwCMetadata
object that contains the metadata of the archive
clone()
The objects of this class are cloneable with this method.
DwCArchive$clone(deep = FALSE)
deep
Whether to make a deep clone.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.