Learn R Programming

matricks (version 0.8.2)

repetitions: Repeat columns or rows

Description

Repeat matrix object respectively to its shape and orientation

Usage

crep(x, times)

rrep(x, times)

Arguments

x

matrix

times

number of repetitions

Value

matrix

Details

crep = columnwise repetition

rrep = rowwise repetition

Examples

Run this code
# NOT RUN {
# Columnwise repetition
crep(v(1:3), 4)
crep(t(v(1:5)), 4)
# Rowwise repetition
rrep(v(1:3), 4)
rrep(t(v(1:5)), 4)
# }

Run the code above in your browser using DataLab