Learn R Programming

rplexos (version 0.13)

query_master: Query data and aggregate data

Description

This collection of functions retrieves data from the processed PLEXOS solutions and returns it in a convenient format.

Usage

query_master(db, time, col, prop, columns = "name", time.range = NULL,
  filter = NULL, phase = 4)

query_interval(db, ...)

query_day(db, ...)

query_week(db, ...)

query_month(db, ...)

query_year(db, ...)

sum_master(db, time, col, prop, columns = "name", time.range = NULL, filter = NULL, phase = 4, multiply.time = FALSE)

sum_interval(db, ...)

sum_day(db, ...)

sum_week(db, ...)

sum_month(db, ...)

sum_year(db, ...)

Arguments

db
PLEXOS database object
time
character. Table to query from (interval, day, week, month, year)
col
character. Collection to query
prop
character vector. Property or properties to query
columns
character. Data columns to query or aggregate by (defaults to name)
time.range
character. Range of dates (Give in 'ymdhms' or 'ymd' format)
filter
list. Used to filter by data columns (see details)
phase
integer. PLEXOS optimization phase (1-LT, 2-PASA, 3-MT, 4-ST)
...
parameters passed from shortcut functions to master (all except time)
multiply.time
boolean. When summing interval data, provide the value multiplied by interval duration (See details).

Value

  • A data frame that contains data summarized/aggregated by scenario.

code

multiply.time

Details

The family query_* returns the raw data in the databases, while sum_* aggregates the data according to columns.

The functions *_day, *_week, *_month and *_year are shortcuts for the corresponding, *_master function.

The following is a list of valid items for columns and filtering. Additionally, time can be specified for summary data (interval data always includes time).

  • category
property name (default for columns) parent (automatically selected when name is selected) category region (only meaningful for generators) zone (only meaningful for generators) period_type band sample timeslice

See Also

plexos_open to create the PLEXOS database object

query_sql to perform custom queries