matched_powprod: Do a batch of power-products on a data frame

Description Usage Arguments Value Examples

View source: R/matched_powprod.R

Description

Do a batch of power-products on a data frame

Usage

1
matched_powprod(df_weights, df_target)

Arguments

df_weights

power weights (exponents)

df_target

target data frame

Value

data frame with power-product results

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
df_weights <-
  tribble(
    ~out_name, ~X1, ~X2,
         "Y1",   1,   1,
         "Y2",   1,  -1
  )

df_target <-
 tibble(
   X1 = c( 1, 1, 1, 1),
   X2 = c( 2, 3, 4, 5)
 )

matched_powprod(df_weights, df_target)

bind_cols(
  df_target,
  matched_powprod(df_weights, df_target)
)

zdelrosario/piMat documentation built on Jan. 2, 2020, 12:03 p.m.