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

distill

Distill An Object


Description

Distill a complex object to something easier to manage, like a numeric vector.

Usage

distill(x, ...)

## S3 method for class 'list'
distill(x, ...)

## S3 method for class 'matrix'
distill(x, ...)

## S3 method for class 'data.frame'
distill(x, ...)

Arguments

x

A list, vector, matrix or data frame, or other object that has a distill method, e.g., fevd objects.

...

Not used.

Details

Perhaps a fine line exists between functions such as c, print, str, summary, etc. The idea behind the distill method is to have a function that “distills” out the most pertinent information from a more complex object. For example, when fitting a model to a number of spatial locations, it can be useful to pull out only certain information into a vector for ease of analysis. With many models, it might not be feasible to store (or analyze) large complicated data objects. In such a case, it may be useful to keep only a vector with the most pertinent information (e.g., parameter estimates, their standard errors, the likelihood value, AIC, BIC, etc.). For example, this is used within extRemes >= 2.0 on the “fevd” class objects with the aim at fitting models to numerous locations within an apply call so that something easily handled is returned, but with enough information as to be useful.

The data frame and matrix methods attempt to name each component of the vector. The list method simply does c(unlist(x)).

Value

numeric vector, possibly named.

Author(s)

Eric Gilleland

See Also

Examples

x <- cbind(1:3, 4:6, 7:9)
distill(x)

x <- data.frame(x=1:3, y=4:6, z=7:9)
distill(x)

distillery

Method Functions for Confidence Intervals and to Distill Information from an Object

v1.2
GPL (>= 2)
Authors
Eric Gilleland
Initial release
2020-11-20

We don't support your browser anymore

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