Skip to contents

This method allows for updating an existing complr object.

Usage

# S3 method for class 'complr'
update(object, newdata, ...)

Arguments

object

A complr class object to be updated.

newdata

A data.frame or data.table containing data of all variables used in the analysis. It must include a composition and the same ID variable as the existing complr object.

...

generic argument, not in use.

Value

A complr object with at least the following elements.

comp

A vector of class acomp representing one closed composition or a matrix of class acomp representing multiple closed compositions each in one row.

between_comp

A vector of class acomp representing one closed between-person composition or a matrix of class acomp representing multiple closed between-person compositions each in one row.

within_comp

A vector of class acomp representing one closed within-person composition or a matrix of class acomp representing multiple closed within-person compositions each in one row.

logratio

Log ratio transform of composition.

between_logratio

Log ratio transform of between-person composition.

within_logratio

Log ratio transform of within-person composition.

data

The user's dataset or imputed dataset if the input data contains zeros.

transform

Type of transform applied on compositional data.

parts

Names of compositional variables.

idvar

Name of the variable containing IDs.

total

Total amount to which the compositions is closed.

See also

Examples

cilr <- complr(data = mcompd, sbp = sbp, 
               parts = c("TST", "WAKE", "MVPA", "LPA", "SB"), idvar = "ID")

# update with new data
newdat <- mcompd[ID != 1] # excluding ID 1
cilr1 <- update(object = cilr, newdata = newdat)