| as.prevR | R Documentation |
This function creates an object of class prevR from a data frame.
as.prevR(data, col, boundary = NULL, proj = "+proj=longlat +datum=WGS84")
data |
data frame, each line corresponding to an observed cluster. |
col |
vector identifying the columns of
See examples. |
boundary |
object of class sf::sf defining the studied area. |
proj |
projection of clusters coordinates used in |
Only "x", "y" "n" and "pos" are required in col.
If "id" is not specified, a numerical identifier will be automatically
created.
If boundary is not defined (NULL), a rectangle corresponding to minimal
and maximal coordinates of data will be used.
boundary could be the result of the function create.boundary().
It's not possible to change projection of data with as.prevR().
Use changeproj() instead.
Object of class prevR
prevR class, create.boundary(),
changeproj(), import.dhs().
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.