Learn R Programming

geeLite (version 1.0.6)

read_variables: Read Variables from Database

Description

Reads the specified variables from the SQLite database.

Usage

read_variables(path, variables, freq, prep_fun, aggr_funs, postp_funs)

Value

A list of variables read from the database.

Arguments

path

[mandatory] (character) Path to the root directory of the generated database.

variables

[mandatory] (character) A vector of variable names to read.

freq

[mandatory] (character or NULL) Specifies the frequency to aggregate the data. If NULL, no aggregation is performed and native dates are returned.

prep_fun

[mandatory] (function) Pre-processing function applied after daily expansion and before aggregation (used only when freq is not NULL). Passing NULL is handled in read_db(), so this argument is always a function here.

aggr_funs

[optional] (function or list) Aggregation function(s) used when aggregating to freq.

  • If a single function is provided, it is used for all variables.

  • If an unnamed list of functions is provided, all functions are applied to all variables (treated as default).

  • If a named list is provided, names must be variable names (as returned by fetch_vars) and/or "default"; named entries override the default for those variables.

postp_funs

[optional] (function or list or "external") Post- processing function(s) applied after aggregation.

  • If a single function or NULL is provided, it is used for all variables as default.

  • If an unnamed list of functions is provided, all are applied to all variables (treated as default).

  • If a named list is provided, names must be variable names (as returned by fetch_vars) and/or "default"; named entries override the default for those variables.

  • If "external", functions are loaded from postp/.

Default is NULL.