simple_read: Parse a DarwinRecordSet and SimpleDarwinRecordSet files

Description Usage Arguments Details Value Examples

View source: R/simple.R

Description

Parse a DarwinRecordSet and SimpleDarwinRecordSet files

Usage

1

Arguments

file

(character) A path to a single simple Darwin Core file in XML format. Required.

Details

Make sure when reading a DarwinRecordSet to access the chunks by position rather than name since duplicate names are allowed in chunks.

Value

a S3 class dwc_recordset when a DarwinRecordSet is given, or a dwc_simplerecordset when a SimpleDarwinRecordSet is given. In each case the object is really just a list, with lightweight S3 class attached for easy downstream usage. Prints summary to screen by default

Examples

 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
## Not run: 
# SimpleDarwinRecordSet examples
file <- system.file("examples", "example_simple.xml", package = "finch")
simple_read(file)
file <- system.file("examples", "example_simple_fossil.xml",
  package = "finch")
simple_read(file)

# DarwinRecordSet examples
file <- system.file("examples", "example_classes_observation.xml",
  package = "finch")
simple_read(file)

file <- system.file("examples", "example_classes_specimen.xml",
  package = "finch")
simple_read(file)

# access elements of the object
file <- system.file("examples", "example_classes_specimen.xml",
  package = "finch")
res <- simple_read(file)
## namespaces
res$meta
## locations
res$locations
## chunks, the first one
res$chunks[[1]]

## End(Not run)

finch documentation built on Aug. 11, 2020, 9:06 a.m.