as.s2pp: Convert data to class s2pp

View source: R/s2pp.R

as.s2ppR Documentation

Convert data to class s2pp

Description

Tries to coerce any reasonable kind of data to a spherical point pattern (an object of class "s2pp") for use by the spatstat.sphere package).

Usage

as.s2pp(X, ...)

## S3 method for class 's2pp'
as.s2pp(X, ...)

## S3 method for class 'data.frame'
as.s2pp(X, ..., region = NULL)

## S3 method for class 'matrix'
as.s2pp(X, ..., region = NULL)

## Default S3 method:
as.s2pp(X, ..., region = NULL)

Arguments

X

Data which will be converted into a point pattern

...

Arguments passed on to s2

radius

Numeric. Defaults to 1. For convenience this can also be an object of class "s2region" from where the radius and unitname then will be extracted.

unitname

Optional. Name of unit of length. Either a single character string, or a vector of two character strings giving the singular and plural forms, respectively.

region

Region on the sphere where the points occur. Object of class "s2region".

Details

Converts the dataset X to a point pattern (an object of class "s2pp").

The function as.s2pp is generic, with methods for the classes "s2pp", "matrix", "data.frame" and a default method.

Point pattern datasets can also be created by the function s2pp.

Value

An object of class "s2pp" (see s2pp) describing the spherical point pattern and its region.

Methods (by class)

  • as.s2pp(s2pp): Method for s2pp objects.

  • as.s2pp(data.frame): Method for data frames.

  • as.s2pp(matrix): Method for matrices.

  • as.s2pp(default): Default method.


spatstat/spatstat.sphere documentation built on Jan. 27, 2023, 2:59 a.m.