Export single variables from SummarisedBirds objects

exportBirds(x, dimension, timeRes, variable, method = "sum")

Arguments

x

a SummarizedBirds-object

dimension

a character string indicating if the export should be "spatial" or "temporal"

timeRes

A character string indicating what temporal resolution should be used. For Spatial export the function accepts NULL, "yearly", "monthly" or "month". For temporal export the function accepts "yearly", "monthly", "daily" or "month".

variable

a character string indicating which variable should be exported, "nObs", "nVis", "nSpp", "nDays", "nCells" or "avgSll" . For timeRes = c(NULL, "month") the function also accepts "nYears".

method

Only applicable to timeRes = "month". A variable specifying which statistical method should be applied. The function accepts "sum", "median", "mean".

Value

an xts time series (if dimension = "temporal"), a named vector (if dimension = "temporal" and timeRes = "month"), or a sf (if dimension = "spatial")

Note

the difference between timeRes = "monthly" and timeRes = "month" is that the former returns "n.years x 12" values, while month summarize over years and returns only 12 values aplying the method among years. For more details over the possible combinations of dimensions and variables please refer to the vignette "Technical details".

Examples

# \donttest{ grid <- makeGrid(searchPolygon, gridSize = 10) SB <- summariseBirds(organizeBirds(bombusObsShort), grid=grid) EB <- exportBirds(SB, "spatial", "month", "nDays", "median") # }