Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

replmiss

Replace Missing Values in a Vector


Description

Function to replace missing (NA) values in a vector.

Usage

replmiss(x, y)

Arguments

x

vector that may include one or more missing values.

y

either a scalar or a vector of the same length as x with the value(s) to replace missing values with.

Value

Vector x with the missing values replaced based on the scalar or vector y.

Author(s)

Examples

x <- c(4,2,7,NA,1,NA,5)
x <- replmiss(x,0)
x

x <- c(4,2,7,NA,1,NA,5)
y <- c(2,3,6,5,8,1,2)
x <- replmiss(x,y)
x

metafor

Meta-Analysis Package for R

v2.4-0
GPL (>= 2)
Authors
Wolfgang Viechtbauer [aut, cre] (<https://orcid.org/0000-0003-3463-4063>)
Initial release
2020-03-19

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.