Learn R Programming

spatstat.explore (version 3.8-0)

Extract.fv: Extract or Replace Subset of Function Values

Description

Extract or replace a subset of an object of class "fv".

Usage

# S3 method for fv
[(x, i, j, ..., drop=FALSE)

# S3 method for fv [(x, i, j) <- value

# S3 method for fv $(x, name) <- value

Arguments

Value

The result of [.fv with drop=TRUE

is a data frame or vector.

Otherwise, the result is another object of class "fv".

Details

These functions extract a designated subset of an object of class "fv", or replace the designated subset with other data, or delete the designated subset.

The subset is specified by the row index i and column index j, or by the column name name. Either i or j may be missing, or both may be missing.

The function [.fv is a method for the generic operator [ for the class "fv". It extracts the designated subset of x, and returns it as another object of class "fv" (if drop=FALSE) or as a data frame or vector (if drop=TRUE).

The function [<-.fv is a method for the generic operator [<- for the class "fv". If value is NULL, the designated subset of x will be deleted from x. Otherwise, the designated subset of x will be replaced by the data contained in value. The return value is the modified object x.

The function $<-.fv is a method for the generic operator $<- for the class "fv". If value is NULL, the designated column of x will be deleted from x. Otherwise, the designated column of x will be replaced by the data contained in value. The return value is the modified object x.

See Also

fv.object

Examples

Run this code
 K <- Kest(cells)

 # discard the estimates of K(r) for r  > 0.1
 Ksub <- K[K$r <= 0.1, ]

 # extract the border method estimates
 bor <- K[ , "border", drop=TRUE]
 # or equivalently
 bor <- K$border

 # remove the border-method estimates
 K$border <- NULL
 K

Run the code above in your browser using DataLab