Skip to contents

Initialize a new GBIF Event object

Usage

initializeGBIFEvent(
  objectData,
  idColumnInfo,
  nameAutoMap = FALSE,
  defDateFormat = "YYYY-MM-DD",
  ...
)

Arguments

objectData

A data.frame containing the data to import into the object

idColumnInfo

Either a character scalar containing the column name of objectData or an integer scalar giving the index of the column of objectData that corresponds to the ID variable. Alternatively, this parameter may be the qualified name of the Darwin core term for which the appropriately mapped column will be used as the ID variable (the possible Darwin core term names can be found by running names(getGBIFEventMembers()))

nameAutoMap

A logical scalar that if TRUE maps the columns of objectData to their respective Darwin core terms based on the column names

defDateFormat

A character scalar providing the default format for strings denoting dates in the data table. See the https://dwc.tdwg.org/text/#1-introductionDarwin Core text guide for expected values for this string.

...

A named set of paramaeters corresponding to Darwin core terms associated with the GBIFEvent class type. Each is either a character scalar containing the column name of objectData or an integer scalar giving the index of the column of objectData that corresponds to the term. Mappable terms can be found using: sapply(X = getGBIFEventMembers(), FUN = function(curTerm) { curTerm$getTermName() })

Value

A new GBIFEvent object

See also

DwCTerm getGBIFEventMembers

Examples

if (FALSE) {
## Get a dataset as an Archive and then extract the event core
## Get the dataset using the key:
datasetKey <- "aea17af8-5578-4b04-b5d3-7adf0c5a1e60"
Archive <-getLNportalData(datasetKey = datasetKey)
event<-Archive$getCoreTable()
## Convert the event back to a dataframe
event=event$exportAsDataFrame()
## Then use the dataframe to initialise an object of class GBIF event
GBIFevent<-initializeGBIFEvent(event, idColumnInfo = "id", nameAutoMap = TRUE)
}