as.loca.p.matrix: as.loca.p.matrix S3 method to convert from matrix to loca.p

View source: R/as.R

as.loca.p.matrixR Documentation

as.loca.p.matrix S3 method to convert from matrix to loca.p

Description

Conversions between loca.p class and some others classes

Usage

as.loca.p.matrix(x, ...)

Arguments

x

is the object to convert to the new class object.

...

Other arguments, unused.

Details

Methods to convert from and to loca.p class.

NA's values are not allowed in any of the arguments.

The matrix or data.frame to convert into loca.p must have at least two columns. The first column will be consider as the x coordinates, the second as the y coordinates, and the third (if given) as the values of weights w.

Value

It returns a new object of the new class.

See Also

See also loca.p

Examples

# A new unweighted loca.p object
loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))

# Conversion to matrix
m <- as.matrix(loca)

# Show matrix
m

# Conversion from matrix
as.loca.p(m)

orloca documentation built on Feb. 1, 2024, 3 p.m.