modifyVector | R Documentation |
Modifies a vector by changing a subset of elements to match a second vector.
modifyVector(x, val, add = TRUE)
x |
A named vector. |
val |
A named vector with components to replace corresponding components in x. |
add |
If FALSE, only existing elements of x are returned. |
modifyVector modifies elements of a vector
A modified version of x, with the elements of val replacing the elements of x
Marc Girondot
library("HelpersMG")
e <- c(M=10, L=20, J=30)
modifyVector(e, c(U=10, M=30))
modifyVector(e, c(U=10, M=30), add=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.