grapes-slash-slash-grapes: Factor-out (aggregate/project) block records into row...

%//%R Documentation

Factor-out (aggregate/project) block records into row records.

Description

Call blocks_to_rowrecs().

Usage

table %//% transform

Arguments

table

data (data.frame or relop).

transform

a rowrecs_to_blocks_spec.

Value

blocks_to_rowrecs() result.

Examples


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

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

d %//% transform

# identity (in structure)
d %//% transform %**% t(transform)


cdata documentation built on Aug. 20, 2023, 1:06 a.m.