getTemporalColumns: Filter Date and Time Table Columns.

Description Usage Arguments See Also Examples

View source: R/misc.R

Description

Selects date and time columns (names or rows) from table info data frame.

Usage

1
2
getTemporalColumns(tableInfo, names.only = TRUE, include = NULL,
  except = NULL)

Arguments

tableInfo

data frame obtained by calling getTableSummary.

names.only

logical: if TRUE returns column names only, otherwise full rows of tableInfo.

include

a vector of column names to include. Output is restricted to this list.

except

a vector of column names to exclude. Output never contains names from this list.

See Also

getCharacterColumns, getNumericColumns, getTableSummary

Examples

1
2
3
4
5
6
7
8
9
if(interactive()){
# initialize connection to Lahman baseball database in Aster 
conn = odbcDriverConnect(connection="driver={Aster ODBC Driver};
                         server=<dbhost>;port=2406;database=<dbname>;uid=<user>;pwd=<pw>")

masterInfo = getTableSummary(channel=conn, 'master')
getTemporalColumns(masterInfo)
date_cols_df = getTemporalColumns(masterInfo, names.only=FALSE)
}

toaster documentation built on May 30, 2017, 3:51 a.m.