This is an example of R reading a YAML representation of a Python data_algebra pipeline. The example being read comes from here.

library(yaml)
library(wrapr)
library(rquery)
library(rqdatatable)

rep <- yaml.load_file("pipeline_yaml.txt")
ops <- convert_yaml_to_pipeline(rep)
cat(format(ops))

cat(to_sql(ops, rquery_default_db_info()))
d_local <- build_frame(
   "subjectID", "surveyCategory"     , "assessmentTotal", "irrelevantCol1", "irrelevantCol2" |
   1L         , "withdrawal behavior", 5                , "irrel1"        , "irrel2"         |
   1L         , "positive re-framing", 2                , "irrel1"        , "irrel2"         |
   2L         , "withdrawal behavior", 3                , "irrel1"        , "irrel2"         |
   2L         , "positive re-framing", 4                , "irrel1"        , "irrel2"         )

d_local %.>% 
  ops %.>% 
  knitr::kable(.)
ops %.>%
  op_diagram(.) %.>% 
  DiagrammeR::grViz(.)

See also https://github.com/WinVector/data_algebra/tree/master/Examples/LogisticExample .



WinVector/rquery documentation built on Aug. 24, 2023, 11:12 a.m.