remove_missing {ggplot2}R Documentation

Convenience function to remove missing values from a data.frame

Description

Remove all non-complete rows, with a warning if na.rm = FALSE.

Usage

remove_missing(df, na.rm=FALSE, vars = names(df), name="")

Arguments

df data.frame
na.rm suppress warning that rows are being removed?
vars optional function name to make warning message more informative
name

Details

ggplot is somewhat more accomodating of missing values than R generally. For those stats which require complete data, missing values will be automatically removed with a warning. If na.rm = TRUE is supplied to the statistic, the warning will be suppressed.

Author(s)

Hadley Wickham <h.wickham@gmail.com>

Examples

a <- remove_missing(movies)
a <- remove_missing(movies, na.rm = TRUE)
qplot(mpaa, budget, data=movies, geom="boxplot")

[Package ggplot2 version 0.8.2 Index]