quake: Generate new datasets with new values

View source: R/quake.R

quakeR Documentation

Generate new datasets with new values

Description

This is a wrapper around shakers that allows to run it k times and adds and index to the resulting tibble. As the typical entry point in permutationnal analysis it also checks your data to avoid further problems.

Usage

quake(x, k = 1, shaker = shake_uniform, ...)

Arguments

x

tibble()

k

number of new datasets to create

shaker

one of the shaker functions (shake_uniform() by default)

...

arguments expected by the selected shaker function. They must be provided and named. See examples

Value

a 'shaken' tibble() with new columns and iteration index

Examples

set.seed(2329) # replicability
# shaking uniform
df_u
df_u %>% quake(k=5, shake_uniform, min=tpq, max=taq)
# not that you can omit shakers' argument names, providing they come in the right order
# eg:  df_u %>% quake(k=5, shake_uniform, tpq, taq)

# shaking gaussian
df_g
df_g %>% quake(k=5, shake_gaussian, mean=c14, sd=sd1)

# on a more realistic dataset bigger baby:
# animals %>% quake(k=2, shake_uniform, tpq, taq)

vbonhomme/pataqu documentation built on April 24, 2022, 10:03 p.m.