replaceVarsInExpression | R Documentation |
Replaces the variables in expressions by something else and returns the expression.
replaceVarsInExpression(EXPR,vars,warn=FALSE)
EXPR |
a call object representning an R expression |
vars |
a names list providing the replacements for the variables. The names represent the variable names to be replaced. |
warn |
If TRUE warns in case of undefined variables. NA produces an error. |
An expression similar to EXPR, with the variables replaced.
K. Gerald van den Boogaart
a <- quote( A==B^C+A^2+C )
replaceVarsInExpression(a,list(A=quote(2*r^2),C=as.name("R"),B=pi))
a <- quote( A+B+C )
replaceVarsInExpression(a,list(A=quote(C^2),B=quote(A^2),C=quote(B^2)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.