Learn R Programming

Momocs (version 1.0.0)

breed: Jitters Coe (and others) objects

Description

This methods applies column-wise on the coe of any Coe object but relies on a function that can be used on any matrix. It simply uses rnorm with the mean and sd calculated for every column (or row). For a Coe object, on every colum, randomly generates coefficients values centered on the mean of the column, and with a sd equals to it standard deviates multiplied by rate.

Usage

breed(x, ...)
"breed"(x, margin = 2, size, rate = 1, ...)
"breed"(x, size, rate = 1, ...)

Arguments

x
the object to permute
...
useless here
margin
numeric whether 1 or 2 (rows or columns)
size
numeric the required size for the final object, same size by default
rate
numeric the number of sd for rnorm, 1 by default.

See Also

Other farming: perm

Examples

Run this code
m <- matrix(1:12, nrow=3)
breed(m, margin=2, size=4)
breed(m, margin=1, size=10)

data(bot)
bot.f <- efourier(bot, 12)
bot.m <- breed(bot.f, 80)
bot.m
panel(bot.m)

Run the code above in your browser using DataLab