.BG
.VE $Header: /usr3/s/current/s/.help/RCS/rep,v 1.3 84/06/22 16:42:23 rab Exp $
.FN rep
.TL
rep: Replicate Data Values
.CS
rep(x, times, length)
.PP
.AG x
vector structure.
Missing values (NAs) are allowed.
.AG times
how many times to replicate `x'. There are two ways to use
`times'.  If it is a single value, the whole of `x' is
replicated that many times.  If it is a vector of the same
length as `x', the result is a vector with `times[1]'
replications of `x[1]', `times[2]' of `x[2]', etc.
.AG length
the desired length of the result.  This argument may be
given instead of `times', in which case `x' is replicated as
much as needed to produce a result with `length' data
values.
.RT
a vector of the same mode as `x' with the data values in `x'
replicated according to the argument `times' or `length'.
.EX
rep(0,100)    # 100 zeroes
rep(1:10,10)    # 10 repetitions of 1:10
rep(1:10,1:10) # 1, 2, 2, 3, 3, 3, ...
.KW basic*
.KW manip
.WR
