If b is a cdata_record_spec then call blocks_to_rowrecs() (multiply or join out to the record spec). If a is a cdata_record_spec then call rowrecs_to_blocks() (aggregate or project from the record spec).

a %pivot% b

Arguments

a

data (data.frame or relop) or cdata_record_spec.

b

data (data.frame or relop) or cdata_record_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 ) record_spec <- new_record_spec( wrapr::qchar_frame( measure, value | AUC , "AUC" | R2 , "R2" ), recordKeys = "id") (d2 <- record_spec %pivot% d)
#> id AUC R2 #> 1 1 0.7 0.4 #> 2 2 0.8 0.5
# identity ( record_spec %pivot% d ) %pivot% record_spec
#> id measure value #> 1 1 AUC 0.7 #> 2 1 R2 0.4 #> 3 2 AUC 0.8 #> 4 2 R2 0.5
# identity record_spec %pivot% d %pivot% record_spec
#> id measure value #> 1 1 AUC 0.7 #> 2 1 R2 0.4 #> 3 2 AUC 0.8 #> 4 2 R2 0.5
# identity record_spec %pivot% ( d2 %pivot% record_spec )
#> id AUC R2 #> 1 1 0.7 0.4 #> 2 2 0.8 0.5