NAtoZero: Change NAs in a vector into a given value.

Description Usage Arguments Value Author(s) Examples

View source: R/NAtoZero.r

Description

Extract all the missing values in a vector and turn them into a given value.

Usage

1
NAtoZero(v, value = 0)

Arguments

v

Vector.

value

Value to be given to the missing valus.

Value

Updated vector.

Author(s)

Kaspar Rufibach (maintainer), kaspar.rufibach@gmail.com,
http://www.kasparrufibach.ch

Examples

1
2
3
set.seed(1977)
vec <- sample(c(round(runif(10, 1, 3)), rep(NA, 10)))
NAtoZero(vec)

reporttools documentation built on Oct. 12, 2021, 5:06 p.m.