table %**% transform

Arguments

table

data (data.frame or relop).

transform

a rowrecs_to_blocks_spec.

Value

rowrecs_to_blocks() result.

Examples


d <- wrapr::build_frame(
  "id", "AUC", "R2" |
  1   , 0.7  , 0.4  |
  2   , 0.8  , 0.5  )

transform <- rowrecs_to_blocks_spec(
  wrapr::qchar_frame(
    "measure", "value" |
    "AUC"    , AUC     |
    "R2"     , R2      ),
  recordKeys = "id")

d %**% transform
#>   id measure value
#> 1  1     AUC   0.7
#> 2  1      R2   0.4
#> 3  2     AUC   0.8
#> 4  2      R2   0.5

# identity (in structure)
d %**% transform %//% t(transform)
#>   id AUC  R2
#> 1  1 0.7 0.4
#> 2  2 0.8 0.5