Takes a data.frame and a vector of column names and classifies each row of the data.frame based on the combination of values in the specified columns.
createVisits( x, idCols = c("locality", "recordedBy"), timeCols = c("day", "month", "year"), grid = NULL, gridIdCol )
x | An object of class |
---|---|
idCols | A vector with the names of the columns other (than time columns)
that are used to identify a visit. This variable cannot be empty. At least the
recorders name or any other ID must be provided. Default is the Darwin Core
variables |
timeCols | A vector with the names of the time columns that are used to
identify a visit. If timeCols=NULL then time is ignored to create a visit ID.
Default is the Darwin Core variables |
grid | Either |
gridIdCol | column in grid with ids. |
A vector of the same length as the number of rows as the data.frame with a unique number for each combination of the values in the specified columns.
What a visit should be is not always clearly defined and extractable in a
dataset. A reasonable assumption is that a visit could be identified from the
records made by one person on a certain day and at a specific location or site.
The default value for the variable column is therefore that a visit is identified
by the Darwin Core variables c("locality", "day", "month", "year",
"recordedBy")
.
OB <- organizeBirds(bombusObs) tmp.vis <- createVisits(bombusObs, idCols=c("locality", "recordedBy"), timeCols=c("day", "month", "year"), gridIdCol = "id") visits(OB, name = "visNoRecorder", useAsDefault = TRUE) <- tmp.vis