R/create_markets.R

Defines functions create_markets

Documented in create_markets

#' Create list of market identifiers.
#'
#' @param geog_id Variable that represents geographical market identifier as a string.
#' @param time_id Variable that represents time identifier as a string.
#' @return A list containing \code{geog_id} and \code{time_id}.
#'
#' @export
#'
#' @examples
#' # cross section data
#' create_markets(geog_id = "state", time_id = NULL)
#' # time series data
#' create_markets(geog_id = NULL, time_id = "year")
#' # panel data
#' create_markets(geog_id = "state", time_id = "year")

create_markets <- function(geog_id, time_id){
    markets <- list()
    markets[["geog_id"]] <- geog_id
    markets[["time_id"]] <- time_id
    return(markets)
}
lachlandeer/demandr documentation built on May 21, 2019, 12:04 p.m.