Learn R Programming

dbmss (version 2.3-0)

wmppp: Create a Weighted, Marked, Planar Point Pattern

Description

Creates an object of class "wmppp" representing a two-dimensional point pattern with weights and labels.

Usage

wmppp(df, window = NULL, unitname = NULL)

Arguments

df
A dataframe with at least two columns containing point coordinates.
window
An object of calls "owin" (owin.object).
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 window is not NULL.

Value

An object of class "wmppp".

Details

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 the window is not specified, a rectangle containing all points is used, and unitname is used.

See Also

wmppp.object,

Examples

Run this code
# 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)

Run the code above in your browser using DataLab