View source: R/bdc_year_from_eventDate.R
bdc_year_from_eventDate | R Documentation |
This function extracts a four-digit year from unambiguously interpretable collecting dates.
bdc_year_from_eventDate(data, eventDate = "eventDate")
data |
A data frame containing a column with event date information. |
eventDate |
Numeric or date. The column with event date information. |
A data.frame containing the column "year". Year information is returned only if "eventDate" can be unambiguously interpretable from "eventDate". Years in the future (e.g., 2050) are returned as NA as well as years before 1600, which is the lower limit for collecting dates of biological specimens.
Other time:
bdc_eventDate_empty()
,
bdc_year_outOfRange()
collection_date <- c(
NA, "31/12/2015", "2013-06-13T00:00:00Z", "2019-05-20",
"", "2013", "0001-01-00", "20", "1200"
)
x <- data.frame(collection_date)
bdc_year_from_eventDate(data = x, eventDate = "collection_date")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.