Single target scale function using single data frame. Analogous to ip_scale. Primarily for use within other ipfitr functions to increase speed.

ip_scale_a(datatable, target_series, series_start = "value",
  series_target = "tar1", series_type = "tar")

Arguments

datatable

A data frame containing starting values and the target values.

target_series

Subset of names(datatable) containing series with target subtotals.

series_start

The name of the series in datatable to be scaled to the series_target.

series_target

The name of the series in datatable containing target subtotals.

Value

A data frame with the same dimensionality as datatable, with series_start scaled to the subtotals specified by series_target .

Examples

ip_scale_a(df, c("series1", "series2"))
#> Error in names(datatable) <- `*vtmp*`: names() applied to a non-vector
df %>% ip_scale_a("series1", series_start = "count", series_target = "tar1")
#> Error in names(datatable) <- `*vtmp*`: names() applied to a non-vector