Replace vector element at given position with value
Source:R/helpers.R
replace_in_vector_at_position.RdThis function replaces the element at a given position of a vector by the replacement value.
Examples
c(1,2,3,4,5) |> replace_in_vector_at_position(1, 0)
#> [1] 0 2 3 4 5