Learn R Programming

vectools (version 0.3.0)

31_replication_functions: Replication Functions

Description

rep methods, and rep2 methods, functions similar to rep_len.

Usage

# S3 method for ObjectArray
rep(x, n=1, …, each=1, times=n)
# S3 method for ImageArray
rep(x, n=1, …, each=1, times=n)
# S3 method for GeomArray
rep(x, n=1, …, each=1, times=n)
# S3 method for MatrixArray
rep(x, n=1, …, each=1, times=n)

# S3 method for ObjectArray rep2(v, n, …, n.out=n) # S3 method for GeomArray rep2(v, n, …, n.out=n) # S3 method for ImageArray rep2(v, n, …, n.out=n) # S3 method for MatrixArray rep2(v, n, …, n.out=n)

Arguments

x, v

A one-dimensional ObjectArray (incl subclasses).

n

Default value for n.out and times, see below.

each

Integer, the number of times, each element is repeated, consecutively.

times

Integer, the number of times, the sequence is repeated, periodically.

n.out

Integer, the length of the output object.

Ignored.

Value

A new one-dimensional ImageArray, ObjectArray, GeomArray or MatrixArray object.

Examples

Run this code
# NOT RUN {
rep (eq.brot2 (4), 10)
# }

Run the code above in your browser using DataLab