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

view-summarization-methods

Summarize views on an XInteger or XDouble object


Description

The viewMins, viewMaxs, viewSums, and viewMeans methods described here calculate respectively the minima, maxima, sums, and means of the views in an XIntegerViews or XDoubleViews object.

Usage

## "viewMins" methods:
## -------------------

## S4 method for signature 'XIntegerViews'
viewMins(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewMins(x, na.rm=FALSE)


## "viewMaxs" methods:
## -------------------

## S4 method for signature 'XIntegerViews'
viewMaxs(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewMaxs(x, na.rm=FALSE)


## "viewSums" methods:
## -------------------

## S4 method for signature 'XIntegerViews'
viewSums(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewSums(x, na.rm=FALSE)


## "viewMeans" methods:
## --------------------

## S4 method for signature 'XIntegerViews'
viewMeans(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewMeans(x, na.rm=FALSE)


## "viewWhichMins" methods:
## ------------------------

## S4 method for signature 'XIntegerViews'
viewWhichMins(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewWhichMins(x, na.rm=FALSE)


## "viewWhichMaxs" methods:
## ------------------------

## S4 method for signature 'XIntegerViews'
viewWhichMaxs(x, na.rm=FALSE)

## S4 method for signature 'XDoubleViews'
viewWhichMaxs(x, na.rm=FALSE)

Arguments

x

An XIntegerViews or XDoubleViews object.

na.rm

Logical indicating whether or not to include missing values in the results.

Value

A numeric vector of the length of x.

Note

For convenience, methods for min, max, sum, mean, which.min and which.max are provided as wrappers around the corresponding view* functions (which might be deprecated at some point).

Author(s)

P. Aboyoun

See Also

Examples

set.seed(0)
vec <- sample(24)
vec_views <- slice(vec, lower=4, upper=16)
vec_views

viewApply(vec_views, function(x) diff(as.integer(x)))

viewMins(vec_views)
viewMaxs(vec_views)

viewSums(vec_views)
viewMeans(vec_views)

viewWhichMins(vec_views)
viewWhichMaxs(vec_views)

XVector

Foundation of external vector representation and manipulation in Bioconductor

v0.30.0
Artistic-2.0
Authors
Hervé Pagès and Patrick Aboyoun
Initial release

We don't support your browser anymore

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