prevR-class | R Documentation |
Class used by the package prevR
clusters
data.frame
with observed data (one line per cluster).
Columns names are:
"id" cluster ID.
"x" longitude.
"y" latitude.
"n" number of valid observations per cluster.
"pos" number of positive cases per cluster.
"prev" observed prevalence (in %) in the cluster (pos/n).
"wn" (optional) sum of weights of observations per cluster.
"wpos" (optional) sum of weights of positive cases per cluster.
"wprev" (optional) weighted observed prevalence (in %) in the cluster (wpos/wn).
"c.type" (optional) cluster type.
boundary
object of class sf::sf, borders of the studied area.
proj
object of class sf::crs, map projection used.
rings
list of results returned by rings()
.
Each entry is composed of 3 elements: N
, minimum number of
observations per ring; R
, maximum radius of rings and
estimates
, a data frame with the following
variables:
"id" cluster ID.
"r.pos" number of positive cases inside the ring.
"r.n" number of valid observations inside the ring.
"r.prev" observed prevalence (in \
"r.radius" ring radius (in kilometers if coordinates in decimal degrees, in the unit of the projection otherwise).
"r.clusters" number of clusters located inside the ring.
"r.wpos" (optional) sum of weights of positive cases inside the ring.
"r.wn" (optional) sum of weights of valid observations inside the ring.
"r.wprev" (optional) weighted observed prevalence (in %) inside the ring (r.wpos/r.wn).
Note: the list rings
is named, the name of each element is
NN_value.RR_value, for example N300.RInf.
Objects of this class could be created by the function as.prevR()
.
signature(x = "prevR")
converts an object of
class prevR into a data frame.
signature(object = "prevR")
generates a
spatial grid.
signature(object = "prevR")
exports a prevR object as
a shapefile, a dbase file or a text file.
signature(formula = "ANY", locations = "prevR")
calculates a spatial interpolation using an inverse distance weighting.
signature(object = "prevR")
estimates a prevalence
surface using kernel density estimators.
signature(formula = "ANY", locations = "prevR")
calculates a spatial interpolation by kriging.
signature(x = "prevR", y = "ANY")
plots data of a
prevR object.
signature(x = "prevR")
shows a summary of a prevR
object.
signature(object = "prevR")
calculates rings of equal
number of observations and/or equal radius.
signature(object = "prevR")
shows a summary of a prevR
object.
signature(object = "prevR")
shows a summary of the
variables of a prevR object.
signature(object = "prevR")
changes the map
projection used.
as.prevR()
, is.prevR()
, changeproj()
, rings()
, print()
, plot()
,
summary()
, kde()
, krige()
, idw()
, export()
.
showClass("prevR")
col <- c(
id = "cluster",
x = "x",
y = "y",
n = "n",
pos = "pos",
c.type = "residence",
wn = "weighted.n",
wpos = "weighted.pos"
)
dhs <- as.prevR(fdhs.clusters, col, fdhs.boundary)
str(dhs)
print(dhs)
## Not run:
dhs <- rings(fdhs, N = c(100, 300, 500))
str(dhs)
print(dhs)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.