Learn R Programming

PivotalR (version 0.1.18.5)

na.action: Functions for filtering NA values in data

Description

'na.omit' returns the object with incomplete cases removed.

Usage

# S4 method for db.obj
na.omit(object, vars = NULL, ...)

Arguments

object

A '>db.obj object, which wraps a data table in the connected database ('>db.data.frame), or some operations on a data table ('>db.Rquery).

vars

An array of strings, default is NULL. The names of the columns that the user wants to filter NA values. If it is NULL, all rows that contains NULL in any column will be filtered out.

Further arguments, not implemented yet.

Value

A '>db.Rquery object, which wraps the operation that filters the NA values from the columns vars in object.

See Also

madlib.lm, madlib.glm for linear and logistic regressions.

Examples

Run this code
# NOT RUN {
<!-- %% @test .port Database port number -->
<!-- %% @test .dbname Database name -->
## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

delete("abalone", conn.id = cid)
dat <- as.db.data.frame(abalone, "abalone", conn.id = cid, verbose = FALSE)

madlib.lm(rings ~ . - sex - id, data = dat, na.action = na.omit)

db.disconnect(cid, verbose = FALSE)
# }

Run the code above in your browser using DataLab