Learn R Programming

SciencesPo (version 1.02.12)

modify: Modify data elements by their position

Description

Modify an element in a vector, taking its position as reference.

Usage

modify(x, position, value)

Arguments

x
A data object
position
The position of the element to be replaced
value
The value to modify

encoding

UTF-8

Examples

Run this code
x <- seq(1:10)

modify(x, 1, 10)

Run the code above in your browser using DataLab