File: rlepack.Rd

package info (click to toggle)
r-cran-bit 4.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 996 kB
  • sloc: ansic: 5,083; makefile: 6
file content (67 lines) | stat: -rw-r--r-- 1,781 bytes parent folder | download | duplicates (2)
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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/rle.R
\name{rlepack}
\alias{rlepack}
\alias{rlepack.integer}
\alias{rleunpack}
\alias{rleunpack.rlepack}
\alias{rev.rlepack}
\alias{unique.rlepack}
\alias{anyDuplicated.rlepack}
\title{Hybrid Index, rle-pack utilities}
\usage{
rlepack(x, ...)

\method{rlepack}{integer}(x, pack = TRUE, ...)

rleunpack(x)

\method{rleunpack}{rlepack}(x)

\method{rev}{rlepack}(x)

\method{unique}{rlepack}(x, incomparables = FALSE, ...)

\method{anyDuplicated}{rlepack}(x, incomparables = FALSE, ...)
}
\arguments{
\item{x}{in 'rlepack' an integer vector, in the other functions an object of
class 'rlepack'}

\item{\dots}{just to keep R CMD CHECK quiet (not used)}

\item{pack}{FALSE to suppress packing}

\item{incomparables}{just to keep R CMD CHECK quiet (not used)}
}
\value{
A list with components \item{ first }{ the first element of the
packed sequence } \item{ dat }{ either an object of class \code{\link{rle}}
or the complete input vector \code{x} if rle-packing is not efficient }
\item{ last }{ the last element of the packed sequence }
}
\description{
Basic utilities for rle packing and unpacking and apropriate methods for
\code{\link{rev}} and \code{\link{unique}}.
}
\examples{

  x <- rlepack(rep(0L, 10))
\dontshow{
 for (x in list(10:1, 1:10, c(10:1,1:10), c(1:10,10:1), sample(100), sample(100, 100, TRUE), sample(10, 100, TRUE))){
   stopifnot(identical(rleunpack(rlepack(x)), x))
   stopifnot(identical(rleunpack(unique(rlepack(x))), unique(x)))
   stopifnot(identical(anyDuplicated(rlepack(x)), anyDuplicated(x)))
 }
}

}
\seealso{
\code{\link[ff]{hi}}, \code{\link{intrle}}, \code{\link{rle}},
\code{\link{rev}}, \code{\link{unique}}
}
\author{
Jens Oehlschlägel
}
\keyword{IO}
\keyword{data}