relist: Generate a list of a given structure with new values

View source: R/extrafunctions.R

relistR Documentation

Generate a list of a given structure with new values

Description

Generate a list of a given structure with new values

Usage

relist(lst, value, p = 0)

Arguments

lst

List whose structure will be replicated with the new values

value

vector of values to replace in 'lst'. The order of replacement is given by 'unlist(lst)'

p

Used internally to track level of recursion

Value

A list of the same structure as 'lst' but with the values given by 'value'

Examples

df <- nelder(~(cl(5)*t(5)) > ind(5))
cov <- Covariance$new(formula = ~(1|gr(j)*pexp(t)),
                      parameters = list(list(0.05,0.8)),
                      data= df)
cov$parameters <- relist(cov$parameters,
                         c(0.01,0.5))

samuel-watson/glmmr documentation built on July 27, 2022, 10:30 p.m.