Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

eval.fasp

Evaluate Expression Involving Function Arrays


Description

Evaluates any expression involving one or more function arrays (fasp objects) and returns another function array.

Usage

eval.fasp(expr, envir, dotonly=TRUE)

Arguments

expr

An expression involving the names of objects of class "fasp".

envir

Optional. The environment in which to evaluate the expression, or a named list containing "fasp" objects to be used in the expression.

dotonly

Logical. Passed to eval.fv.

Details

This is a wrapper to make it easier to perform pointwise calculations with the arrays of summary functions used in spatial statistics.

A function array (object of class "fasp") can be regarded as a matrix whose entries are functions. Objects of this kind are returned by the command alltypes.

Suppose X is an object of class "fasp". Then eval.fasp(X+3) effectively adds 3 to the value of every function in the array X, and returns the resulting object.

Suppose X and Y are two objects of class "fasp" which are compatible (for example the arrays must have the same dimensions). Then eval.fasp(X + Y) will add the corresponding functions in each cell of the arrays X and Y, and return the resulting array of functions.

Suppose X is an object of class "fasp" and f is an object of class "fv". Then eval.fasp(X + f) will add the function f to the functions in each cell of the array X, and return the resulting array of functions.

In general, expr can be any expression involving (a) the names of objects of class "fasp" or "fv", (b) scalar constants, and (c) functions which are vectorised. See the Examples.

First eval.fasp determines which of the variable names in the expression expr refer to objects of class "fasp". The expression is then evaluated for each cell of the array using eval.fv.

The expression expr must be vectorised. There must be at least one object of class "fasp" in the expression. All such objects must be compatible.

Value

Another object of class "fasp".

Author(s)

and Rolf Turner r.turner@auckland.ac.nz

See Also

Examples

K <- alltypes(amacrine, "K")

  # expressions involving a fasp object
  eval.fasp(K + 3)
  L <- eval.fasp(sqrt(K/pi))

  # expression involving two fasp objects
  D <- eval.fasp(K - L)

  # subtracting the unmarked K function from the cross-type K functions
  K0 <- Kest(unmark(amacrine))
  DK <- eval.fasp(K - K0)

  ## Use of 'envir'
  S <- eval.fasp(1-G, list(G=alltypes(amacrine, 'G')))

spatstat.core

Core Functionality of the 'spatstat' Family

v2.1-2
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Kasper Klitgaard Berthelsen [ctb], Achmad Choiruddin [ctb], Jean-Francois Coeurjolly [ctb], Ottmar Cronie [ctb], Tilman Davies [ctb], Julian Gilbey [ctb], Yongtao Guan [ctb], Ute Hahn [ctb], Kassel Hingee [ctb], Abdollah Jalilian [ctb], Marie-Colette van Lieshout [ctb], Greg McSwiggan [ctb], Tuomas Rajala [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Plenge Waagepetersen [ctb], Hangsheng Wang [ctb]
Initial release
2021-04-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.