Learn R Programming

gratia (version 0.9.0)

to_na: Sets the elements of vector to NA

Description

Given a vector i indexing the elements of x, sets the selected elements of x to NA.

Usage

to_na(x, i)

Value

Returns x with possibly some elements set to NA

Arguments

x

vector of values

i

vector of values used to subset x