importData: Import data from the dzVis database

Description Usage Arguments Details Value Conversion rules (SQL -> R)

Description

Gets data from the dzVis database according to the specified table and columns. Original column types are set to its equivalents in R.

Usage

1
2
importData(table, columns, restrictions = NULL, limits = NULL,
  alternatives = NULL, connection = NULL)

Arguments

table

A character. The name of the table.

columns

A character vector. The name(s) of the column(s). If all columns should be imported, this argument must be set to *.

restrictions

A n x 2 matrix. Equality restrictions. The first column must contain the names of the columns. The second, its values.

limits

A n x 3 matrix. Inequality restrictions. See the details section for important information.

alternatives

A n x 2 matrix. Alternative values of a column (joined by 'or' conditions in a SQL query). The first column must contain the names of the columns. The second, its values.

connection

A DBI Connection object if a new connection should not be estabilished.

Details

The limits matrix must have the following columns

  1. targetColumn: A character value. Column on which restrictions should apply.

  2. min: A numeric value. Lower bound for the targetColumn. Should be set to NA when not applicable.

  3. max: A numeric value. Upper bound for the targetColumn. Should be set to NA when not applicable.

Value

A data.frame with the requested data.

Conversion rules (SQL -> R)

  1. enum -> factor

  2. int -> integer

  3. double -> numeric

  4. date or datetime -> Date

  5. varchar -> character


talithafs/dzVis-Package documentation built on May 31, 2019, 2:54 a.m.