File: repfromto.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 (46 lines) | stat: -rw-r--r-- 972 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
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/chunkutil.R
\name{repfromto}
\alias{repfromto}
\alias{repfromto<-}
\title{Virtual recycling}
\usage{
repfromto(x, from, to)

repfromto(x, from, to) <- value
}
\arguments{
\item{x}{an object from which to recycle}

\item{from}{first position to return}

\item{to}{last position to return}

\item{value}{value to assign}
}
\value{
a vector of length \code{from - to + 1}
}
\description{
\command{repfromto} virtually recylcles object \code{x} and cuts out
positions \code{from .. to}
}
\details{
\code{repfromto} is a generalization of \code{\link{rep}}, where
\code{rep(x, n) == repfromto(x, 1, n)}.  You can see this as an R-side
(vector) solution of the \code{mod_iterate} macro in arithmetic.c
}
\examples{

  message("a simple example")
  repfromto(0:9, 11, 20)

}
\seealso{
\code{\link{rep}}, \code{\link[ff:ffapply]{ffvecapply}}
}
\author{
Jens Oehlschlägel
}
\keyword{IO}
\keyword{data}