d_centering: Within-individual centering function

Description Usage Arguments Value

View source: R/d_centering.R

Description

Partition of variation within- and among-individuals following the method summarised by Van de Pol & Wright (2009) (doi: 10.1016/j.anbehav.2008.11.006)

Usage

1
d_centering(data, centering_by, cluster = NULL, variable)

Arguments

data

data frame

centering_by

individual ID

cluster

higher level structure. E.g. levels in centering_by further structured in cluster. NULL as default

variable

character name or vector of characters. Variables to be partitioned.If more than one,please, concatenate using 'c'.

Value

New variables added to the end of the original data frame with 'mean_' prefix for the mean value of variable for every centering_by level and prefix 'cent' for the within-indivual term.


PabloCapilla/WeaverTools documentation built on Nov. 22, 2019, 5 a.m.