wmppp | R Documentation |
Creates an object of class "wmppp"
representing a two-dimensional point pattern with weights and labels.
wmppp(df, window = NULL, unitname = NULL)
df |
A dataframe with at least two columns containing point coordinates. |
window |
An object of calls "owin" ( |
unitname |
Name of unit of length. Either a single character string, or a vector of two character strings giving the singular and plural forms, respectively. Ignored if |
Columns named "X", "Y", "PointType", "PointWeight" (capitalization is ignored) are searched to build the "wmppp"
object and set the point coordinates, type and weight. If they are not found, columns are used in this order. If columns are missing, PointType
is set to "All" and PointWeight
to 1.
If a "PointName" column is found, it is used to set the row names of the marks, else the original row names are used.
If the window is not specified, a rectangle containing all points is used, and unitname
is used.
An object of class "wmppp"
.
wmppp.object
,
# Draw the coordinates of 10 points
X <- runif(10)
Y <- runif(10)
# Draw the point types.
PointType <- sample(c("A", "B"), 10, replace=TRUE)
# Plot the point pattern. Weights are set to 1 ant the window is adjusted.
plot(wmppp(data.frame(X, Y, PointType)), , which.marks=2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.