Gets or sets the visits identifier for a OrganizedBirds-class.

visits(x, name=NULL)

visits(x, name = NULL, useAsDefault = TRUE) <- value

Arguments

x

An OrganizedBirds-object

name

The name of the visit column. Default is NULL, which will get/write to the predefined visit column (visitUID).

useAsDefault

Specifies if the defined column in name should be used as the default column for the visits in further analysis. If name is NULL and useAsDefault = TRUE, value will be written to column (visitUID) and that column will be set as default.

value

the value to assign

Value

Either extracts a vector with visits IDs from an object of class 'OrganizedBirds' if used as visits(), or it binds a column with visit IDs to the spatial data.frame within the OrganizedBirds-object if used as 'visits<-'

Examples

ob <- organizeBirds(bombusObs) attr(ob, "visitCol")
#> [1] "visitUID"
vis <- visits(ob) tmp.vis <- createVisits(bombusObs, idCols=c("locality"), timeCols = c("day", "month", "year"), gridIdCol = "id") visits(ob, name = "visNoRecorder", useAsDefault = TRUE) <- tmp.vis vis2 <- visits(ob) attr(ob, "visitCol")
#> [1] "visNoRecorder"