Learn R Programming

photobiology (version 0.11.4)

summary.generic_spct: Summary of one or more spectra

Description

Methods of generic function summary for objects of spectral classes and of classes for collections of spectra.

Usage

# S3 method for generic_spct
summary(
  object,
  maxsum = 7,
  digits = max(3, getOption("digits") - 3),
  ...,
  expand = "none"
)

# S3 method for generic_mspct summary( object, maxsum = 7, digits = max(3, getOption("digits") - 3), idx = "spct.idx", which.metadata = NULL, expand = "none", ... )

Value

A summary object matching the class of object, or a list of such objects or a summary object for a matching collection of spectra. Metadata stored in attributes are copied to identical attributes in the returned summary objects except when object is a collection of spectra or if expand = "collection" is passed in the call. In this two cases, a condensed summary is returned as a data frame and attributes from each member can be copied to variables in it.

Arguments

object

An object of one of the spectral classes for which a summary is desired.

maxsum

integer Indicates how many levels should be shown for factors.

digits

integer Used for number formatting with format().

...

additional arguments affecting the summary produced, ignored in current version.

expand

character One of "none", "collection", "each" or "auto" indicating if multiple spectra in long form should be summarized as a collection or individually.

idx

character Name of the column with the names of the members of the collection of spectra.

which.metadata

character vector Names of attributes to retrieve, or "none" or "all". Obeyed if expand = FALSE, its default.

Functions

  • summary(generic_mspct):

Details

Objects are summarized as is, ignoring the current settings of R options photobiology.radiation.unit and photobiology.filter.qty. Unlike R's summary, these methods can optionally summarize each spectrum stored in long form returning a list of summaries. Although this is frequently the most informative approach, the default remains similar to summary() method from R: to summarize object as a whole. Alternatively, multiple spectra stored in long form, can optionally be summarized also as a collection of spectra. Passing "auto" in the call, is equivalent to passing "each" or "collection" depending on the number of spectra contained in the object.

See Also

print.summary_generic_spct

Examples

Run this code
summary(sun.spct)
class(summary(sun.spct))

summary(two_filters.spct)
class(summary(two_filters.spct))

summary(sun_evening.spct)
summary(two_filters.spct, expand = "none")
summary(two_filters.spct, expand = "each")
summary(two_filters.spct, expand = "collection")
summary(two_filters.spct, expand = "auto") # <= 4 spectra
summary(sun_evening.spct, expand = "auto") # > 4 spectra

where_measured(sun.spct)
where_measured(summary(sun.spct))
what_measured(summary(two_filters.spct))
what_measured(summary(two_filters.spct, expand = "each")[[1]])

summary(sun_evening.mspct)
summary(sun_evening.mspct, which.metadata = "when.measured")
summary(two_filters.mspct, which.metadata = "what.measured")
summary(two_filters.mspct, expand = "each")

Run the code above in your browser using DataLab