Learn R Programming

Momocs (version 1.4.1)

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, ...)

# S3 method for default breed(x, fac, margin = 2, size, rate = 1, ...)

# S3 method for Coe breed(x, fac, size, rate = 1, ...)

Value

a Coe object of same class

Arguments

x

the object to permute

...

useless here

fac

a column, a formula or a column id from $fac

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)

bot.f <- efourier(bot, 12)
bot.m <- breed(bot.f, size=80)
bot.m %>% PCA %>% plot

# breed fac wise
# bot.f %>%  breed(~type, size=50) %>% PCA %>% plot(~type)

Run the code above in your browser using DataLab