File: view-summarization-methods.Rd

package info (click to toggle)
r-bioc-xvector 0.46.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 572 kB
  • sloc: ansic: 4,970; makefile: 2
file content (130 lines) | stat: -rw-r--r-- 2,974 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
\name{view-summarization-methods}

\alias{view-summarization-methods}

\alias{viewMins,XIntegerViews-method}
\alias{viewMins,XDoubleViews-method}
\alias{viewMaxs,XIntegerViews-method}
\alias{viewMaxs,XDoubleViews-method}
\alias{viewSums,XIntegerViews-method}
\alias{viewSums,XDoubleViews-method}
\alias{viewMeans,XIntegerViews-method}
\alias{viewMeans,XDoubleViews-method}
\alias{viewWhichMins,XIntegerViews-method}
\alias{viewWhichMins,XDoubleViews-method}
\alias{viewWhichMaxs,XIntegerViews-method}
\alias{viewWhichMaxs,XDoubleViews-method}


\title{Summarize views on an XInteger or XDouble object}

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

\usage{
## "viewMins" methods:
## -------------------

\S4method{viewMins}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewMins}{XDoubleViews}(x, na.rm=FALSE)


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

\S4method{viewMaxs}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewMaxs}{XDoubleViews}(x, na.rm=FALSE)


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

\S4method{viewSums}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewSums}{XDoubleViews}(x, na.rm=FALSE)


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

\S4method{viewMeans}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewMeans}{XDoubleViews}(x, na.rm=FALSE)


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

\S4method{viewWhichMins}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewWhichMins}{XDoubleViews}(x, na.rm=FALSE)


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

\S4method{viewWhichMaxs}{XIntegerViews}(x, na.rm=FALSE)

\S4method{viewWhichMaxs}{XDoubleViews}(x, na.rm=FALSE)
}

\arguments{
  \item{x}{
    An \link{XIntegerViews} or \link{XDoubleViews} object.
  }
  \item{na.rm}{
    Logical indicating whether or not to include missing values in the results.
  }
}

\value{
  A numeric vector of the length of \code{x}.
}

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

\author{P. Aboyoun}

\seealso{
  \itemize{
    \item \link{slice-methods} for slicing an \link{XInteger} or
          \link{XDouble} object.

    \item \link[IRanges]{view-summarization-methods} in the IRanges package
          for the view summarization generics.

    \item The \link{XIntegerViews} and \link{XDoubleViews} classes.
  }
}

\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)
}

\keyword{methods}
\keyword{arith}