View source: R/aggregateDensityData.R
aggregateDensityData | R Documentation |
subsets data based on defined columns, and takes median over
layers, but enter NA
for layers to
keep the column names the same.
Currently, the function works for a vector of defined species and polygons.
aggregateDensityData(
dat,
time,
species,
boxes,
keepColumns = c("species", "agecl", "polygon", "time")
)
dat |
A |
time |
A single value or a |
species |
A |
boxes |
A |
keepColumns |
A |
The function returns a subsetted matrix with the same columns as the input data, i.e.,:
species
agecl
polygon
layer
time
atoutput
Sarah Gaichas, Allan Hicks
dat <- data.frame(species = c(rep("spec1", 3*3),rep("spec2", 5*3)),
agecl = c(rep(1:3, 3), rep(3:7, 3)),
polygon = c(rep(1:3, each = 3), rep(1:3, each = 5)),
layer = 1, time = 1)
dat$atoutput <- 10000/dat$agecl
tmp <- aggregateData(dat = dat, time = 1,
species = c("spec1", "spec2"), boxes = 1:2)
rm(list = c("tmp", "dat"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.