rep.data.frame: Replicate the rows of a data.frame by repeating each row...

View source: R/misc.r

rep.data.frameR Documentation

Replicate the rows of a data.frame by repeating each row consecutively and/or repeating all rows as a group

Description

Replicate the rows of a data.frame by repeating each row consecutively and/or repeating all rows as a group.

Usage

## S3 method for class 'data.frame'
rep(x, times=1, each=1, ...)

Arguments

x

A data.frame whose rows are to be repeated.

times

The number of times to repeat the whole set of rows, after the rows have been replicated consecutively each times.

each

The number of times to replicate consecutively each row in the data.frame.

...

Further arguments passed to or from other methods. Unused at present.

Value

A data.frame with replicated rows.

Author(s)

Chris Brien

See Also

fac.gen in package dae and rep

Examples

rep(fac.gen(list(a = 2, b = 2)), times=2, each=2)

dae documentation built on June 22, 2024, 9:07 a.m.