This is a method for the generic function subset.
It extracts the subset of x consisting of those segments
that satisfy the logical expression
subset, and retains only the columns of marks that are
specified by the expression select. The result is
always a line segment pattern, with the same window as x.
The argument subset determines the subset that
will be extracted. It should be a logical expression.
It may involve the variable names
x0, y0, x1, y1
representing the Cartesian coordinates of the segment endpoints;
the name marks representing the marks;
and (if there is more than one column of marks)
the names of individual columns of marks.
The default is to keep all segments.
The argument select determines which columns of marks
will be retained (if there are several columns of marks).
It should be an expression involving the names of columns of marks
(which will be interpreted as integers representing the positions of
these columns). For example if there are columns of marks named
A to Z, then select=D:F is a valid expression
and means that columns D, E and F will be
retained. Similarly select=-(A:C) is valid and means that columns
A to C will be deleted.
The default is to retain all columns.
Setting subset=FALSE will produce an empty point pattern
(i.e. containing zero points) in the same window as x.
Setting select=FALSE or select= -marks will
remove all the marks from x.
The argument drop determines whether to remove
unused levels of a factor, if the resulting point pattern is multitype
(i.e. the marks are a factor) or if the marks are a data frame
in which some of the columns are factors.
The result is always a line segment pattern.
To extract only some columns of marks as a data frame,
use subset(as.data.frame(x), ...)