Skip to content

Instantly share code, notes, and snippets.

@damianooldoni
Last active December 7, 2018 11:47
Show Gist options
  • Save damianooldoni/01da78e5e55617798804db1804434754 to your computer and use it in GitHub Desktop.
Save damianooldoni/01da78e5e55617798804db1804434754 to your computer and use it in GitHub Desktop.
Type specification of fields of GBIF occurrence downloads
library(readr)
col_types <- cols(
acceptedNameUsage = col_character(),
acceptedNameUsageID = col_character(),
accessRights = col_character(),
associatedReferences = col_character(),
associatedSequences = col_character(),
associatedTaxa = col_character(),
bed = col_character(),
behavior = col_character(),
bibliographicCitation = col_character(),
catalogNumber = col_character(),
collectionID = col_character(),
continent = col_character(),
coordinatePrecision = col_double(),
county = col_character(),
created = col_date(),
dateIdentified = col_character(),
dataGeneralizations = col_character(),
datasetID = col_character(),
day = col_integer(),
disposition = col_character(),
dynamicProperties = col_character(),
earliestEonOrLowestEonothem = col_character(),
elevation = col_double(),
elevationAccuracy = col_double(),
endDayOfYear = col_integer(),
establishmentMeans = col_character(),
fieldNotes = col_character(),
fieldNumber = col_character(),
footprintSRS = col_character(),
footprintSpatialFit = col_character(),
footprintWKT = col_character(),
georeferencedBy = col_character(),
georeferencedDate = col_date(),
georeferenceProtocol = col_character(),
georeferenceRemarks = col_character(),
georeferenceSources = col_character(),
georeferenceVerificationStatus = col_character(),
habitat = col_character(),
higherClassification = col_character(),
identificationID = col_character(),
identificationQualifier = col_character(),
identificationReferences = col_character(),
identificationRemarks = col_character(),
identificationVerificationStatus = col_character(),
individualCount = col_integer(),
infraspecificEpithet = col_character(),
informationWithheld = col_character(),
institutionID = col_character(),
language = col_character(),
latestEraOrHighestErathem = col_character(),
latestPeriodOrHighestSystem = col_character(),
lifeStage = col_character(),
lithostratigraphicTerms = col_character(),
locationAccordingTo = col_character(),
locationRemarks = col_character(),
minimumDistanceAboveSurfaceInMeters = col_double(),
month = col_integer(),
municipality = col_character(),
nameAccordingTo = col_character(),
nameAccordingToID = col_character(),
namePublishedInID = col_character(),
nomenclaturalCode = col_character(),
nomenclaturalStatus = col_character(),
organismQuantity = col_character(),
otherCatalogNumbers = col_character(),
ownerInstitutionCode = col_character(),
parentNameUsage = col_character(),
parentNameUsageID = col_character(),
pointRadiusSpatialFit = col_double(),
preparations = col_character(),
recordNumber = col_character(),
reproductiveCondition = col_character(),
sampleSizeUnit = col_character(),
sampleSizeValue = col_double(),
samplingEffort = col_character(),
scientificNameID = col_character(),
sex = col_character(),
taxonConceptID = col_character(),
taxonID = col_character(),
taxonRemarks = col_character(),
type = col_character(),
typeStatus = col_character(),
verbatimElevation = col_character(),
verbatimSRS = col_character(),
verbatimTaxonRank = col_character(),
vernacularName = col_character(),
waterBody = col_character(),
year = col_integer()
)
# Load occurrences
occ_df <- read_delim(
file = occ_df_file, delim = "\t",
escape_double = FALSE, trim_ws = TRUE,
col_types = col_types)
occ_df <- occ_df %>%
mutate(dateIdentified = as_datetime(dateIdentified))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment