drop.na.data | R Documentation |
This function takes a dataframe as input and removes any rows that have NA as values.
drop.na.data(df, vars=names(df))
df |
a dataframe |
vars |
sub set of variable (column) names to use in searching for missing values |
A subset of 'df' that only has non-missing values in the columns specified by 'vars'
path <- system.file("extdata","primate-example.data.csv", package="mmodely")
data <- read.csv(path, row.names=1)
df.nona <- drop.na.data(data, vars=names(df))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.