ip_scale: Single target scale function calling external dataframe.

Description Usage Arguments Value Examples

Description

Single target scale function calling external dataframe.

Usage

1
2
ip_scale(datatable, target, series_start = "value",
  series_target = "value")

Arguments

datatable

A dataframe of values to be scaled to target.

target

A dataframe of target subtotals over one or more dimensions.

series_start

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

series_target

The name of the target series.

Value

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

Examples

1
2
3
4
5
df <- data.frame(x = rep(letters[1:2], 2), y = c(rep("c", 2), rep("d", 2)), value = runif(4))
tar1 <- data.frame(x = letters[1:2], value = c(20, 30))
ip_scale(df, tar1)

df %>% ip_scale(tar1, series_start = "value", series_target = "value")

ryantimpe/ipfitr documentation built on May 14, 2019, 8:55 a.m.