Replaces the left-hand side of "lhs <- rhs" by the
right-hand side in trafo, after the symbols of expr are replaced by the
arguments in .... define() and insert() build on it.
Arguments
- trafo
Named character, eqnvec or a list of those. Default
NULLstarts from the identity of the left-hand sides, so the result maps each left-hand side to the matching right-hand side.- expr
"lhs <- rhs"string. Inside a name,_separates symbols, so"Delta_x"withx = "a"becomes"Delta_a". A"lhs ~ rhs"string or a formula is an error:~is reserved for model formulas.- ...
Named character or numeric vectors of equal length, replacing the symbols of
exprof the same name; elementiof each gives thei-th substitution.- reset
FALSE(default) replaces the left-hand side wherever it occurs in the expressions,TRUEsets the entry it names.
Examples
innerpars <- letters[1:3]
constraints <- c(a = "b + c")
mycondition <- "cond1"
trafo <- repar(NULL, "x <- x", x = innerpars)
trafo <- repar(trafo, "x <- y", x = names(constraints), y = constraints)
trafo <- repar(trafo, "x <- exp(x)", x = innerpars)
trafo <- repar(trafo, "x <- x + Delta_x_condition",
x = innerpars, condition = mycondition)