na.rm: Remove observations with missing values

Description Usage Arguments Details Author(s) See Also Examples

Description

na.rm is similar to na.omit but allows to specify a list of variables to take into account.

Usage

1
na.rm(x, v = NULL)

Arguments

x

a data frame

v

a list of variables

Details

If v is not specified, the result of na.rm will be the same as na.omit. If a list of variables is specified through v, only observations with a missing value (NA) for one of the specified variables will be removed from x. See examples.

Author(s)

Joseph Larmarange <joseph@larmarange.net>

See Also

na.omit

Examples

1
2
3
4
5
6
df <- data.frame(x = c(1, 2, 3), y = c(0, 10, NA), z= c("a",NA,"b"))
df
na.omit(df)
na.rm(df)
na.rm(df, c("x","y"))
na.rm(df, "z")

questionr documentation built on May 19, 2017, 10:08 a.m.

Search within the questionr package
Search all R packages, documentation and source code