Learn R Programming

XVector (version 0.12.0)

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: ## -------------------
"viewMins"(x, na.rm=FALSE)
"viewMins"(x, na.rm=FALSE)
## "viewMaxs" methods: ## -------------------
"viewMaxs"(x, na.rm=FALSE)
"viewMaxs"(x, na.rm=FALSE)
## "viewSums" methods: ## -------------------
"viewSums"(x, na.rm=FALSE)
"viewSums"(x, na.rm=FALSE)
## "viewMeans" methods: ## --------------------
"viewMeans"(x, na.rm=FALSE)
"viewMeans"(x, na.rm=FALSE)
## "viewWhichMins" methods: ## ------------------------
"viewWhichMins"(x, na.rm=FALSE)
"viewWhichMins"(x, na.rm=FALSE)
## "viewWhichMaxs" methods: ## ------------------------
"viewWhichMaxs"(x, na.rm=FALSE)
"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.

See Also

Examples

Run this code
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)

Run the code above in your browser using DataLab