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

solapply

Apply a Function Over a List and Obtain a List of Objects


Description

Applies the function FUN to each element of the list X, and returns the result as a list of class "solist" or "anylist" as appropriate.

Usage

anylapply(X, FUN, ...)

  solapply(X, FUN, ..., check = TRUE, promote = TRUE, demote = FALSE)

Arguments

X

A list.

FUN

Function to be applied to each element of X.

...

Additional arguments to FUN.

check,promote,demote

Arguments passed to solist which determine how to handle different classes of objects.

Details

These convenience functions are similar to lapply except that they return a list of class "solist" or "anylist".

In both functions, the result is computed by lapply(X, FUN, ...).

In anylapply the result is converted to a list of class "anylist" and returned.

In solapply the result is converted to a list of class "solist" if possible, using as.solist. If this is not possible, then the behaviour depends on the argument demote. If demote=TRUE the result will be returned as a list of class "anylist". If demote=FALSE (the default), an error occurs.

Value

A list, usually of class "solist".

Author(s)

Adrian Baddeley Adrian.Baddeley@curtin.edu.au, Rolf Turner r.turner@auckland.ac.nz and Ege Rubak rubak@math.aau.dk.

See Also

Examples

solapply(waterstriders, distmap)

spatstat.geom

Geometrical Functionality of the 'spatstat' Family

v2.1-0
GPL (>= 2)
Authors
Adrian Baddeley [aut, cre], Rolf Turner [aut], Ege Rubak [aut], Tilman Davies [ctb], Ute Hahn [ctb], Abdollah Jalilian [ctb], Sebastian Meyer [ctb], Suman Rakshit [ctb], Dominic Schuhmacher [ctb], Rasmus Waagepetersen [ctb]
Initial release
2021-04-15

We don't support your browser anymore

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