Learn R Programming

toaster (version 0.4.2)

getNullCounts: Counts nulls per column in the table.

Description

Counts nulls per column in the table.

Usage

getNullCounts(channel, tableName, tableInfo = NULL, include = NULL,
  except = NULL, schema = NULL, output = "long", where = NULL,
  test = FALSE)

Arguments

channel
object as returned by odbcConnect.
tableName
name of the table in Aster.
tableInfo
pre-built summary of columns to use (require when test=TRUE). See sqlColumns or getTableSummary.
include
a vector of column names to include. Output never contains attributes other than in the list.
except
a vector of column names to exclude. Output never contains attributes from the list.
schema
NULL or character: optional schema to restric table search to signle schema. In general, table search performed across whole database. Including schema restricts it to this single schema only.
output
Default output is a data frame in 'long' format. Other options include 'wide' format and 'matrix'.
where
specifies criteria to satisfy by the table rows before applying computation. The creteria are expressed in the form of SQL predicates (inside WHERE clause).
test
logical: if TRUE show what would be done, only (similar to parameter test in RODBC functions like sqlQuery and sqlSave).

Examples

Run this code
if (interactive()) {
# initialize connection to Dallas database in Aster 
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
                         server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")

null_counts = getNullCounts(conn, "baseball.batting", 
                            include=c('g','ab','r','h','so','bb','cs'), 
                            where='yearid > 2000')

}

Run the code above in your browser using DataLab