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")
datatable | A data frame containing starting values and the target values. |
---|---|
target_series | Subset of |
series_start | The name of the series in |
series_target | The name of the series in |
A data frame with the same dimensionality as datatable
, with series_start
scaled to the subtotals specified by series_target
.
ip_scale_a(df, c("series1", "series2"))#> Error in names(datatable) <- `*vtmp*`: names() applied to a non-vectordf %>% ip_scale_a("series1", series_start = "count", series_target = "tar1")#> Error in names(datatable) <- `*vtmp*`: names() applied to a non-vector