Learn R Programming

HelpersMG (version 3.6)

modifyVector: Modifies Elements of a Vector

Description

Modifies a vector by changing a subset of elements to match a second vector.

Usage

modifyVector(x, val)

Arguments

x

A named vector.

val

A named vector with components to replace corresponding components in x.

Value

A modified version of x, with the elements of val replacing the elements of x

Details

modifyVector modifies elements of a vector

Examples

Run this code
# NOT RUN {
library("HelpersMG")
e <- c(M=10, L=20, J=30)
modifyVector(e, c(U=10, M=30))
# }

Run the code above in your browser using DataLab