Description Usage Arguments Details Value Author(s) Examples
View source: R/summaryLocations.R
This function is similar to apply
for the values
of Simulations
location-wise. It takes a function and returns a vector with a value for each location: the result of the function applied to all values belonging to this location. This can be useful to generate maps.
1 2 3 4 5 6 | summaryLocations(simulations,
locations = 1:nLocations(simulations),
plumes = 1:nPlumes(simulations),
kinds = 1,
fun, summaryFun = weightedMean,
weight = 1, na.rm = FALSE, ...)
|
simulations |
|
locations |
indices of |
plumes |
indices of |
kinds |
index of kind of |
fun |
|
summaryFun |
|
weight |
to be used by |
na.rm |
|
... |
further arguments to be forwarded to |
summaryLocations is similar to summaryPlumes
but is not restricted to associative functions. For a more general function see simulationsApply
.
To use a different summaryFun
you may use replaceDefault
with kind = "summaryFun.summaryPlumes"
to check the function beforehand or to generate it by resetting the default parameters of an existing function.
A list
of
summary |
the result of |
summaryLocations |
the location-wise results of |
Kristina B. Helle, kristina.helle@uni-muenster.de
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | data(radioactivePlumes)
plumeSample = c(1:5, 16:20, 30:34, 45:49)# sample of plumes: jan, apr, jul, oct
# plume detection
# (number of plumes in plumeSample that can be detected at a level of more than 1e-7)
detection1em7 = function(x, ...){
xExceed = x > 1e-7
out = sum(xExceed)
return(out)
}
plumeNr_radioactivePlumes =
summaryLocations(radioactivePlumes,
plumes = plumeSample, fun = detection1em7, kinds = 2)
## plot map
plumeNrMap = radioactivePlumes@locations
plumeNrMap@data$plumeNr = plumeNr_radioactivePlumes[["summaryLocations"]]
spplot(plumeNrMap, zcol = "plumeNr")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.