normalize_price: Normalize prices

Description Usage Arguments

View source: R/normalize_prices.R

Description

normalize_price takes a dataset with prices and dates or event times and normalizes, using a given date/event time as the base.

Usage

1
2
normalize_price(price_data, time_type, base_time, price_var,
  new_price_var = "normalized_price")

Arguments

price_data

A dataset that includes prices to be normalized as well as times of each price (data.table)

time_type

Either "calendar" or "event". The type of time variable used in the data (character)

base_time

The time of the base price. If time_type = "event", base_time should be a single integer corresponding to the event time. If time_type = "calendar", base_time should be a vector of two integers, the first corresponding to the year, the second corresponding to the month (numeric)

price_var

The name of the original price variable found in price_data (character)

new_price_var

The desired name of the new, normalized price variable (default is just "normalized_price")


johnnybonney/sales.taxes documentation built on Dec. 7, 2018, 8:01 a.m.