├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── Examples ├── Arrow │ ├── Arrow.Rmd │ ├── Arrow.md │ ├── JoinArrow.Rmd │ └── JoinArrow.md ├── Introduction │ ├── rquery_Introduction.Rmd │ └── rquery_Introduction.md ├── LogisticExample │ ├── Logistic2.Rmd │ └── Logistic2.md ├── Modes │ ├── Modes.Rmd │ ├── Modes.md │ ├── Modes_dplyr.Rmd │ └── Modes_dplyr.md ├── Simplification │ ├── Simplification.Rmd │ └── Simplification.md ├── Substitution │ ├── Substitution.Rmd │ └── Substitution.md ├── WindowFunctions │ ├── WindowFunctions.Rmd │ ├── WindowFunctions.md │ └── WindowFunctions_files │ │ └── figure-gfm │ │ ├── unnamed-chunk-12-1.png │ │ ├── unnamed-chunk-13-1.png │ │ └── unnamed-chunk-5-1.png ├── data_algebra │ ├── interop.Rmd │ └── interop.md ├── data_ops │ ├── ex.Rmd │ └── ex.md ├── old_readme │ ├── README.Rmd │ └── README.md ├── vignettes │ ├── rquery_substitution.Rmd │ └── rquery_substitution.md └── yaml │ ├── pipeline_yaml.txt │ ├── yaml.Rmd │ ├── yaml.md │ └── yaml_files │ └── figure-gfm │ └── diagram-1.png ├── LICENSE ├── NAMESPACE ├── NEWS.md ├── R ├── affine_transform.R ├── arrow.R ├── assign_slice.R ├── compare_frames.R ├── complete_design.R ├── db_def_methods_default.R ├── db_info.R ├── db_ops.R ├── drop_columns.R ├── ex_data_frame.R ├── extend.R ├── if_else_block.R ├── join_controller.R ├── lapply_bquote.R ├── lookup_by_column.R ├── make_assignments.R ├── map_cols.R ├── materialize.R ├── materialize_node.R ├── natural_join.R ├── non_sql_node.R ├── normalize.R ├── null_replace.R ├── op_diagram.R ├── order_by.R ├── order_expr.R ├── ordered_select_rows.R ├── package.R ├── partition_assignments.R ├── pre_sql.R ├── project.R ├── quantile.R ├── relop.R ├── rename.R ├── rlook.R ├── row_counts.R ├── rsummary.R ├── select_columns.R ├── select_rows.R ├── set_indicator.R ├── sql_expr_set.R ├── sql_node.R ├── table_source.R ├── theta_join.R ├── tokenize_for_sql.R ├── union_all.R ├── utils.R ├── work_with_NULLs.R ├── wrap_ex.R ├── yaml.R └── zzz.R ├── README.Rmd ├── README.md ├── _pkgdown.yml ├── cran-comments.md ├── db_examples ├── .gitignore ├── Expression_Factoring.Rmd ├── Expression_Factoring.md ├── MonetDBLite.Rmd ├── MonetDBLite.md ├── MonetDBLite_diagram.svg ├── RPostgreSQL.Rmd ├── RPostgreSQL.md ├── RPostgreSQL_diagram.svg ├── RPostgreSQL_schema.Rmd ├── RPostgreSQL_schema.md ├── RPostgres.Rmd ├── RPostgres.md ├── RPostgres_date.Rmd ├── RPostgres_date.md ├── RPostgres_diagram.svg ├── RPostgres_schema.Rmd ├── RPostgres_schema.md ├── RSQLite.Rmd ├── RSQLite.md ├── RSQLite_diagram.svg ├── SparkR.Rmd ├── SparkR.md ├── SparkR_diagram.png ├── sparklyr.Rmd ├── sparklyr.md └── sparklyr_diagram.png ├── docs ├── 404.html ├── LICENSE-text.html ├── _config.yml ├── articles │ ├── AssigmentPartitioner.html │ ├── AssigmentPartitioner_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── Parameterized_rquery.html │ ├── Parameterized_rquery_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── PipeableSQL.html │ ├── PipeableSQL_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── QueryGeneration.html │ ├── QueryGeneration_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── R_mapping.html │ ├── R_mapping_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── index.html │ ├── parameterized_rquery.png │ ├── present-2.png │ ├── rquery_intro.html │ ├── rquery_intro_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── rquery_many_columns.html │ ├── rquery_many_columns_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── rquery_substitution.html │ ├── rquery_substitution_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ ├── runtimes_1.png │ ├── sql_quoting.html │ ├── sql_quoting_files │ │ ├── accessible-code-block-0.0.1 │ │ │ └── empty-anchor.js │ │ ├── anchor-sections-1.0 │ │ │ ├── anchor-sections.css │ │ │ └── anchor-sections.js │ │ └── header-attrs-2.7 │ │ │ └── header-attrs.js │ └── tree_rewriter.html ├── authors.html ├── bootstrap-toc.css ├── bootstrap-toc.js ├── docsearch.css ├── docsearch.js ├── index.html ├── link.svg ├── news │ └── index.html ├── pkgdown.css ├── pkgdown.js ├── pkgdown.yml ├── reference │ ├── Rplot001.png │ ├── actualize_join_plan.html │ ├── add_relop.html │ ├── affine_transform.html │ ├── apply_right.relop.html │ ├── apply_right_S4-ANY-relop_list-method.html │ ├── apply_right_S4-ANY-rquery_db_info-method.html │ ├── apply_right_S4-data.frame-relop_arrow-method.html │ ├── apply_right_S4-relop_arrow-relop_arrow-method.html │ ├── apply_right_S4-relop_list-rquery_db_info-method.html │ ├── apply_right_S4-rquery_db_info-relop_list-method.html │ ├── arrow.html │ ├── assign_slice.html │ ├── build_join_plan.html │ ├── column_names.html │ ├── columns_used.html │ ├── commencify.html │ ├── complete_design.html │ ├── convert_yaml_to_pipeline.html │ ├── count_null_cols.html │ ├── db_td.html │ ├── describe_tables.html │ ├── drop_columns.html │ ├── ex.html │ ├── example_employee_date.html │ ├── execute.html │ ├── expand_grid.html │ ├── extend.html │ ├── extend_se.html │ ├── format_node.html │ ├── getDBOption.html │ ├── get_relop_list_stages.html │ ├── graph_join_plan.html │ ├── if_else_block.html │ ├── if_else_op.html │ ├── index.html │ ├── inspect_join_plan.html │ ├── key_inspector_all_cols.html │ ├── key_inspector_postgresql.html │ ├── key_inspector_sqlite.html │ ├── local_td.html │ ├── lookup_by_column.html │ ├── make_assignments.html │ ├── make_relop_list.html │ ├── map_column_values.html │ ├── mark_null_cols.html │ ├── materialize.html │ ├── materialize_node.html │ ├── materialize_relop_list_stages.html │ ├── materialize_sql.html │ ├── mk_td.html │ ├── natural_join.html │ ├── non_sql_node.html │ ├── normalize_cols.html │ ├── null_replace.html │ ├── op_diagram.html │ ├── order_expr.html │ ├── order_expr_se.html │ ├── order_rows.html │ ├── orderby.html │ ├── pick_top_k.html │ ├── pre_sql_fn.html │ ├── pre_sql_identifier.html │ ├── pre_sql_string.html │ ├── pre_sql_sub_expr.html │ ├── pre_sql_to_query.html │ ├── pre_sql_to_query.pre_sql_sub_expr.html │ ├── pre_sql_to_query.pre_sql_token.html │ ├── pre_sql_token.html │ ├── project.html │ ├── project_se.html │ ├── quantile_cols.html │ ├── quantile_node.html │ ├── quote_identifier.html │ ├── quote_literal.html │ ├── quote_string.html │ ├── quote_table_name.html │ ├── reexports.html │ ├── relop_list-class.html │ ├── rename_columns.html │ ├── row_counts.html │ ├── rq_colnames.html │ ├── rq_coltypes.html │ ├── rq_connection_advice.html │ ├── rq_connection_name.html │ ├── rq_connection_tests.html │ ├── rq_copy_to.html │ ├── rq_execute.html │ ├── rq_function_mappings.html │ ├── rq_get_query.html │ ├── rq_head.html │ ├── rq_nrow.html │ ├── rq_remove_table.html │ ├── rq_table_exists.html │ ├── rquery-package.html │ ├── rquery.html │ ├── rquery_apply_to_data_frame.html │ ├── rquery_db_info.html │ ├── rquery_default_db_info.html │ ├── rquery_default_methods.html │ ├── rstr.html │ ├── rsummary.html │ ├── rsummary_node.html │ ├── run_rquery_tests.html │ ├── select_columns.html │ ├── select_rows.html │ ├── select_rows_se.html │ ├── setDBOpt.html │ ├── setDBOption.html │ ├── set_indicator.html │ ├── show-relop_list-method.html │ ├── sql_expr_set.html │ ├── sql_node.html │ ├── str_pre_sql_sub_expr.html │ ├── tables_used.html │ ├── theta_join.html │ ├── theta_join_se.html │ ├── to_query.html │ ├── to_query.pre_sql_sub_expr.html │ ├── to_query.pre_sql_token.html │ ├── to_sql.html │ ├── to_transport_representation.html │ ├── tokenize_for_SQL.html │ ├── topo_sort_tables-1.png │ ├── topo_sort_tables.html │ ├── unionall.html │ └── wrap.html └── sitemap.xml ├── extras ├── .gitignore ├── AdHocQueries.Rmd ├── AdHocQueries.md ├── AssigmentPartitioner.Rmd ├── AssigmentPartitioner.md ├── CollectExprs.Rmd ├── CollectExprs.md ├── CollectExprs_files │ └── figure-markdown_github │ │ └── present-1.png ├── CollectExprs_timings.RDS ├── DBITests.Rmd ├── DBITests.md ├── DebugToolsForBigData.Rmd ├── DebugToolsForBigData.md ├── DebugToolsForBigDataP.Rmd ├── DebugToolsForBigDataP.md ├── DependencySorting.Rmd ├── DependencySorting.md ├── DependencySorting_files │ ├── figure-gfm │ │ ├── render1-1.png │ │ ├── sort-1.png │ │ └── steps-1.png │ └── figure-markdown_github │ │ ├── render1-1.png │ │ ├── sort-1.png │ │ └── steps-1.png ├── ExtraDBs.Rmd ├── ExtraDBs.md ├── GExample.Rmd ├── GExample.md ├── GExample_files │ └── figure-markdown_github │ │ └── unnamed-chunk-1-1.png ├── IrisExample.Rmd ├── IrisExample.html ├── JoinController.Rmd ├── JoinController.md ├── JoinController_files │ ├── figure-gfm │ │ ├── render1-1.png │ │ └── run-1.png │ └── figure-markdown_github │ │ ├── render1-1.png │ │ └── run-1.png ├── NarrowEffect.Rmd ├── NarrowEffect.md ├── NarrowEffectSpark.Rmd ├── NarrowEffectSpark.md ├── NarrowEffectSpark_cache │ └── markdown_github │ │ ├── __packages │ │ ├── cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.RData │ │ ├── cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdb │ │ ├── cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdx │ │ ├── defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.RData │ │ ├── defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdb │ │ ├── defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdx │ │ ├── defexp_354f59244f85ee93cb84583fb1ab1ce4.RData │ │ ├── defexp_354f59244f85ee93cb84583fb1ab1ce4.rdb │ │ ├── defexp_354f59244f85ee93cb84583fb1ab1ce4.rdx │ │ ├── defrquery_e625049e2edf3a6f1d2695b60b1efe48.RData │ │ ├── defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdb │ │ ├── defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdx │ │ ├── ex_076a9541a1334a582f5e6d0c60c93e28.RData │ │ ├── ex_076a9541a1334a582f5e6d0c60c93e28.rdb │ │ ├── ex_076a9541a1334a582f5e6d0c60c93e28.rdx │ │ ├── time_9feb0c2fcbd3e4c5932d73ca4207e596.RData │ │ ├── time_9feb0c2fcbd3e4c5932d73ca4207e596.rdb │ │ └── time_9feb0c2fcbd3e4c5932d73ca4207e596.rdx ├── NarrowEffectSpark_files │ └── figure-markdown_github │ │ ├── present-1.png │ │ └── present-2.png ├── NarrowEffect_cache │ └── markdown_github │ │ ├── __packages │ │ ├── cleanup_d9019aed674ca2d94762f4f1ffe97620.RData │ │ ├── cleanup_d9019aed674ca2d94762f4f1ffe97620.rdb │ │ ├── cleanup_d9019aed674ca2d94762f4f1ffe97620.rdx │ │ ├── defdplyr_310f4273c8d7fd748a734771549c25f2.RData │ │ ├── defdplyr_310f4273c8d7fd748a734771549c25f2.rdb │ │ ├── defdplyr_310f4273c8d7fd748a734771549c25f2.rdx │ │ ├── defexp_a4c7799c57b7bf4e24a089dde0bc7890.RData │ │ ├── defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdb │ │ ├── defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdx │ │ ├── defrquery_619ab1cc20bfe13386b0c3de6d42e31a.RData │ │ ├── defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdb │ │ ├── defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdx │ │ ├── ex_448721c35821bb143e36c7b19cf38e1e.RData │ │ ├── ex_448721c35821bb143e36c7b19cf38e1e.rdb │ │ ├── ex_448721c35821bb143e36c7b19cf38e1e.rdx │ │ ├── time_e3fbd9897f6344a41164684ac11debf3.RData │ │ ├── time_e3fbd9897f6344a41164684ac11debf3.rdb │ │ └── time_e3fbd9897f6344a41164684ac11debf3.rdx ├── NarrowEffect_files │ └── figure-markdown_github │ │ ├── present-1.png │ │ └── present-2.png ├── NarrowExample.Rmd ├── NarrowExample.md ├── NestedJoin.Rmd ├── NestedJoin.md ├── NestedJoin_diagram.png ├── Object_DAGs │ ├── Object_DAGs.Rmd │ └── Object_DAGs.md ├── PerfTest.Rmd ├── PerfTest.md ├── PerfTest_files │ └── figure-markdown_github │ │ ├── present-1.png │ │ └── present-2.png ├── PerfTest_timings.RDS ├── QTiming.Rmd ├── QTiming.md ├── QTimingFollowup │ ├── QTiming.Rmd │ ├── QTiming.md │ ├── QTiming3.Rmd │ ├── QTiming3.md │ ├── QTiming3_files │ │ └── figure-markdown_github │ │ │ ├── timings-1.png │ │ │ ├── timings-2.png │ │ │ ├── timings-3.png │ │ │ ├── timings-4.png │ │ │ ├── timings-5.png │ │ │ ├── timings-6.png │ │ │ ├── timings-7.png │ │ │ └── timings-8.png │ ├── QTiming4.Rmd │ ├── QTiming4.md │ ├── QTiming4_files │ │ └── figure-markdown_github │ │ │ ├── timings-1.png │ │ │ ├── timings-2.png │ │ │ ├── timings-3.png │ │ │ ├── timings-4.png │ │ │ ├── timings-5.png │ │ │ ├── timings-6.png │ │ │ └── timings-7.png │ ├── QTiming_files │ │ └── figure-markdown_github │ │ │ ├── timings-1.png │ │ │ ├── timings-2.png │ │ │ ├── timings-3.png │ │ │ ├── timings-4.png │ │ │ ├── timings-5.png │ │ │ ├── timings-6.png │ │ │ └── timings-7.png │ ├── compare_runs.Rmd │ ├── compare_runs.md │ ├── compare_runs4.Rmd │ ├── compare_runs4.md │ ├── compare_runs4_files │ │ └── figure-markdown_github │ │ │ └── unnamed-chunk-2-1.png │ ├── compare_runs_files │ │ └── figure-markdown_github │ │ │ ├── unnamed-chunk-2-1.png │ │ │ └── unnamed-chunk-3-1.png │ ├── cscan.R │ ├── fns.R │ ├── qtimings.RDS │ ├── qtimings3.RDS │ └── qtimings4.RDS ├── QTiming_files │ └── figure-markdown_github │ │ └── timings-1.png ├── SimpleTask.Rmd ├── SimpleTask.md ├── SimpleTask_files │ └── figure-markdown_github │ │ ├── unnamed-chunk-1-1.png │ │ ├── unnamed-chunk-2-1.png │ │ └── unnamed-chunk-3-1.png ├── SparkR.Rmd ├── SparkR.md ├── Sparkr_files │ ├── SparkRPlan.png │ ├── diagram1.png │ └── sdf_register.png ├── Summary_Example.Rmd ├── Summary_Example.md ├── all_timings.RDS ├── check_reverse_dependencies.Rmd ├── check_reverse_dependencies.md ├── corner_cases.Rmd ├── corner_cases.md ├── data_table.Rmd ├── data_table.md ├── data_table_files │ └── figure-markdown_github │ │ ├── presenttimings-1.png │ │ ├── presenttimings-2.png │ │ └── printrqueryp-1.png ├── data_table_replot.Rmd ├── data_table_replot.md ├── data_table_replot_files │ └── figure-markdown_github │ │ ├── presenttimings-1.png │ │ ├── presenttimings-10.png │ │ ├── presenttimings-11.png │ │ ├── presenttimings-12.png │ │ ├── presenttimings-13.png │ │ ├── presenttimings-14.png │ │ ├── presenttimings-15.png │ │ ├── presenttimings-16.png │ │ ├── presenttimings-17.png │ │ ├── presenttimings-18.png │ │ ├── presenttimings-19.png │ │ ├── presenttimings-2.png │ │ ├── presenttimings-20.png │ │ ├── presenttimings-21.png │ │ ├── presenttimings-22.png │ │ ├── presenttimings-3.png │ │ ├── presenttimings-4.png │ │ ├── presenttimings-5.png │ │ ├── presenttimings-6.png │ │ ├── presenttimings-7.png │ │ ├── presenttimings-8.png │ │ └── presenttimings-9.png ├── dbplyr_show_query.Rmd ├── dbplyr_show_query.md ├── dplyrSQL.Rmd ├── dplyrSQL.md ├── dplyr_modulo.Rmd ├── dplyr_modulo.md ├── fork.jpg ├── integer64.Rmd ├── integer64.md ├── join_example.Rmd ├── join_example.md ├── lag_example.Rmd ├── lag_example.md ├── parameterized_rquery.Rmd ├── parameterized_rquery.md ├── parameterized_rquery.png ├── pipeline_example.Rmd ├── pipeline_example.md ├── plotbenchmark.R ├── plotexample.Rmd ├── plotexample.md ├── plotexample_files │ ├── figure-markdown_github-ascii_identifiers │ │ ├── unnamed-chunk-1-1.png │ │ ├── unnamed-chunk-1-2.png │ │ └── unnamed-chunk-2-1.png │ └── figure-markdown_github │ │ ├── unnamed-chunk-1-1.png │ │ ├── unnamed-chunk-1-2.png │ │ └── unnamed-chunk-1-3.png ├── qtimings.RDS ├── rquery_diagram.Rmd ├── rquery_diagram.md ├── rquery_diagram_files │ ├── diagram1.png │ └── diagram1.svg ├── small_examples │ ├── column_selection.Rmd │ ├── column_selection.md │ ├── rand_example.Rmd │ ├── rand_example.md │ ├── rename_join.Rmd │ └── rename_join.md ├── tree_rewriter.Rmd ├── tree_rewriter.md ├── what_is_new_for_rquery_Dec_2019.Rmd └── what_is_new_for_rquery_Dec_2019.md ├── inst └── tinytest │ ├── test_NULL_NA_parse.R │ ├── test_bquote_name_escape.R │ ├── test_calc_warnings.R │ ├── test_col_map_msg.R │ ├── test_col_name_map.R │ ├── test_compare.R │ ├── test_concat.R │ ├── test_distinct.R │ ├── test_drop_columns.R │ ├── test_e_example1.R │ ├── test_encode.R │ ├── test_extend_partition.R │ ├── test_extend_shrink.R │ ├── test_grouped_running_op.R │ ├── test_if_else.R │ ├── test_immediate_subsitution.R │ ├── test_join_check.R │ ├── test_lhs_eval.R │ ├── test_materialize_node.R │ ├── test_mod.R │ ├── test_multi_arg_fn.R │ ├── test_names.R │ ├── test_parse.R │ ├── test_parse_issue.R │ ├── test_partial_fn_parse.R │ ├── test_pow.R │ ├── test_project_empty.R │ ├── test_project_narrowing.R │ ├── test_q.R │ ├── test_rename_columns.R │ ├── test_select_cols_reorder.R │ ├── test_select_narrowing.R │ ├── test_select_stacking.R │ ├── test_self_join.R │ ├── test_set_indicator.R │ ├── test_translation.R │ ├── test_w_select_rows.R │ └── test_wrap_vbind.R ├── man ├── actualize_join_plan.Rd ├── affine_transform.Rd ├── apply_right.relop.Rd ├── apply_right_S4-ANY-rquery_db_info-method.Rd ├── apply_right_S4-data.frame-relop_arrow-method.Rd ├── apply_right_S4-relop_arrow-relop_arrow-method.Rd ├── arrow.Rd ├── assign_slice.Rd ├── build_join_plan.Rd ├── column_names.Rd ├── columns_used.Rd ├── commencify.Rd ├── complete_design.Rd ├── convert_yaml_to_pipeline.Rd ├── count_null_cols.Rd ├── db_td.Rd ├── describe_tables.Rd ├── drop_columns.Rd ├── ex.Rd ├── example_employee_date.Rd ├── execute.Rd ├── expand_grid.Rd ├── extend.Rd ├── extend_se.Rd ├── format_node.Rd ├── getDBOption.Rd ├── graph_join_plan.Rd ├── if_else_block.Rd ├── if_else_op.Rd ├── inspect_join_plan.Rd ├── key_inspector_all_cols.Rd ├── key_inspector_postgresql.Rd ├── key_inspector_sqlite.Rd ├── local_td.Rd ├── lookup_by_column.Rd ├── make_assignments.Rd ├── map_column_values.Rd ├── mark_null_cols.Rd ├── materialize.Rd ├── materialize_node.Rd ├── materialize_sql.Rd ├── mk_td.Rd ├── natural_join.Rd ├── non_sql_node.Rd ├── normalize_cols.Rd ├── null_replace.Rd ├── op_diagram.Rd ├── order_expr.Rd ├── order_expr_se.Rd ├── order_rows.Rd ├── orderby.Rd ├── pick_top_k.Rd ├── pre_sql_fn.Rd ├── pre_sql_identifier.Rd ├── pre_sql_string.Rd ├── pre_sql_sub_expr.Rd ├── pre_sql_to_query.Rd ├── pre_sql_to_query.pre_sql_sub_expr.Rd ├── pre_sql_to_query.pre_sql_token.Rd ├── pre_sql_token.Rd ├── project.Rd ├── project_se.Rd ├── quantile_cols.Rd ├── quantile_node.Rd ├── quote_identifier.Rd ├── quote_literal.Rd ├── quote_string.Rd ├── quote_table_name.Rd ├── rename_columns.Rd ├── row_counts.Rd ├── rq_colnames.Rd ├── rq_coltypes.Rd ├── rq_connection_advice.Rd ├── rq_connection_name.Rd ├── rq_connection_tests.Rd ├── rq_copy_to.Rd ├── rq_execute.Rd ├── rq_function_mappings.Rd ├── rq_get_query.Rd ├── rq_head.Rd ├── rq_nrow.Rd ├── rq_remove_table.Rd ├── rq_table_exists.Rd ├── rquery-package.Rd ├── rquery_apply_to_data_frame.Rd ├── rquery_db_info.Rd ├── rquery_default_db_info.Rd ├── rquery_default_methods.Rd ├── rstr.Rd ├── rsummary.Rd ├── rsummary_node.Rd ├── select_columns.Rd ├── select_rows.Rd ├── select_rows_se.Rd ├── setDBOpt.Rd ├── setDBOption.Rd ├── set_indicator.Rd ├── sql_expr_set.Rd ├── sql_node.Rd ├── str_pre_sql_sub_expr.Rd ├── tables_used.Rd ├── theta_join.Rd ├── theta_join_se.Rd ├── to_sql.Rd ├── to_transport_representation.Rd ├── tokenize_for_SQL.Rd ├── topo_sort_tables.Rd ├── unionall.Rd └── wrap.Rd ├── rquery.Rproj ├── tests └── tinytest.R ├── tools ├── pipe_diagram.png └── rquery.jpg └── vignettes ├── AssigmentPartitioner.Rmd ├── Parameterized_rquery.Rmd ├── PipeableSQL.Rmd ├── QueryGeneration.Rmd ├── R_mapping.Rmd ├── parameterized_rquery.png ├── present-2.png ├── rquery_intro.Rmd ├── rquery_many_columns.Rmd ├── runtimes_1.png └── sql_quoting.Rmd /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^CRAN-RELEASE$ 2 | ^Meta$ 3 | ^doc$ 4 | ^.*\.Rproj$ 5 | ^\.Rproj\.user$ 6 | ^docs$ 7 | ^README.Rmd$ 8 | ^.*.log$ 9 | ^logs$ 10 | ^extras$ 11 | ^cran-comments\.md$ 12 | ^_pkgdown\.yml$ 13 | ^revdep$ 14 | ^db_examples$ 15 | ^LICENSE$ 16 | ^Examples$ 17 | ^_pkgdown\.yml$ 18 | ^CRAN-SUBMISSION$ 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | Meta 2 | doc 3 | .Rproj.user 4 | .Rhistory 5 | .RData 6 | .Ruserdata 7 | .DS_Store 8 | *~ 9 | *.log 10 | logs/ 11 | df_tmp/ 12 | inst/doc 13 | revdep 14 | CRAN-RELEASE 15 | spark-warehouse 16 | 17 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: rquery 2 | Type: Package 3 | Title: Relational Query Generator for Data Manipulation at Scale 4 | Version: 1.4.99 5 | Date: 2023-08-19 6 | Authors@R: c( 7 | person("John", "Mount", email = "jmount@win-vector.com", role = c("aut", "cre")), 8 | person(family = "Win-Vector LLC", role = c("cph")) 9 | ) 10 | Maintainer: John Mount 11 | URL: https://github.com/WinVector/rquery/, https://winvector.github.io/rquery/ 12 | BugReports: https://github.com/WinVector/rquery/issues 13 | Description: A piped query generator based on Edgar F. Codd's relational 14 | algebra, and on production experience using 'SQL' and 'dplyr' at big data 15 | scale. The design represents an attempt to make 'SQL' more teachable by 16 | denoting composition by a sequential pipeline notation instead of nested 17 | queries or functions. The implementation delivers reliable high 18 | performance data processing on large data systems such as 'Spark', 19 | databases, and 'data.table'. Package features include: data processing trees 20 | or pipelines as observable objects (able to report both columns 21 | produced and columns used), optimized 'SQL' generation as an explicit 22 | user visible table modeling step, plus explicit query reasoning and checking. 23 | License: GPL-2 | GPL-3 24 | Encoding: UTF-8 25 | Depends: 26 | R (>= 3.4.0), 27 | wrapr (>= 2.0.9) 28 | Imports: 29 | utils, 30 | stats, 31 | methods 32 | Suggests: 33 | DBI, 34 | RSQLite, 35 | rqdatatable (>= 1.3.2), 36 | igraph, 37 | knitr, 38 | rmarkdown, 39 | yaml, 40 | tinytest 41 | RoxygenNote: 7.2.3 42 | ByteCompile: true 43 | VignetteBuilder: knitr 44 | -------------------------------------------------------------------------------- /Examples/Simplification/Simplification.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Simplifiation" 3 | output: github_document 4 | --- 5 | 6 | ```{r} 7 | library("rquery") 8 | library("rqdatatable") 9 | ``` 10 | 11 | Roughly we consider `extend()` safe to fold, and `select_rows()` unsafe (as 12 | this may eliminate guards). So we combine `extend()` steps, but not `select_rows()` steos. 13 | 14 | ```{r} 15 | d2 <- data.frame( 16 | col1 = c(0, 1), 17 | col2 = c(1, 0) 18 | ) 19 | 20 | 21 | ops2 <- local_td(d2) %.>% 22 | extend(., x := 1) %.>% 23 | extend(., x := 2) %.>% 24 | select_rows(., col2 > 0) %.>% 25 | select_rows(., col1 / col2 > 0) 26 | 27 | ops2 28 | ``` 29 | 30 | ```{r} 31 | d2 %.>% ops2 32 | ``` 33 | 34 | -------------------------------------------------------------------------------- /Examples/Simplification/Simplification.md: -------------------------------------------------------------------------------- 1 | Simplifiation 2 | ================ 3 | 4 | ``` r 5 | library("rquery") 6 | ``` 7 | 8 | ## Loading required package: wrapr 9 | 10 | ``` r 11 | library("rqdatatable") 12 | ``` 13 | 14 | Roughly we consider `extend()` safe to fold, and `select_rows()` unsafe 15 | (as this may eliminate guards). So we combine `extend()` steps, but not 16 | `select_rows()` steos. 17 | 18 | ``` r 19 | d2 <- data.frame( 20 | col1 = c(0, 1), 21 | col2 = c(1, 0) 22 | ) 23 | 24 | 25 | ops2 <- local_td(d2) %.>% 26 | extend(., x := 1) %.>% 27 | extend(., x := 2) %.>% 28 | select_rows(., col2 > 0) %.>% 29 | select_rows(., col1 / col2 > 0) 30 | 31 | ops2 32 | ``` 33 | 34 | ## [1] "mk_td(\"d2\", c( \"col1\", \"col2\")) %.>% extend(., x := 2) %.>% select_rows(., col2 > 0) %.>% select_rows(., col1 / col2 > 0)" 35 | 36 | ``` r 37 | d2 %.>% ops2 38 | ``` 39 | 40 | ## [1] col1 col2 x 41 | ## <0 rows> (or 0-length row.names) 42 | -------------------------------------------------------------------------------- /Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/Examples/WindowFunctions/WindowFunctions_files/figure-gfm/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /Examples/data_ops/ex.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "ex Example" 3 | output: github_document 4 | --- 5 | 6 | ```{r} 7 | library(rqdatatable) 8 | 9 | d <- data.frame(x = 1:3, y = 4:6) 10 | ops <- wrap(d) %.>% 11 | extend(., z := x + y) 12 | 13 | print(ops) 14 | ``` 15 | 16 | ```{r} 17 | ops %.>% 18 | ex %.>% 19 | knitr::kable(.) 20 | ``` 21 | 22 | ```{r} 23 | d %.>% 24 | knitr::kable(.) 25 | ``` 26 | -------------------------------------------------------------------------------- /Examples/data_ops/ex.md: -------------------------------------------------------------------------------- 1 | ex Example 2 | ================ 3 | 4 | ``` r 5 | library(rqdatatable) 6 | ``` 7 | 8 | ## Loading required package: rquery 9 | 10 | ``` r 11 | d <- data.frame(x = 1:3, y = 4:6) 12 | ops <- wrap(d) %.>% 13 | extend(., z := x + y) 14 | 15 | print(ops) 16 | ``` 17 | 18 | ## [mk_td("d", c( 19 | ## "x", 20 | ## "y")) %.>% 21 | ## extend(., 22 | ## z := x + y) 23 | ## ]( 24 | ## d) 25 | 26 | ``` r 27 | ops %.>% 28 | ex %.>% 29 | knitr::kable(.) 30 | ``` 31 | 32 | | x | y | z | 33 | | -: | -: | -: | 34 | | 1 | 4 | 5 | 35 | | 2 | 5 | 7 | 36 | | 3 | 6 | 9 | 37 | 38 | ``` r 39 | d %.>% 40 | knitr::kable(.) 41 | ``` 42 | 43 | | x | y | 44 | | -: | -: | 45 | | 1 | 4 | 46 | | 2 | 5 | 47 | | 3 | 6 | 48 | -------------------------------------------------------------------------------- /Examples/yaml/pipeline_yaml.txt: -------------------------------------------------------------------------------- 1 | - op: TableDescription 2 | table_name: d 3 | qualifiers: {} 4 | column_names: 5 | - subjectID 6 | - surveyCategory 7 | - assessmentTotal 8 | - irrelevantCol1 9 | - irrelevantCol2 10 | key: d 11 | - op: Extend 12 | ops: 13 | probability: exp(assessmentTotal * 0.237) 14 | partition_by: [] 15 | order_by: [] 16 | reverse: [] 17 | - op: Extend 18 | ops: 19 | total: sum(probability) 20 | partition_by: 21 | - subjectID 22 | order_by: [] 23 | reverse: [] 24 | - op: Extend 25 | ops: 26 | probability: probability / total 27 | partition_by: [] 28 | order_by: [] 29 | reverse: [] 30 | - op: Extend 31 | ops: 32 | row_number: row_number() 33 | partition_by: 34 | - subjectID 35 | order_by: 36 | - probability 37 | - surveyCategory 38 | reverse: 39 | - probability 40 | - op: SelectRows 41 | expr: row_number == 1 42 | - op: SelectColumns 43 | columns: 44 | - subjectID 45 | - surveyCategory 46 | - probability 47 | - op: Rename 48 | column_remapping: 49 | diagnosis: surveyCategory 50 | - op: Order 51 | order_columns: 52 | - subjectID 53 | reverse: [] 54 | limit: null 55 | 56 | -------------------------------------------------------------------------------- /Examples/yaml/yaml.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "yaml" 3 | output: github_document 4 | --- 5 | 6 | This is an example of `R` reading a `YAML` representation of a `Python` [`data_algebra`](https://github.com/WinVector/data_algebra) pipeline. The example being read comes from [here](https://github.com/WinVector/data_algebra/blob/master/Examples/LogisticExample/ScoringExample.ipynb). 7 | 8 | ```{r} 9 | library(yaml) 10 | library(wrapr) 11 | library(rquery) 12 | library(rqdatatable) 13 | 14 | rep <- yaml.load_file("pipeline_yaml.txt") 15 | ops <- convert_yaml_to_pipeline(rep) 16 | cat(format(ops)) 17 | 18 | cat(to_sql(ops, rquery_default_db_info())) 19 | ``` 20 | 21 | ```{r} 22 | d_local <- build_frame( 23 | "subjectID", "surveyCategory" , "assessmentTotal", "irrelevantCol1", "irrelevantCol2" | 24 | 1L , "withdrawal behavior", 5 , "irrel1" , "irrel2" | 25 | 1L , "positive re-framing", 2 , "irrel1" , "irrel2" | 26 | 2L , "withdrawal behavior", 3 , "irrel1" , "irrel2" | 27 | 2L , "positive re-framing", 4 , "irrel1" , "irrel2" ) 28 | 29 | d_local %.>% 30 | ops %.>% 31 | knitr::kable(.) 32 | ``` 33 | 34 | 35 | ```{r diagram, fig.width=8, fig.height=8} 36 | ops %.>% 37 | op_diagram(.) %.>% 38 | DiagrammeR::grViz(.) 39 | ``` 40 | 41 | 42 | See also https://github.com/WinVector/data_algebra/tree/master/Examples/LogisticExample . 43 | -------------------------------------------------------------------------------- /Examples/yaml/yaml_files/figure-gfm/diagram-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/Examples/yaml/yaml_files/figure-gfm/diagram-1.png -------------------------------------------------------------------------------- /R/compare_frames.R: -------------------------------------------------------------------------------- 1 | 2 | # TODO: switch to wrapr::check_equiv_frames 3 | rquery_check_equiv_frames <- function(d1, d2, 4 | ..., 5 | tolerance = sqrt(.Machine$double.eps)) { 6 | if( (!is.data.frame(d1)) != (!is.data.frame(d2)) ) { 7 | return(FALSE) 8 | } 9 | d1 <- data.frame(d1) 10 | d2 <- data.frame(d2) 11 | if((nrow(d1)!=nrow(d2)) || (ncol(d1)!=ncol(d2))) { 12 | return(FALSE) 13 | } 14 | cols <- sort(colnames(d1)) 15 | c2 <- sort(colnames(d2)) 16 | if(!isTRUE(all.equal(cols, c2))) { 17 | return(FALSE) 18 | } 19 | d1 <- d1[, cols, drop=FALSE] 20 | d1 <- d1[wrapr::orderv(d1), , drop=FALSE] 21 | rownames(d1) <- NULL 22 | d2 <- d2[, cols, drop=FALSE] 23 | d2 <- d2[wrapr::orderv(d2), , drop=FALSE] 24 | rownames(d2) <- NULL 25 | for(c in cols) { 26 | c1 <- d1[[c]] 27 | c2 <- d2[[c]] 28 | if(is.numeric(c1) != is.numeric(c2)) { 29 | return(FALSE) 30 | } 31 | if(is.numeric(c1)) { 32 | if(!isTRUE(all.equal(c1, c2, tolerance=tolerance))) { 33 | return(FALSE) 34 | } 35 | } else { 36 | if(!isTRUE(all.equal(c1, c2))) { 37 | return(FALSE) 38 | } 39 | } 40 | } 41 | return(TRUE) 42 | } 43 | 44 | -------------------------------------------------------------------------------- /R/db_def_methods_default.R: -------------------------------------------------------------------------------- 1 | 2 | # default to_sql implementations 3 | # dispatching per handle instance (instead of per handle class) 4 | 5 | 6 | 7 | #' Default to_sql method implementations. 8 | #' 9 | #' @return default implementation methods 10 | #' 11 | #' @keywords internal 12 | #' 13 | #' @export 14 | #' 15 | rquery_default_methods <- function() { 16 | list( 17 | "to_sql.relop_drop_columns" = to_sql_relop_drop_columns, 18 | "to_sql.relop_extend" = to_sql_relop_extend, 19 | "to_sql.relop_natural_join" = to_sql_relop_natural_join, 20 | "to_sql.relop_non_sql" = to_sql_relop_non_sql, 21 | "to_sql.relop_null_replace" = to_sql_relop_null_replace, 22 | "to_sql.relop_orderby" = to_sql_relop_orderby, 23 | "to_sql.relop_order_expr" = to_sql_relop_order_expr, 24 | "to_sql.relop_project" = to_sql_relop_project, 25 | "to_sql.relop_rename_columns" = to_sql_relop_rename_columns, 26 | "to_sql.relop_select_columns" = to_sql_relop_select_columns, 27 | "to_sql.relop_select_rows" = to_sql_relop_select_rows, 28 | "to_sql.relop_set_indicator" = to_sql_relop_set_indicator, 29 | "to_sql.relop_sql" = to_sql_relop_sql, 30 | "to_sql.relop_table_source" = to_sql_relop_table_source, 31 | "to_sql.relop_theta_join" = to_sql_relop_theta_join, 32 | "to_sql.relop_unionall" = to_sql_relop_unionall 33 | ) 34 | } 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /R/lapply_bquote.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | # bquote items, and also apply -char -> name conversion 6 | lapply_bquote_to_langauge_list <- function(ll, env) { 7 | force(env) 8 | orig_minus <- get('-', mode = 'function', envir = env) 9 | minus_fn_to_name <- function(e1, e2) { 10 | if(!missing(e2)) { 11 | return(orig_minus(e1, e2)) 12 | } 13 | if(is.name(e1)) { 14 | return(e1) 15 | } 16 | if(is.character(e1) && (length(e1)==1)) { 17 | return(as.name(e1)) 18 | } 19 | orig_minus(e1) 20 | } 21 | env2 <- new.env(parent = env) 22 | assign('-', minus_fn_to_name, envir = env2) 23 | lapply(ll, 24 | function(li) { 25 | do.call(bquote, list(expr = li, where = env2), envir = env2) 26 | }) 27 | } 28 | 29 | -------------------------------------------------------------------------------- /R/package.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #' \code{rquery}: Relational Query Generator for Data Manipulation 4 | #' 5 | #' \code{rquery} supplies a piped query generator based on Edgar F. Codd's relational 6 | #' algebra and operator names (plus experience using \code{SQL} and \code{dplyr} at big data 7 | #' scale). The design represents an attempt to make \code{SQL} more teachable by 8 | #' denoting composition a sequential pipeline notation instead of nested 9 | #' queries or functions. Package features include: data processing trees 10 | #' or pipelines as observable objects (able to report both columns 11 | #' produced and columns used), optimized \code{SQL} generation as an explicit 12 | #' user visible modeling step, and convenience methods for applying query 13 | #' trees to in-memory data.frames. 14 | #' 15 | #' Note: \code{rquery} is a "database first" design. This means choices are made that 16 | #' favor database implementation. These include: capturing the entire calculation prior 17 | #' to doing any work (and using recursive methods to inspect this object, which can limit 18 | #' the calculation depth to under 1000 steps at a time), preferring "tame column names" 19 | #' (which isn't a bad idea in `R` anyway as columns and variables are often seen as cousins), 20 | #' and not preserving row or column order (or supporting numeric column indexing). Also, 21 | #' \code{rquery} does have a fast in-memory implementation: \code{rqdatatable} 22 | #' (thanks to the \code{data.table}, so one can in fact use `rquery` without a database. 23 | #' 24 | "_PACKAGE" 25 | 26 | #' @importFrom wrapr apply_right 27 | NULL 28 | 29 | #' @importFrom wrapr apply_left 30 | NULL 31 | 32 | -------------------------------------------------------------------------------- /R/row_counts.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | #' Build an optree pipeline counts rows. 4 | #' 5 | #' This is an example of building up a desired pre-prepared pipeline fragment from relop nodes. 6 | #' 7 | #' @param source relop tree or data.frame source. 8 | #' @param ... force later arguments to bind by name. 9 | #' @param groupby partitioning (window function) column names. 10 | #' @param env environment to look for values in. 11 | #' 12 | #' @examples 13 | #' 14 | #' # by hand logistic regression example 15 | #' d <- mk_td("survey_table", 16 | #' c("subjectID", "surveyCategory", "assessmentTotal")) 17 | #' optree <- d %.>% 18 | #' row_counts(., groupby = "subjectID") 19 | #' cat(format(optree)) 20 | #' 21 | #' @export 22 | #' 23 | row_counts <- function(source, 24 | ..., 25 | groupby = character(0), 26 | env = parent.frame()) { 27 | force(env) 28 | wrapr::stop_if_dot_args(substitute(list(...)), 29 | "rquery::row_counts") 30 | one <- NULL # don't look like an unbound reference 31 | pipe <- source %.>% 32 | extend(., one = 1) %.>% 33 | project(., groupby = groupby, n = sum(one)) 34 | pipe 35 | } 36 | -------------------------------------------------------------------------------- /R/zzz.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | .onLoad <- function(libname, pkgname) { 6 | opts <- options() 7 | our_defaults <- list( 8 | rquery.verbose = FALSE, 9 | rquery.rquery_executor = NULL, 10 | rquery.rquery_db_executor = NULL 11 | ) 12 | defs <- setdiff(names(our_defaults), 13 | names(opts)) 14 | if(length(defs)>=1) { 15 | options(our_defaults[defs]) 16 | } 17 | invisible() 18 | } 19 | 20 | -------------------------------------------------------------------------------- /_pkgdown.yml: -------------------------------------------------------------------------------- 1 | 2 | navbar: 3 | right: 4 | - text: "Sponsor: Win-Vector LLC" 5 | href: https://win-vector.com/ 6 | 7 | 8 | -------------------------------------------------------------------------------- /cran-comments.md: -------------------------------------------------------------------------------- 1 | 2 | ## Test environments 3 | 4 | R CMD check --as-cran rquery_1.4.99.tar.gz 5 | * using R version 4.3.0 (2023-04-21) 6 | * using platform: x86_64-apple-darwin20 (64-bit) 7 | 8 | devtools::check_win_devel() 9 | * using R Under development (unstable) (2023-08-19 r84989 ucrt) 10 | * using platform: x86_64-w64-mingw32 11 | 12 | rhub::check_for_cran() 13 | skip 14 | 15 | ## Reverse dependencies 16 | 17 | Checked https://github.com/WinVector/rquery/blob/master/extras/check_reverse_dependencies.md 18 | 19 | Note: "Edgar F. Codd", "SQL", and "observable" are all spelled correctly. 20 | -------------------------------------------------------------------------------- /db_examples/.gitignore: -------------------------------------------------------------------------------- 1 | spark-warehouse 2 | logs 3 | derby.log 4 | metastore_db 5 | -------------------------------------------------------------------------------- /db_examples/Expression_Factoring.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "Expression Factoring" 3 | output: github_document 4 | --- 5 | 6 | A quick example of expression factoring in `dplyr` and `rquery`. 7 | 8 | We set up our local and remote tables. 9 | 10 | ```{r setup} 11 | db <- DBI::dbConnect(RSQLite::SQLite(), 12 | ":memory:") 13 | 14 | d_local <- data.frame(x = 1) 15 | 16 | DBI::dbWriteTable(db, "d_remote", d_local) 17 | ``` 18 | 19 | We try the same calculation with `dplyr` in `R` and in the database. 20 | 21 | ```{r dplyr} 22 | library("dplyr") 23 | packageVersion("dplyr") 24 | packageVersion("dbplyr") 25 | 26 | d_local %>% 27 | mutate(y = 1, y = y + 1, y = y + 1) 28 | 29 | dplyr_remote <- dplyr::tbl(db, "d_remote") 30 | 31 | dplyr_remote %>% 32 | mutate(y = 1, y = y + 1, y = y + 1) 33 | # notice y does not equal 3 in this case 34 | ``` 35 | 36 | We try the same calculation with `rquery` in `R` and in the database. 37 | 38 | 39 | ```{r rqdatatable} 40 | library("rqdatatable") 41 | library("rquery") 42 | 43 | d_local %.>% 44 | extend(., 45 | y = 1, y = y + 1, y = y + 1) 46 | 47 | rquery_remote <- rquery::db_td(db, "d_remote") 48 | 49 | rquery_remote %.>% 50 | extend(., 51 | y = 1, y = y + 1, y = y + 1) %.>% 52 | execute(db, .) 53 | ``` 54 | 55 | And we clean up after. 56 | 57 | 58 | ```{r disconnect} 59 | DBI::dbDisconnect(db) 60 | ``` 61 | -------------------------------------------------------------------------------- /db_examples/RPostgres_schema.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "RPostgres schema" 3 | output: github_document 4 | --- 5 | 6 | Working with a schema. Package is not quite ready for schemas yet as we are not yet qualifying table names enough places. 7 | 8 | 9 | ```{r} 10 | library("rquery") 11 | library("wrapr") 12 | packageVersion("rquery") 13 | 14 | raw_connection <- DBI::dbConnect(RPostgres::Postgres(), 15 | host = 'localhost', 16 | port = 5432, 17 | user = 'johnmount', 18 | password = '') 19 | 20 | 21 | dbopts <- rq_connection_tests(raw_connection) 22 | db <- rquery_db_info(connection = raw_connection, 23 | is_dbi = TRUE, 24 | connection_options = dbopts) 25 | 26 | DBI::dbExecute(raw_connection, "DROP SCHEMA IF EXISTS test_schema CASCADE") 27 | DBI::dbExecute(raw_connection, "CREATE SCHEMA test_schema") 28 | 29 | rq_copy_to(db, "test_table", data.frame(x = 1), 30 | qualifiers = c(schema = "test_schema"), temporary = FALSE) 31 | 32 | table_handle <- db_td(db, "test_table", qualifiers = c(schema = "test_schema")) 33 | 34 | print(table_handle) 35 | 36 | execute(db, table_handle) 37 | 38 | 39 | DBI::dbExecute(raw_connection, "DROP SCHEMA IF EXISTS test_schema CASCADE") 40 | DBI::dbDisconnect(raw_connection) 41 | 42 | ``` 43 | -------------------------------------------------------------------------------- /db_examples/SparkR_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/db_examples/SparkR_diagram.png -------------------------------------------------------------------------------- /db_examples/sparklyr_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/db_examples/sparklyr_diagram.png -------------------------------------------------------------------------------- /docs/_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-cayman -------------------------------------------------------------------------------- /docs/articles/AssigmentPartitioner_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/AssigmentPartitioner_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/AssigmentPartitioner_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/AssigmentPartitioner_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/Parameterized_rquery_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/Parameterized_rquery_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/Parameterized_rquery_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/Parameterized_rquery_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/PipeableSQL_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/PipeableSQL_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/PipeableSQL_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/PipeableSQL_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/QueryGeneration_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/QueryGeneration_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/QueryGeneration_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/QueryGeneration_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/R_mapping_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/R_mapping_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/R_mapping_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/R_mapping_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/parameterized_rquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/docs/articles/parameterized_rquery.png -------------------------------------------------------------------------------- /docs/articles/present-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/docs/articles/present-2.png -------------------------------------------------------------------------------- /docs/articles/rquery_intro_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/rquery_intro_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/rquery_intro_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/rquery_intro_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/rquery_many_columns_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/rquery_many_columns_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/rquery_many_columns_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/rquery_many_columns_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/rquery_substitution_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/rquery_substitution_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/rquery_substitution_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/rquery_substitution_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/articles/runtimes_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/docs/articles/runtimes_1.png -------------------------------------------------------------------------------- /docs/articles/sql_quoting_files/accessible-code-block-0.0.1/empty-anchor.js: -------------------------------------------------------------------------------- 1 | // Hide empty tag within highlighted CodeBlock for screen reader accessibility (see https://github.com/jgm/pandoc/issues/6352#issuecomment-626106786) --> 2 | // v0.0.1 3 | // Written by JooYoung Seo (jooyoung@psu.edu) and Atsushi Yasumoto on June 1st, 2020. 4 | 5 | document.addEventListener('DOMContentLoaded', function() { 6 | const codeList = document.getElementsByClassName("sourceCode"); 7 | for (var i = 0; i < codeList.length; i++) { 8 | var linkList = codeList[i].getElementsByTagName('a'); 9 | for (var j = 0; j < linkList.length; j++) { 10 | if (linkList[j].innerHTML === "") { 11 | linkList[j].setAttribute('aria-hidden', 'true'); 12 | } 13 | } 14 | } 15 | }); 16 | -------------------------------------------------------------------------------- /docs/articles/sql_quoting_files/anchor-sections-1.0/anchor-sections.css: -------------------------------------------------------------------------------- 1 | /* Styles for section anchors */ 2 | a.anchor-section {margin-left: 10px; visibility: hidden; color: inherit;} 3 | a.anchor-section::before {content: '#';} 4 | .hasAnchor:hover a.anchor-section {visibility: visible;} 5 | -------------------------------------------------------------------------------- /docs/articles/sql_quoting_files/anchor-sections-1.0/anchor-sections.js: -------------------------------------------------------------------------------- 1 | // Anchor sections v1.0 written by Atsushi Yasumoto on Oct 3rd, 2020. 2 | document.addEventListener('DOMContentLoaded', function() { 3 | // Do nothing if AnchorJS is used 4 | if (typeof window.anchors === 'object' && anchors.hasOwnProperty('hasAnchorJSLink')) { 5 | return; 6 | } 7 | 8 | const h = document.querySelectorAll('h1, h2, h3, h4, h5, h6'); 9 | 10 | // Do nothing if sections are already anchored 11 | if (Array.from(h).some(x => x.classList.contains('hasAnchor'))) { 12 | return null; 13 | } 14 | 15 | // Use section id when pandoc runs with --section-divs 16 | const section_id = function(x) { 17 | return ((x.classList.contains('section') || (x.tagName === 'SECTION')) 18 | ? x.id : ''); 19 | }; 20 | 21 | // Add anchors 22 | h.forEach(function(x) { 23 | const id = x.id || section_id(x.parentElement); 24 | if (id === '') { 25 | return null; 26 | } 27 | let anchor = document.createElement('a'); 28 | anchor.href = '#' + id; 29 | anchor.classList = ['anchor-section']; 30 | x.classList.add('hasAnchor'); 31 | x.appendChild(anchor); 32 | }); 33 | }); 34 | -------------------------------------------------------------------------------- /docs/articles/sql_quoting_files/header-attrs-2.7/header-attrs.js: -------------------------------------------------------------------------------- 1 | // Pandoc 2.9 adds attributes on both header and div. We remove the former (to 2 | // be compatible with the behavior of Pandoc < 2.8). 3 | document.addEventListener('DOMContentLoaded', function(e) { 4 | var hs = document.querySelectorAll("div.section[class*='level'] > :first-child"); 5 | var i, h, a; 6 | for (i = 0; i < hs.length; i++) { 7 | h = hs[i]; 8 | if (!/^h[1-6]$/i.test(h.tagName)) continue; // it should be a header h1-h6 9 | a = h.attributes; 10 | while (a.length > 0) h.removeAttribute(a[0].name); 11 | } 12 | }); 13 | -------------------------------------------------------------------------------- /docs/link.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 8 | 12 | 13 | -------------------------------------------------------------------------------- /docs/pkgdown.yml: -------------------------------------------------------------------------------- 1 | pandoc: 3.1.1 2 | pkgdown: 2.0.7 3 | pkgdown_sha: ~ 4 | articles: 5 | AssigmentPartitioner: AssigmentPartitioner.html 6 | Parameterized_rquery: Parameterized_rquery.html 7 | PipeableSQL: PipeableSQL.html 8 | QueryGeneration: QueryGeneration.html 9 | R_mapping: R_mapping.html 10 | rquery_intro: rquery_intro.html 11 | rquery_many_columns: rquery_many_columns.html 12 | sql_quoting: sql_quoting.html 13 | last_built: 2023-08-20T00:46Z 14 | 15 | -------------------------------------------------------------------------------- /docs/reference/Rplot001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/docs/reference/Rplot001.png -------------------------------------------------------------------------------- /docs/reference/topo_sort_tables-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/docs/reference/topo_sort_tables-1.png -------------------------------------------------------------------------------- /extras/.gitignore: -------------------------------------------------------------------------------- 1 | perf_tmp 2 | spark-warehouse 3 | -------------------------------------------------------------------------------- /extras/CollectExprs_files/figure-markdown_github/present-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/CollectExprs_files/figure-markdown_github/present-1.png -------------------------------------------------------------------------------- /extras/CollectExprs_timings.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/CollectExprs_timings.RDS -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-gfm/render1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-gfm/render1-1.png -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-gfm/sort-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-gfm/sort-1.png -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-gfm/steps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-gfm/steps-1.png -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-markdown_github/render1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-markdown_github/render1-1.png -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-markdown_github/sort-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-markdown_github/sort-1.png -------------------------------------------------------------------------------- /extras/DependencySorting_files/figure-markdown_github/steps-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/DependencySorting_files/figure-markdown_github/steps-1.png -------------------------------------------------------------------------------- /extras/GExample_files/figure-markdown_github/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/GExample_files/figure-markdown_github/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /extras/JoinController_files/figure-gfm/render1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/JoinController_files/figure-gfm/render1-1.png -------------------------------------------------------------------------------- /extras/JoinController_files/figure-gfm/run-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/JoinController_files/figure-gfm/run-1.png -------------------------------------------------------------------------------- /extras/JoinController_files/figure-markdown_github/render1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/JoinController_files/figure-markdown_github/render1-1.png -------------------------------------------------------------------------------- /extras/JoinController_files/figure-markdown_github/run-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/JoinController_files/figure-markdown_github/run-1.png -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/__packages: -------------------------------------------------------------------------------- 1 | base 2 | microbenchmark 3 | ggplot2 4 | dplyr 5 | rquery 6 | -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/cleanup_c0597503ae2319e2f0ae0a24d7a5e46c.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defdplyr_9521b68fc0e8a3d4ea093b4c752fc231.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defexp_354f59244f85ee93cb84583fb1ab1ce4.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/defrquery_e625049e2edf3a6f1d2695b60b1efe48.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/ex_076a9541a1334a582f5e6d0c60c93e28.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.RData -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.rdb -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_cache/markdown_github/time_9feb0c2fcbd3e4c5932d73ca4207e596.rdx -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_files/figure-markdown_github/present-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_files/figure-markdown_github/present-1.png -------------------------------------------------------------------------------- /extras/NarrowEffectSpark_files/figure-markdown_github/present-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffectSpark_files/figure-markdown_github/present-2.png -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/__packages: -------------------------------------------------------------------------------- 1 | base 2 | microbenchmark 3 | ggplot2 4 | dplyr 5 | rquery 6 | -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/cleanup_d9019aed674ca2d94762f4f1ffe97620.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defdplyr_310f4273c8d7fd748a734771549c25f2.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defexp_a4c7799c57b7bf4e24a089dde0bc7890.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/defrquery_619ab1cc20bfe13386b0c3de6d42e31a.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/ex_448721c35821bb143e36c7b19cf38e1e.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.RData -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.rdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.rdb -------------------------------------------------------------------------------- /extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.rdx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_cache/markdown_github/time_e3fbd9897f6344a41164684ac11debf3.rdx -------------------------------------------------------------------------------- /extras/NarrowEffect_files/figure-markdown_github/present-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_files/figure-markdown_github/present-1.png -------------------------------------------------------------------------------- /extras/NarrowEffect_files/figure-markdown_github/present-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NarrowEffect_files/figure-markdown_github/present-2.png -------------------------------------------------------------------------------- /extras/NestedJoin_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/NestedJoin_diagram.png -------------------------------------------------------------------------------- /extras/PerfTest_files/figure-markdown_github/present-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/PerfTest_files/figure-markdown_github/present-1.png -------------------------------------------------------------------------------- /extras/PerfTest_files/figure-markdown_github/present-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/PerfTest_files/figure-markdown_github/present-2.png -------------------------------------------------------------------------------- /extras/PerfTest_timings.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/PerfTest_timings.RDS -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-2.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-3.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-4.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-5.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-6.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-7.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming3_files/figure-markdown_github/timings-8.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-2.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-3.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-4.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-5.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-6.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming4_files/figure-markdown_github/timings-7.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-2.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-3.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-4.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-5.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-6.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/QTiming_files/figure-markdown_github/timings-7.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/compare_runs4_files/figure-markdown_github/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/compare_runs4_files/figure-markdown_github/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/compare_runs_files/figure-markdown_github/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/compare_runs_files/figure-markdown_github/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/compare_runs_files/figure-markdown_github/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/compare_runs_files/figure-markdown_github/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /extras/QTimingFollowup/qtimings.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/qtimings.RDS -------------------------------------------------------------------------------- /extras/QTimingFollowup/qtimings3.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/qtimings3.RDS -------------------------------------------------------------------------------- /extras/QTimingFollowup/qtimings4.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTimingFollowup/qtimings4.RDS -------------------------------------------------------------------------------- /extras/QTiming_files/figure-markdown_github/timings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/QTiming_files/figure-markdown_github/timings-1.png -------------------------------------------------------------------------------- /extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/SimpleTask_files/figure-markdown_github/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /extras/Sparkr_files/SparkRPlan.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/Sparkr_files/SparkRPlan.png -------------------------------------------------------------------------------- /extras/Sparkr_files/diagram1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/Sparkr_files/diagram1.png -------------------------------------------------------------------------------- /extras/Sparkr_files/sdf_register.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/Sparkr_files/sdf_register.png -------------------------------------------------------------------------------- /extras/all_timings.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/all_timings.RDS -------------------------------------------------------------------------------- /extras/check_reverse_dependencies.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "check_reverse_dependencies" 3 | output: github_document 4 | --- 5 | 6 | ```{r, error = TRUE} 7 | library("prrd") 8 | td <- tempdir() 9 | package = "rquery" 10 | date() 11 | packageVersion(package) 12 | 13 | parallelCluster <- NULL 14 | ncores <- parallel::detectCores() 15 | # prrd back to bombing out with database locked 16 | #if(ncores > 1) { 17 | # parallelCluster <- parallel::makeCluster(ncores) 18 | #} 19 | 20 | orig_dir <- getwd() 21 | print(orig_dir) 22 | setwd(td) 23 | print(td) 24 | 25 | options(repos = c(CRAN="https://cloud.r-project.org")) 26 | jobsdfe <- enqueueJobs(package=package, directory=td) 27 | 28 | mk_fn <- function(package, directory) { 29 | force(package) 30 | force(directory) 31 | function(i) { 32 | library("prrd") 33 | setwd(directory) 34 | Sys.sleep(1*i) 35 | dequeueJobs(package=package, directory=directory) 36 | } 37 | } 38 | f <- mk_fn(package=package, directory=td) 39 | 40 | if(!is.null(parallelCluster)) { 41 | parallel::parLapply(parallelCluster, seq_len(ncores), f) 42 | } else { 43 | f(0) 44 | } 45 | 46 | summariseQueue(package=package, directory=td) 47 | 48 | setwd(orig_dir) 49 | if(!is.null(parallelCluster)) { 50 | parallel::stopCluster(parallelCluster) 51 | } 52 | 53 | ``` 54 | 55 | -------------------------------------------------------------------------------- /extras/data_table_files/figure-markdown_github/presenttimings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_files/figure-markdown_github/presenttimings-1.png -------------------------------------------------------------------------------- /extras/data_table_files/figure-markdown_github/presenttimings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_files/figure-markdown_github/presenttimings-2.png -------------------------------------------------------------------------------- /extras/data_table_files/figure-markdown_github/printrqueryp-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_files/figure-markdown_github/printrqueryp-1.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-1.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-10.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-11.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-12.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-13.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-14.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-15.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-16.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-17.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-18.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-19.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-2.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-20.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-21.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-22.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-3.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-4.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-5.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-6.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-7.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-8.png -------------------------------------------------------------------------------- /extras/data_table_replot_files/figure-markdown_github/presenttimings-9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/data_table_replot_files/figure-markdown_github/presenttimings-9.png -------------------------------------------------------------------------------- /extras/dbplyr_show_query.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "dbply_query" 3 | author: "Win-Vector LLC" 4 | date: "3/7/2018" 5 | output: github_document 6 | --- 7 | 8 | ```{r} 9 | library("dplyr") 10 | my_db <- DBI::dbConnect(RSQLite::SQLite(), 11 | ":memory:") 12 | dLocal <- data.frame(x = c(1,2)) 13 | dRemote <- dplyr::copy_to(my_db, dLocal, "dRemote") 14 | 15 | 16 | dRemote %>% mutate(x = x + 1) %>% compute() %>% show_query() 17 | 18 | dRemote %>% mutate(x = x + 1) %>% compute() %>% dbplyr::remote_query() 19 | 20 | 21 | DBI::dbDisconnect(my_db) 22 | ``` 23 | -------------------------------------------------------------------------------- /extras/dbplyr_show_query.md: -------------------------------------------------------------------------------- 1 | dbply\_query 2 | ================ 3 | Win-Vector LLC 4 | 3/7/2018 5 | 6 | ``` r 7 | library("dplyr") 8 | ``` 9 | 10 | ## 11 | ## Attaching package: 'dplyr' 12 | 13 | ## The following objects are masked from 'package:stats': 14 | ## 15 | ## filter, lag 16 | 17 | ## The following objects are masked from 'package:base': 18 | ## 19 | ## intersect, setdiff, setequal, union 20 | 21 | ``` r 22 | my_db <- DBI::dbConnect(RSQLite::SQLite(), 23 | ":memory:") 24 | dLocal <- data.frame(x = c(1,2)) 25 | dRemote <- dplyr::copy_to(my_db, dLocal, "dRemote") 26 | 27 | 28 | dRemote %>% mutate(x = x + 1) %>% compute() %>% show_query() 29 | ``` 30 | 31 | ## 32 | ## SELECT * 33 | ## FROM `rdxkcbbsmw` 34 | 35 | ``` r 36 | dRemote %>% mutate(x = x + 1) %>% compute() %>% dbplyr::remote_query() 37 | ``` 38 | 39 | ## SELECT * 40 | ## FROM `owvzwzltiz` 41 | 42 | ``` r 43 | DBI::dbDisconnect(my_db) 44 | ``` 45 | -------------------------------------------------------------------------------- /extras/dplyr_modulo.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "dplyr modulo" 3 | output: github_document 4 | --- 5 | 6 | ```{r} 7 | library("dplyr") 8 | 9 | postgresql_connection <- DBI::dbConnect( 10 | RPostgreSQL::PostgreSQL(), 11 | host = 'localhost', 12 | port = 5432, 13 | user = 'johnmount', 14 | password = '') 15 | 16 | d <- data.frame(x = -3:3) 17 | d_db <- dplyr::copy_to(postgresql_connection, d, "d") 18 | 19 | d %>% 20 | mutate(x_mod_2 = x %%2) 21 | 22 | d_db %>% 23 | mutate(x_mod_2 = x %%2) 24 | 25 | 26 | DBI::dbDisconnect(postgresql_connection) 27 | ``` 28 | 29 | -------------------------------------------------------------------------------- /extras/dplyr_modulo.md: -------------------------------------------------------------------------------- 1 | dplyr modulo 2 | ================ 3 | 4 | ``` r 5 | library("dplyr") 6 | ``` 7 | 8 | ## 9 | ## Attaching package: 'dplyr' 10 | 11 | ## The following objects are masked from 'package:stats': 12 | ## 13 | ## filter, lag 14 | 15 | ## The following objects are masked from 'package:base': 16 | ## 17 | ## intersect, setdiff, setequal, union 18 | 19 | ``` r 20 | postgresql_connection <- DBI::dbConnect( 21 | RPostgreSQL::PostgreSQL(), 22 | host = 'localhost', 23 | port = 5432, 24 | user = 'johnmount', 25 | password = '') 26 | 27 | d <- data.frame(x = -3:3) 28 | d_db <- dplyr::copy_to(postgresql_connection, d, "d") 29 | 30 | d %>% 31 | mutate(x_mod_2 = x %%2) 32 | ``` 33 | 34 | ## x x_mod_2 35 | ## 1 -3 1 36 | ## 2 -2 0 37 | ## 3 -1 1 38 | ## 4 0 0 39 | ## 5 1 1 40 | ## 6 2 0 41 | ## 7 3 1 42 | 43 | ``` r 44 | d_db %>% 45 | mutate(x_mod_2 = x %%2) 46 | ``` 47 | 48 | ## # Source: lazy query [?? x 2] 49 | ## # Database: postgres 10.4.0 [johnmount@localhost:5432/johnmount] 50 | ## x x_mod_2 51 | ## 52 | ## 1 -3 -1 53 | ## 2 -2 0 54 | ## 3 -1 -1 55 | ## 4 0 0 56 | ## 5 1 1 57 | ## 6 2 0 58 | ## 7 3 1 59 | 60 | ``` r 61 | DBI::dbDisconnect(postgresql_connection) 62 | ``` 63 | 64 | ## [1] TRUE 65 | -------------------------------------------------------------------------------- /extras/fork.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/fork.jpg -------------------------------------------------------------------------------- /extras/parameterized_rquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/parameterized_rquery.png -------------------------------------------------------------------------------- /extras/pipeline_example.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "pipeline_example" 3 | output: github_document 4 | --- 5 | 6 | ```{r} 7 | library("dplyr") 8 | library("rqdatatable") 9 | library("microbenchmark") 10 | 11 | batting <- Lahman::Batting 12 | 13 | 14 | # dplyr pipeline example from R for Data Science. 15 | fn_dplyr <- function(batting) { 16 | # http://r4ds.had.co.nz/transform.html 17 | batting %>% 18 | group_by(playerID) %>% 19 | summarise( 20 | ba = sum(H, na.rm = TRUE) / sum(AB, na.rm = TRUE), 21 | ab = sum(AB, na.rm = TRUE) 22 | ) %>% 23 | filter(ab > 100) 24 | } 25 | 26 | system.time( 27 | batters <- fn_dplyr(batting) 28 | ) 29 | batters <- arrange(batters, playerID) 30 | 31 | # translation of above example into an rquery pipeline 32 | fn_rquery <- function(batting) { 33 | rq_pipeline <- local_td(batting) %.>% 34 | project_nse(., groupby = "playerID", 35 | ba = sum(H) / sum(AB), 36 | ab = sum(AB)) %>% 37 | select_rows_nse(., ab > 100) %>% 38 | orderby(., "playerID") 39 | ex_data_table(rq_pipeline) 40 | } 41 | 42 | system.time({ 43 | batters2 <- fn_rquery(batting) 44 | }) 45 | 46 | 47 | assertthat::are_equal(as.data.frame(batters), 48 | as.data.frame(batters2)) 49 | 50 | microbenchmark( 51 | dplyr = nrow(fn_dplyr(batting)), 52 | rquery = nrow(fn_rquery(batting)) 53 | ) 54 | ``` 55 | 56 | -------------------------------------------------------------------------------- /extras/plotbenchmark.R: -------------------------------------------------------------------------------- 1 | 2 | plotbenchmark = function(timings, colormap, title, subtitle=NULL) { 3 | timings = timings %>% 4 | mutate(microseconds = time/1e6) 5 | 6 | means = timings %>% 7 | group_by(expr) %>% 8 | summarize(mean = mean(microseconds)) 9 | 10 | ggplot(timings, aes(x = expr, y=microseconds)) + 11 | geom_violin(aes(fill=expr, color=expr)) + 12 | geom_point(data=means, aes(x=expr, y=mean), shape=3) + 13 | scale_color_manual(values=colormap) + 14 | scale_fill_manual(values=colormap) + 15 | coord_flip() + 16 | theme(legend.position="none") + 17 | xlab("Benchmark Implementation") + 18 | ylab("Duration in MS") + 19 | ggtitle(title, subtitle=subtitle) 20 | } 21 | -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-1-2.png -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github-ascii_identifiers/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-2.png -------------------------------------------------------------------------------- /extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/plotexample_files/figure-markdown_github/unnamed-chunk-1-3.png -------------------------------------------------------------------------------- /extras/qtimings.RDS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/qtimings.RDS -------------------------------------------------------------------------------- /extras/rquery_diagram.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "rquery diagram example" 3 | author: "John Mount, Win-Vector LLC" 4 | output: github_document 5 | date: "06/02/2018" 6 | always_allow_html: yes 7 | --- 8 | 9 | Example of drawing an `rquery` pipeline diagram. 10 | 11 | ```{r example} 12 | library("rquery") 13 | 14 | scale <- 0.237 15 | 16 | rquery_pipeline <- mk_td("assesment_table", 17 | qc(subjectID, surveyCategory, assessmentTotal)) %.>% 18 | extend_nse(., 19 | probability %:=% 20 | exp(assessmentTotal * scale)) %.>% 21 | normalize_cols(., 22 | "probability", 23 | partitionby = 'subjectID') %.>% 24 | pick_top_k(., 25 | partitionby = 'subjectID', 26 | orderby = c('probability', 'surveyCategory'), 27 | reverse = c('probability', 'surveyCategory')) %.>% 28 | rename_columns(., 'diagnosis' %:=% 'surveyCategory') %.>% 29 | select_columns(., c('subjectID', 30 | 'diagnosis', 31 | 'probability')) %.>% 32 | orderby(., cols = 'subjectID') 33 | 34 | # https://github.com/rich-iannone/DiagrammeR/issues/70 35 | rquery_pipeline %.>% 36 | op_diagram(.) %.>% 37 | DiagrammeR::DiagrammeR(diagram = ., type = "grViz") %.>% 38 | DiagrammeRsvg::export_svg(.) %.>% 39 | write(., file="rquery_diagram_files/diagram1.svg") 40 | ``` 41 | 42 | ![](rquery_diagram_files/diagram1.svg) 43 | -------------------------------------------------------------------------------- /extras/rquery_diagram.md: -------------------------------------------------------------------------------- 1 | rquery diagram example 2 | ================ 3 | John Mount, Win-Vector LLC 4 | 06/02/2018 5 | 6 | Example of drawing an `rquery` pipeline diagram. 7 | 8 | ``` r 9 | library("rquery") 10 | 11 | scale <- 0.237 12 | 13 | rquery_pipeline <- mk_td("assesment_table", 14 | qc(subjectID, surveyCategory, assessmentTotal)) %.>% 15 | extend_nse(., 16 | probability %:=% 17 | exp(assessmentTotal * scale)) %.>% 18 | normalize_cols(., 19 | "probability", 20 | partitionby = 'subjectID') %.>% 21 | pick_top_k(., 22 | partitionby = 'subjectID', 23 | orderby = c('probability', 'surveyCategory'), 24 | reverse = c('probability', 'surveyCategory')) %.>% 25 | rename_columns(., 'diagnosis' %:=% 'surveyCategory') %.>% 26 | select_columns(., c('subjectID', 27 | 'diagnosis', 28 | 'probability')) %.>% 29 | orderby(., cols = 'subjectID') 30 | 31 | # https://github.com/rich-iannone/DiagrammeR/issues/70 32 | rquery_pipeline %.>% 33 | op_diagram(.) %.>% 34 | DiagrammeR::DiagrammeR(diagram = ., type = "grViz") %.>% 35 | DiagrammeRsvg::export_svg(.) %.>% 36 | write(., file="rquery_diagram_files/diagram1.svg") 37 | ``` 38 | 39 | ![](rquery_diagram_files/diagram1.svg) 40 | -------------------------------------------------------------------------------- /extras/rquery_diagram_files/diagram1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/extras/rquery_diagram_files/diagram1.png -------------------------------------------------------------------------------- /extras/small_examples/rand_example.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "rand examples" 3 | output: github_document 4 | --- 5 | 6 | Example of `rand` behaving similarly on local and remote data. 7 | 8 | ```{r} 9 | library("rquery") 10 | library("wrapr") 11 | 12 | raw_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 13 | RSQLite::initExtension(raw_connection) 14 | db <- rquery_db_info( 15 | connection = raw_connection, 16 | is_dbi = TRUE, 17 | connection_options = rq_connection_tests(raw_connection)) 18 | 19 | t1l <- data.frame(a = c(1, 2), b = c(3, 4)) 20 | t1r <- rq_copy_to(db, "t1r", t1l) 21 | 22 | ops <- t1r %.>% 23 | extend(., r := rand()) 24 | 25 | cat(format(ops)) 26 | 27 | cat(to_sql(ops, db)) 28 | 29 | execute(db, ops) %.>% 30 | knitr::kable(.) 31 | ``` 32 | 33 | Note `RANDOM()` is not a safe command in `RSQLite` as it is re-calculated (and takes a new value) each place it is used. Notice `r1 does not equal `r2`. 34 | 35 | ```{r} 36 | q <- "SELECT r AS r1, r AS r2 FROM ( 37 | SELECT random() AS r FROM ( 38 | SELECT * from ( VALUES(1),(2) ) 39 | ) a 40 | ) b" 41 | DBI::dbGetQuery(raw_connection, q) %.>% 42 | knitr::kable(.) 43 | ``` 44 | 45 | ```{r} 46 | DBI::dbDisconnect(raw_connection) 47 | ``` 48 | 49 | We can run the same code on in-memory `data.frame`s using `rqdatatable`. 50 | 51 | ```{r} 52 | library("rqdatatable") 53 | 54 | t1l %.>% 55 | ops %.>% 56 | knitr::kable(.) 57 | ``` 58 | 59 | 60 | -------------------------------------------------------------------------------- /extras/small_examples/rename_join.Rmd: -------------------------------------------------------------------------------- 1 | --- 2 | title: "rename join example" 3 | output: github_document 4 | --- 5 | 6 | Example of automatic insertion of a rename node on a join. 7 | 8 | ```{r} 9 | 10 | library("rquery") 11 | library("wrapr") 12 | 13 | raw_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 14 | RSQLite::initExtension(raw_connection) 15 | db <- rquery_db_info( 16 | connection = raw_connection, 17 | is_dbi = TRUE, 18 | connection_options = rq_connection_tests(raw_connection)) 19 | 20 | t1l <- data.frame(a = c(1, 2), b = c(3, 4)) 21 | t1r <- rq_copy_to(db, "t1r", t1l) 22 | t2l <- data.frame(c = c(2, 1), d = c(6, 5)) 23 | t2r <- rq_copy_to(db, "t2r", t2l) 24 | 25 | ops <- natural_join(t1r, t2r, by = c("a" = "c")) 26 | 27 | cat(format(ops)) 28 | 29 | # cat(to_sql(ops, db)) 30 | 31 | execute(db, ops) %.>% 32 | knitr::kable(.) 33 | 34 | DBI::dbDisconnect(raw_connection) 35 | 36 | library("rqdatatable") 37 | 38 | natural_join(t1l, t2l, by = c("a" = "c")) 39 | 40 | ex_data_table(ops, 41 | tables = list("t1r" = t1l, "t2r" = t2l)) %.>% 42 | knitr::kable(.) 43 | 44 | list("t1r" = t1l, "t2r" = t2l) %.>% 45 | ops %.>% 46 | knitr::kable(.) 47 | ``` 48 | -------------------------------------------------------------------------------- /inst/tinytest/test_NULL_NA_parse.R: -------------------------------------------------------------------------------- 1 | 2 | test_NULL_NA_parse <- function() { 3 | td <- mk_td("dr", c("purchase_date", "product")) 4 | 5 | db <- rquery::rquery_default_db_info() 6 | 7 | ops <- td %.>% 8 | extend(., partitionby = "product", orderby = "purchase_date", 9 | z = LAG(purchase_date, 1, NULL)) 10 | ops_s <- format(ops) 11 | sql_s <- to_sql(ops, db) 12 | expect_equal(length(grep("NULL", ops_s, fixed = TRUE)), 1) 13 | expect_equal(length(grep("NULL", sql_s, fixed = TRUE)), 1) 14 | expect_equal(length(grep("NA", ops_s, fixed = TRUE)), 0) 15 | expect_equal(length(grep("NA", sql_s, fixed = TRUE)), 0) 16 | 17 | ops <- td %.>% 18 | extend(., partitionby = "product", orderby = "purchase_date", 19 | z = LAG(purchase_date, 1, NA)) 20 | ops_s <- format(ops) 21 | sql_s <- to_sql(ops, db) 22 | expect_equal(length(grep("NULL", ops_s, fixed = TRUE)), 0) 23 | expect_equal(length(grep("NULL", sql_s, fixed = TRUE)), 0) 24 | expect_equal(length(grep("NA", ops_s, fixed = TRUE)), 1) 25 | expect_equal(length(grep("NA", sql_s, fixed = TRUE)), 1) 26 | 27 | invisible(NULL) 28 | } 29 | 30 | test_NULL_NA_parse() 31 | 32 | -------------------------------------------------------------------------------- /inst/tinytest/test_bquote_name_escape.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_bquote_name_escape <- function() { 4 | a = 'a_name' 5 | b = 'b_name' 6 | # wrong form b is character not name 7 | ops <- mk_td('d', c('a_name', 'b_name')) %.>% extend(., .(a) := .(b)) 8 | str <- format(ops) 9 | expect_equal(length(grep(':= "b_name"', str, fixed = TRUE)), 1) 10 | expect_equal(length(grep(':= b_name', str, fixed = TRUE)), 0) 11 | # correct form b is a name 12 | ops <- mk_td('d', c('a_name', 'b_name')) %.>% extend(., .(-a) := .(-b)) 13 | str <- format(ops) 14 | expect_equal(length(grep(':= "b_name"', str, fixed = TRUE)), 0) 15 | expect_equal(length(grep(':= b_name', str, fixed = TRUE)), 1) 16 | # math 17 | ops <- mk_td('d', c('a_name', 'b_name')) %.>% extend(., .(-a) := .(-3-5)) 18 | str <- format(ops) 19 | expect_equal(length(grep('-8', str, fixed = TRUE)), 1) 20 | invisible(NULL) 21 | } 22 | 23 | test_bquote_name_escape() 24 | -------------------------------------------------------------------------------- /inst/tinytest/test_calc_warnings.R: -------------------------------------------------------------------------------- 1 | 2 | test_calc_warnings <- function() { 3 | 4 | d <- data.frame( 5 | x = 1:3, 6 | y = 4:6 7 | ) 8 | 9 | # # not warning here any more, as if_else uses this construction 10 | # saw_w <- NULL 11 | # tryCatch({ 12 | # ops <- local_td(d) %.>% 13 | # extend(., 14 | # x := 1, 15 | # x := 2) 16 | # }, 17 | # warning = function(w) { saw_w <<- w } 18 | # ) 19 | # expect_true(!is.null(saw_w)) 20 | 21 | expect_error({ 22 | ops <- local_td(d) %.>% 23 | project(., 24 | x := 1, 25 | x := 2) 26 | }) 27 | 28 | expect_error({ 29 | ops <- local_td(d) %.>% 30 | project(., 31 | x := 1, 32 | y := x) 33 | }) 34 | 35 | invisible(NULL) 36 | } 37 | 38 | test_calc_warnings() 39 | 40 | -------------------------------------------------------------------------------- /inst/tinytest/test_col_map_msg.R: -------------------------------------------------------------------------------- 1 | 2 | test_col_map_msg <- function() { 3 | if(requireNamespace('rqdatatable', quietly = TRUE)) { 4 | library("rqdatatable") 5 | d <- data.frame(x = c('a', 'b', 'b'), 6 | stringsAsFactors = FALSE) 7 | mp <- c(a = 1, b = 2) 8 | y <- 2 9 | v <- TRUE 10 | n <- NA 11 | d %.>% extend(., 12 | xv = y) 13 | d %.>% 14 | extend(., 15 | xv = 7) 16 | d %.>% 17 | extend(., 18 | xv = TRUE) 19 | d %.>% 20 | extend(., 21 | xv = v) 22 | d %.>% 23 | extend(., 24 | xv = n) 25 | # # would like this to error-out but 26 | # # have to leave it as a free-symbol due to 27 | # # issue mentioned in tokenize_for_sql 28 | expect_error({ 29 | d %.>% 30 | extend(., 31 | xv = mp[x])}) 32 | } 33 | invisible(NULL) 34 | } 35 | 36 | test_col_map_msg() 37 | 38 | -------------------------------------------------------------------------------- /inst/tinytest/test_col_name_map.R: -------------------------------------------------------------------------------- 1 | 2 | test_col_name_map <- function() { 3 | cmap <- rquery:::build_col_name_map(c("key", "id", "info", "key_group"), 4 | c("key", "data", "key_group"), 5 | c("_a", "_b")) 6 | expect_equal(sort(names(cmap)), c("a", "b")) 7 | 8 | invisible(NULL) 9 | } 10 | 11 | test_col_name_map() 12 | -------------------------------------------------------------------------------- /inst/tinytest/test_compare.R: -------------------------------------------------------------------------------- 1 | 2 | test_compare <- function() { 3 | ops <- mk_td("d", "id") %.>% 4 | extend(., 5 | is_one %:=% id == 1, 6 | is_not_one %:=% id != 1) 7 | sql <- to_sql(ops, rquery::rquery_default_db_info()) 8 | # data.frame(id=c(1,2)) %.>% ops 9 | # # id is_one is_not_one 10 | # # 1: 1 TRUE FALSE 11 | # # 2: 2 FALSE TRUE 12 | invisible(NULL) 13 | } 14 | 15 | test_compare() 16 | -------------------------------------------------------------------------------- /inst/tinytest/test_concat.R: -------------------------------------------------------------------------------- 1 | 2 | test_concat <- function() { 3 | 4 | d <- data.frame(x = 1) 5 | p1 <- local_td(d) %.>% extend(., x = x + 1) 6 | p2 <- local_td(d) %.>% extend(., x = x + 2) 7 | ops <- p1 %.>% p2 8 | 9 | 10 | d1 <- data.frame(x = 1) 11 | d2 <- data.frame(y = 1) 12 | p1 <- local_td(d1) %.>% extend(., x = x + 1) 13 | p2 <- local_td(d2) %.>% extend(., y = y + 2) 14 | expect_error({ 15 | # expect an exception here 16 | ops <- p1 %.>% p2 17 | }) 18 | 19 | invisible(NULL) 20 | } 21 | 22 | test_concat() 23 | -------------------------------------------------------------------------------- /inst/tinytest/test_distinct.R: -------------------------------------------------------------------------------- 1 | 2 | test_distinct <- function() { 3 | 4 | table_rep <- mk_td("test_table", c("a", "b", "c", "d")) 5 | ops <- project(table_rep, groupby = c("a", "b", "c")) 6 | sql <- to_sql(ops, rquery::rquery_default_db_info()) 7 | 8 | invisible(NULL) 9 | } 10 | 11 | test_distinct() 12 | -------------------------------------------------------------------------------- /inst/tinytest/test_drop_columns.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_relop_drop_columns <- function() { 4 | dL <- data.frame(x = 1, y = 2, z = 3) 5 | rquery_pipeline <- local_td(dL) %.>% 6 | drop_columns(., "y") 7 | cols <- column_names(rquery_pipeline) 8 | expect_equal(c("x", "z"), sort(column_names(rquery_pipeline))) 9 | 10 | invisible(NULL) 11 | } 12 | 13 | test_relop_drop_columns() 14 | 15 | test_relop_drop_columns_not_strict <- function() { 16 | rquery_pipeline <- mk_td(table_name = 'd', columns = c('x', 'q')) %.>% 17 | drop_columns(., c('q', 'z')) 18 | if(requireNamespace('rqdatatable', quietly = TRUE)) { 19 | res <- data.frame(x=1, y=2, q=3, z=4) %.>% rquery_pipeline 20 | expect_equal(c("x"), sort(colnames(res))) 21 | res <- data.frame(x=1, y=2) %.>% rquery_pipeline 22 | expect_equal(c("x"), sort(colnames(res))) 23 | } 24 | 25 | invisible(NULL) 26 | } 27 | 28 | test_relop_drop_columns_not_strict() 29 | 30 | -------------------------------------------------------------------------------- /inst/tinytest/test_extend_shrink.R: -------------------------------------------------------------------------------- 1 | 2 | test_extend_shrink <- function() { 3 | d <- data.frame(x = c(1, 2, 3)) 4 | 5 | ops1 <- local_td(d) %.>% 6 | extend(., y = 1) %.>% 7 | extend(., z = 2) 8 | 9 | expect_true("relop_table_source" %in% class(ops1$source[[1]])) 10 | 11 | ops2 <- local_td(d) %.>% 12 | extend(., y = 1) %.>% 13 | extend(., y = 2) 14 | 15 | expect_true("relop_table_source" %in% class(ops2$source[[1]])) 16 | 17 | ops3 <- local_td(d) %.>% 18 | extend(., y = 1) %.>% 19 | extend(., y = y + 1) 20 | 21 | expect_true("relop_extend" %in% class(ops3$source[[1]])) 22 | 23 | invisible(NULL) 24 | } 25 | 26 | test_extend_shrink() 27 | 28 | -------------------------------------------------------------------------------- /inst/tinytest/test_grouped_running_op.R: -------------------------------------------------------------------------------- 1 | 2 | test_grouped_running_op <- function() { 3 | 4 | if (requireNamespace("RSQLite", quietly = TRUE) && 5 | requireNamespace("DBI", quietly = TRUE)) { 6 | raw_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 7 | dbopts <- rq_connection_tests(raw_connection) 8 | db_handle <- rquery_db_info(connection = raw_connection, 9 | is_dbi = TRUE, 10 | connection_options = dbopts) 11 | 12 | data <- rq_copy_to( 13 | db_handle, "data", 14 | wrapr::build_frame( 15 | "x", "y" | 16 | 1 , 1 | 17 | 0 , 0 | 18 | 1 , 0 | 19 | 0 , 1 | 20 | 0 , 0 | 21 | 1 , 1 )) 22 | 23 | ops1 <- extend(data, 24 | running_y_sum = cumsum(y), 25 | partitionby = "x", 26 | orderby = "y", 27 | reverse = "y") 28 | sql1 <- to_sql(ops1, db_handle) 29 | # res1 <- execute(db_handle, ops1) # can't run on SQLite 30 | 31 | ops2 <- extend(data, 32 | running_y_sum = cumsum(y), 33 | partitionby = "x", 34 | orderby = "y", 35 | reverse = c("y")) 36 | sql2 <- to_sql(ops2, db_handle) 37 | 38 | DBI::dbDisconnect(raw_connection) 39 | 40 | str1 <- gsub("tsql_[0-9_]*", "tsq*", sql1) 41 | str2 <- gsub("tsql_[0-9_]*", "tsq*", sql2) 42 | expect_equal(str1, str2) 43 | } 44 | 45 | invisible(NULL) 46 | } 47 | 48 | test_grouped_running_op() 49 | 50 | -------------------------------------------------------------------------------- /inst/tinytest/test_if_else.R: -------------------------------------------------------------------------------- 1 | 2 | test_if_else <- function() { 3 | 4 | d <- mk_td("d", 5 | c("a_1", "a_2", "a_3" )) 6 | dQ <- d %.>% 7 | extend_se(., "a_4" %:=% "ifelse(! a_1, a_2, a_3)") 8 | txt <- format(dQ) 9 | expect_true(length(grep("!", txt, fixed = TRUE))>0) 10 | 11 | 12 | 13 | if (requireNamespace("RSQLite", quietly = TRUE) && 14 | requireNamespace("DBI", quietly = TRUE)) { 15 | my_db <- DBI::dbConnect(RSQLite::SQLite(), 16 | ":memory:") 17 | 18 | d <- data.frame(id = 1:3, x = c(0, 1, NA)) 19 | # ifelse(d$x == 1, 'one', 'not one') 20 | 21 | d_remote <- rq_copy_to(my_db, "d_remote", d) 22 | 23 | optree <- d_remote %.>% 24 | extend(., 25 | res = ifelse(x == 1, 'one', 'not one')) %.>% 26 | orderby(., "id") 27 | 28 | res <- execute(my_db, optree) 29 | 30 | expect <- build_frame( 31 | "id", "x", "res" | 32 | 1L , 0 , "not one" | 33 | 2L , 1 , "one" | 34 | 3L , NA , NA ) 35 | 36 | expect_equal(expect, res) 37 | 38 | 39 | 40 | DBI::dbDisconnect(my_db) 41 | } 42 | 43 | invisible(NULL) 44 | } 45 | 46 | test_if_else() 47 | -------------------------------------------------------------------------------- /inst/tinytest/test_immediate_subsitution.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_immediate_substitution <- function() { 4 | if(requireNamespace('rqdatatable', quietly = TRUE)) { 5 | library("rqdatatable") 6 | d <- data.frame( 7 | x = c(1, 1, 2), 8 | y = c(5, 4, 3), 9 | z = c(6, 7, 8) 10 | ) 11 | 12 | condition_variable <- as.name('x') 13 | new_value_variable <- as.name('y') 14 | old_value_variable <- as.name('z') 15 | 16 | res <- d %.>% 17 | select_rows(., 18 | .(condition_variable) == 1) %.>% 19 | extend(., 20 | .(new_value_variable) := .(old_value_variable) + 1) %.>% 21 | order_rows(., 22 | c('x', 'y', 'z')) 23 | 24 | expect <- wrapr::build_frame( 25 | "x" , "y", "z" | 26 | 1 , 7 , 6 | 27 | 1 , 8 , 7 ) 28 | 29 | expect_true(wrapr::check_equiv_frames(res, expect)) 30 | } 31 | invisible(NULL) 32 | } 33 | 34 | test_immediate_substitution() 35 | 36 | -------------------------------------------------------------------------------- /inst/tinytest/test_lhs_eval.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_lhs_eval_ad_hoc <- function() { 4 | # without the .() notation (not quiet what we want from the user) 5 | d <- data.frame(x = 1) 6 | ops <- local_td(d) 7 | for(i in 1:3) { 8 | ops <- extend(ops, paste0("v_", i) %:=% (i+1)) 9 | } 10 | 11 | invisible(NULL) 12 | } 13 | 14 | test_lhs_eval_ad_hoc() 15 | 16 | test_lhs_eval_b <- function() { 17 | # with the .() notation (the strict form) 18 | d <- data.frame(x = 1) 19 | ops <- local_td(d) 20 | for(i in 1:3) { 21 | ops <- extend(ops, .(paste0("v_", i)) %:=% (i+1)) 22 | } 23 | 24 | invisible(NULL) 25 | } 26 | 27 | test_lhs_eval_b() 28 | 29 | 30 | test_lhs_eval_b2 <- function() { 31 | # with the .() notation (the strict form) 32 | d <- data.frame(x = 1) 33 | ops <- local_td(d) 34 | for(i in 1:3) { 35 | v_i <- paste0("v_", i) 36 | ops <- extend(ops, .(v_i) %:=% (i+1)) 37 | } 38 | 39 | invisible(NULL) 40 | } 41 | 42 | test_lhs_eval_b2() 43 | 44 | 45 | test_lhs_eval_b2b <- function() { 46 | # with the .() notation (the strict form) 47 | d <- data.frame(x = 1) 48 | var <- 'y' 49 | # should be var 50 | ops1 <- local_td(d) %.>% 51 | extend(., var := 1) 52 | expect_true(length(grep('y', format(ops1)))==0) 53 | expect_true(length(grep('var', format(ops1)))==1) 54 | # should be y 55 | ops2 <- local_td(d) %.>% 56 | extend(., .(var) := 1) 57 | expect_true(length(grep('var', format(ops2)))==0) 58 | expect_true(length(grep('y', format(ops2)))==1) 59 | invisible(NULL) 60 | } 61 | 62 | test_lhs_eval_b2b() 63 | 64 | -------------------------------------------------------------------------------- /inst/tinytest/test_materialize_node.R: -------------------------------------------------------------------------------- 1 | 2 | test_materialize <- function() { 3 | if (requireNamespace("RSQLite", quietly = TRUE) && 4 | requireNamespace("DBI", quietly = TRUE)) { 5 | raw_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 6 | dbopts <- rq_connection_tests(raw_connection) 7 | db_handle <- rquery_db_info(connection = raw_connection, 8 | is_dbi = TRUE, 9 | connection_options = dbopts) 10 | 11 | d <- rq_copy_to(db_handle, "data", data.frame(x_col = 1, y_col = 2, z_col = 3), 12 | temporary = TRUE, overwrite = TRUE) 13 | 14 | p1 <- d %.>% 15 | materialize_node(., "tmp1") 16 | p2 <- d %.>% 17 | materialize_node(., "tmp2") %.>% 18 | select_columns(., columns =c("x_col", "y_col")) 19 | sql1 <- to_sql(p1, db_handle) 20 | expect_equal(1, length(grep("z_col", sql1[[1]], fixed = TRUE))) 21 | expect_equal(1, length(grep("z_col", sql1[[3]], fixed = TRUE))) 22 | sql2 <- to_sql(p2, db_handle) 23 | expect_equal(0, length(grep("z_col", sql2[[1]], fixed = TRUE))) 24 | expect_equal(0, length(grep("z_col", sql2[[3]], fixed = TRUE))) 25 | l1 <- execute(db_handle, p1) 26 | expect_equal(3, length(column_names(l1))) 27 | l2 <- execute(db_handle, p2) 28 | expect_equal(2, length(column_names(l2))) 29 | 30 | DBI::dbDisconnect(raw_connection) 31 | } 32 | 33 | invisible(NULL) 34 | } 35 | 36 | test_materialize() 37 | -------------------------------------------------------------------------------- /inst/tinytest/test_multi_arg_fn.R: -------------------------------------------------------------------------------- 1 | 2 | test_multi_arg_fn <- function() { 3 | # at the very least hard to pass named arguments to SQL 4 | # so we are blocking it for now. 5 | expect_error( 6 | ops <- mk_td('d', 'str') %.>% 7 | extend(., strs = paste(str, collapse = ', '))) 8 | 9 | invisible(NULL) 10 | } 11 | 12 | test_multi_arg_fn() 13 | -------------------------------------------------------------------------------- /inst/tinytest/test_parse_issue.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_parse_issue <- function() { 4 | badex <- wrapr::build_frame( 5 | 'name' , 'expr' | 6 | 'Var228_lev_x.F2FyR07IdsN7I', 'ifelse(is.na(Var228), 0, ifelse(Var228 == "F2FyR07IdsN7I", 1, 0))' ) 7 | expr <- badex$expr 8 | names(expr) <- badex$name 9 | dat <- mk_td("tab", paste0("Var228")) 10 | op <- extend_se(dat, expr) 11 | str <- format(op) # notice some lines have more than 1 := ! 12 | parts <- strsplit(str, ":=", fixed = TRUE) 13 | expect_equal(length(parts[[1]]), 2) 14 | 15 | invisible(NULL) 16 | } 17 | 18 | test_parse_issue() 19 | -------------------------------------------------------------------------------- /inst/tinytest/test_partial_fn_parse.R: -------------------------------------------------------------------------------- 1 | 2 | test_partial_fn_parse <- function() { 3 | d <- data.frame(x = c(1, NA), g = c(1, 1)) 4 | 5 | expect_error( 6 | d %.>% 7 | project(., 8 | x = mean(x, na.rm = TRUE), 9 | groupby = c()) 10 | ) 11 | 12 | mean2 <- function(x) (mean(x, na.rm = TRUE)) 13 | 14 | ops <- local_td(d) %.>% 15 | project(., 16 | x = mean2(x), 17 | groupby = c()) 18 | sql <- to_sql(ops, rquery_default_db_info()) 19 | # cat(format(sql)) 20 | 21 | # variation on 22 | # http://www.win-vector.com/blog/2018/08/collecting-expressions-in-r/ 23 | d <- data.frame(AUC = 0.6, R2 = 0.2) 24 | exprs <- list() 25 | exprs <- c(exprs, "v" %:=% "AUC + R2") 26 | exprs <- c(exprs, "x" %:=% "pmax(AUC,v)") 27 | ops <- extend_se(local_td(d), exprs) 28 | # cat(format(ops)) 29 | sql <- to_sql(ops, rquery_default_db_info()) 30 | # cat(format(sql)) 31 | 32 | invisible(NULL) 33 | } 34 | 35 | test_partial_fn_parse() 36 | -------------------------------------------------------------------------------- /inst/tinytest/test_pow.R: -------------------------------------------------------------------------------- 1 | 2 | test_pow <- function() { 3 | my_db <- rquery_default_db_info() 4 | 5 | td <- mk_td("data", "x") 6 | ops <- extend(td, xsq = x^2) 7 | sql <- to_sql(ops, my_db) 8 | #cat(sql) 9 | expect_equal(1, grep("POWER", sql, fixed = TRUE)) 10 | 11 | if (requireNamespace("RSQLite", quietly = TRUE) && 12 | requireNamespace("DBI", quietly = TRUE)) { 13 | raw_connection <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 14 | dbopts <- rq_connection_tests(raw_connection) 15 | db_handle <- rquery_db_info(connection = raw_connection, 16 | is_dbi = TRUE, 17 | connection_options = dbopts) 18 | 19 | td2 <- rq_copy_to(db_handle, "data", data.frame(x = 2), 20 | temporary = TRUE, overwrite = TRUE) 21 | res <- DBI::dbGetQuery(raw_connection, sql) 22 | DBI::dbDisconnect(raw_connection) 23 | expect_equal(data.frame(x = 2, xsq = 4), data.frame(res)) 24 | } 25 | 26 | invisible(NULL) 27 | } 28 | 29 | test_pow() 30 | 31 | -------------------------------------------------------------------------------- /inst/tinytest/test_project_empty.R: -------------------------------------------------------------------------------- 1 | 2 | # https://github.com/WinVector/pyvtreat/blob/master/Examples/StratifiedCrossPlan/StratifiedCrossPlan.ipynb 3 | 4 | test_project_empty <- function() { 5 | 6 | prepared_stratified <- data.frame( 7 | 'y' = c(1, 0, 0, 1, 0, 0), 8 | 'g' = c(0, 0, 0, 1, 1, 1), 9 | 'x' = c(1, 2, 3, 4, 5, 6) 10 | ) 11 | 12 | ops <- local_td(prepared_stratified) %.>% 13 | project(., 14 | sum %:=% sum(y), 15 | mean %:=% mean(y), 16 | size %:=% n(), 17 | groupby='g') 18 | 19 | opsb <- local_td(prepared_stratified) %.>% 20 | project(., 21 | groupby='g', 22 | sum %:=% sum(y), 23 | mean %:=% mean(y), 24 | size %:=% n()) 25 | 26 | expect_equal(format(ops), format(opsb)) 27 | 28 | # used to throw 29 | ops2 <- local_td(prepared_stratified) %.>% 30 | project(., 31 | sum %:=% sum(y), 32 | mean %:=% mean(y), 33 | size %:=% n()) 34 | 35 | ops3 <- local_td(prepared_stratified) %.>% 36 | project(., 37 | groupby=c(), 38 | sum %:=% sum(y), 39 | mean %:=% mean(y), 40 | size %:=% n()) 41 | 42 | expect_equal(format(ops2), format(ops3)) 43 | 44 | invisible(NULL) 45 | } 46 | 47 | test_project_empty() 48 | -------------------------------------------------------------------------------- /inst/tinytest/test_project_narrowing.R: -------------------------------------------------------------------------------- 1 | 2 | test_project_narrowing <- function() { 3 | db <- rquery_db_info(identifier_quote_char = "`", string_quote_char = '"') 4 | d <- data.frame(group = c('a', 'a', 'b', 'b'), 5 | val = 1:4, 6 | stringsAsFactors = FALSE) 7 | 8 | op_tree <- local_td(d) %.>% 9 | project_se(., groupby = "group", "vmax" %:=% "max(val)") 10 | txt <- format(op_tree) 11 | txt <- to_sql(op_tree, db) 12 | expect_equal(sort(column_names(op_tree)), c("group", "vmax")) 13 | 14 | op_tree <- local_td(d) %.>% 15 | project_se(., groupby = "group", "vmax" %:=% "max(val)") %.>% 16 | select_columns(., "group") 17 | txt <- format(op_tree) 18 | txt <- to_sql(op_tree, db) 19 | expect_equal(sort(column_names(op_tree)), c("group")) 20 | 21 | op_tree <- local_td(d) %.>% 22 | project_se(., groupby = "group", "vmax" %:=% "max(val)") %.>% 23 | select_columns(., "vmax") 24 | txt <- format(op_tree) 25 | txt <- to_sql(op_tree, db) 26 | expect_equal(sort(column_names(op_tree)), c("vmax")) 27 | 28 | invisible(NULL) 29 | } 30 | 31 | test_project_narrowing() 32 | 33 | -------------------------------------------------------------------------------- /inst/tinytest/test_q.R: -------------------------------------------------------------------------------- 1 | 2 | test_q <- function() { 3 | my_db <- rquery_default_db_info() 4 | 5 | d <- table_source("d", c("AUC", "R2")) 6 | v <- "NEWVAR" 7 | AUC <- "NEWVAR" 8 | R2 <- "NEWVAR" 9 | optree <- extend(d, v %:=% R2 + 1) 10 | str <- format(optree) 11 | expect_equal(0, length(grep("NEWVAR", str, fixed = TRUE))) 12 | sql <- to_sql(optree, my_db) 13 | expect_equal(0, length(grep("NEWVAR", sql, fixed = TRUE))) 14 | 15 | d <- table_source("d", c("AUC", "R2", "z")) 16 | TARGETCOL = as.name("AUC") 17 | VALUE = 0.5 18 | optree <- select_rows(d, .(TARGETCOL) >= VALUE) 19 | str <- format(optree) 20 | expect_true(length(grep("TARGETCOL", str, fixed = TRUE))==0, "saw TARGETCOL") 21 | expect_true(length(grep("VALUE", str, fixed = TRUE))==0, "saw VALUE") 22 | sql <- to_sql(optree, my_db) 23 | expect_true(length(grep("TARGETCOL", sql, fixed = TRUE))==0, "saw TARGETCOL") 24 | expect_true(length(grep("VALUE", sql, fixed = TRUE))==0, "saw VALUE") 25 | 26 | invisible(NULL) 27 | } 28 | 29 | test_q() 30 | 31 | -------------------------------------------------------------------------------- /inst/tinytest/test_rename_columns.R: -------------------------------------------------------------------------------- 1 | 2 | test_rename <- function() { 3 | 4 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 5 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 6 | d <- rq_copy_to(my_db, 'd', 7 | data.frame(AUC = 0.6, R2 = 0.2, z = 3)) 8 | op_tree <- rename_columns(d, c('R2' %:=% 'AUC', 'AUC' %:=% 'R2')) 9 | #cat(format(op_tree)) 10 | sql <- to_sql(op_tree, my_db) 11 | #cat(sql) 12 | res <- execute(my_db, op_tree) 13 | DBI::dbDisconnect(my_db) 14 | expect <- wrapr::build_frame( 15 | "R2" , "AUC", "z" | 16 | 0.6 , 0.2 , 3 ) 17 | expect_true(wrapr::check_equiv_frames(expect, res)) 18 | } 19 | 20 | 21 | invisible(NULL) 22 | } 23 | 24 | test_rename() 25 | 26 | -------------------------------------------------------------------------------- /inst/tinytest/test_select_cols_reorder.R: -------------------------------------------------------------------------------- 1 | 2 | test_multi_arg_fn <- function() { 3 | ops <- mk_td('d', c('a', 'b')) %.>% 4 | select_columns(., c('b', 'a')) 5 | expect_true(!("relop_table_source" %in% class(ops))) 6 | expect_true("relop_select_columns" %in% class(ops)) 7 | 8 | ops <- mk_td('d', c('a', 'b')) %.>% 9 | select_columns(., c('a', 'b')) 10 | expect_true("relop_table_source" %in% class(ops)) 11 | expect_true(!("relop_select_columns" %in% class(ops))) 12 | 13 | invisible(NULL) 14 | } 15 | 16 | test_multi_arg_fn() 17 | -------------------------------------------------------------------------------- /inst/tinytest/test_select_narrowing.R: -------------------------------------------------------------------------------- 1 | 2 | test_select_narrowing <- function() { 3 | db <- rquery_db_info(identifier_quote_char = "`", string_quote_char = '"') 4 | x <- data.frame(a = 1:3, b = 4:6, c = 7:9) 5 | 6 | op1 <- local_td(x) %.>% extend(., e %:=% a + 1) 7 | # cat(to_sql(op1, db)) 8 | expect_equal(sort(column_names(op1)), c("a", "b", "c", "e")) 9 | 10 | op2 <- op1 %.>% select_columns(., "e") 11 | # cat(to_sql(op2, db)) 12 | expect_equal(sort(column_names(op2)), c("e")) 13 | 14 | op3 <- op1 %.>% select_columns(., "b") 15 | # cat(to_sql(op3, db)) 16 | expect_equal(sort(column_names(op3)), c("b")) 17 | 18 | op4 <- local_td(x) %.>% extend(., a %:=% a + 1) 19 | # cat(to_sql(op4, db)) 20 | expect_equal(sort(column_names(op4)), c("a", "b", "c")) 21 | 22 | op5 <- op4 %.>% select_columns(., "a") 23 | # cat(to_sql(op5, db)) 24 | expect_equal(sort(column_names(op5)), c("a")) 25 | 26 | op6 <- op4 %.>% select_columns(., "b") 27 | # cat(to_sql(op6, db)) 28 | expect_equal(sort(column_names(op6)), c("b")) 29 | 30 | op7 <- op4 %.>% select_columns(., c("a", "b")) 31 | # cat(to_sql(op7, db)) 32 | expect_equal(sort(column_names(op7)), c("a", "b")) 33 | 34 | invisible(NULL) 35 | } 36 | 37 | test_select_narrowing() 38 | 39 | -------------------------------------------------------------------------------- /inst/tinytest/test_select_stacking.R: -------------------------------------------------------------------------------- 1 | test_select_stacking <- function() { 2 | 3 | ops1 <- table_source('d', c('a', 'b', 'c')) %.>% select_columns(., c('a', 'b')) %.>% select_columns(., c('b')) 4 | ops1_str <- format(ops1) 5 | expect_equal(length(gregexpr('select_columns', ops1_str, fixed = TRUE)[[1]]), 1) 6 | 7 | ops2 <- table_source('d', c('a', 'b', 'c')) %.>% select_columns(., c('a', 'b')) %.>% select_columns(., c('b', 'a')) 8 | ops2_str <- format(ops2) 9 | expect_equal(length(gregexpr('select_columns', ops2_str, fixed = TRUE)[[1]]), 1) 10 | 11 | invisible(NULL) 12 | } 13 | 14 | test_select_stacking() 15 | -------------------------------------------------------------------------------- /inst/tinytest/test_self_join.R: -------------------------------------------------------------------------------- 1 | 2 | test_self_join <- function() { 3 | dA <- mk_td("dA", c("x", "y")) 4 | dB <- mk_td("dB", c("x", "y")) 5 | expect_equal(c("x", "y"), column_names(dA)) 6 | expect_equal(c("x", "y"), colnames(dA)) 7 | d1 <- natural_join(dA, dA, by = "x", jointype = "LEFT") 8 | expect_equal(2, length(column_names(d1))) 9 | d2 <- natural_join(dA, dB, by = "x", jointype = "LEFT") 10 | expect_equal(2, length(column_names(d2))) 11 | 12 | invisible(NULL) 13 | } 14 | 15 | test_self_join() 16 | -------------------------------------------------------------------------------- /inst/tinytest/test_set_indicator.R: -------------------------------------------------------------------------------- 1 | 2 | test_set_indicator <- function() { 3 | 4 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 5 | my_db <- DBI::dbConnect(RSQLite::SQLite(), 6 | ":memory:") 7 | 8 | d <- rq_copy_to(my_db, 'd', 9 | data.frame( 10 | id = 1:4, 11 | a = c("1", "2", "1", "3"), 12 | b = c("1", "1", "3", "2"), 13 | q = 1, 14 | stringsAsFactors = FALSE), 15 | temporary = TRUE, 16 | overwrite = TRUE) 17 | # example 18 | set <- c("1", "2") 19 | 20 | expect_error({ 21 | # expect an exception here 22 | op_tree <- d %.>% 23 | set_indicator(., "one_two", "a", set) %.>% 24 | set_indicator(., "z", "a", c()) %.>% 25 | select_rows(., q %in% c(1)) %.>% 26 | orderby(., "id") 27 | }) 28 | 29 | op_tree <- d %.>% 30 | set_indicator(., "one_two", "a", set) %.>% 31 | set_indicator(., "z", "a", c()) %.>% 32 | select_rows(., q == 1) %.>% 33 | orderby(., "id") 34 | res = execute(my_db, op_tree) 35 | expect_equal(c(1,1,1,0), res$one_two) 36 | 37 | # cleanup 38 | DBI::dbDisconnect(my_db) 39 | } 40 | 41 | invisible(NULL) 42 | } 43 | 44 | test_set_indicator() 45 | -------------------------------------------------------------------------------- /inst/tinytest/test_w_select_rows.R: -------------------------------------------------------------------------------- 1 | 2 | test_w_select_rows <- function() { 3 | 4 | d <- data.frame(x = 1:3, y = 4:6) 5 | 6 | ops <- wrap(d) %.>% 7 | select_rows(., x>2) 8 | if(requireNamespace('rqdatatable', quietly = TRUE)) { 9 | res <- ex(ops) 10 | 11 | expect <- wrapr::build_frame( 12 | "x" , "y" | 13 | 3L , 6L ) 14 | 15 | expect_true(wrapr::check_equiv_frames(res, expect)) 16 | } 17 | 18 | invisible(NULL) 19 | } 20 | 21 | test_w_select_rows() 22 | -------------------------------------------------------------------------------- /inst/tinytest/test_wrap_vbind.R: -------------------------------------------------------------------------------- 1 | 2 | 3 | test_arrow_vbind <- function() { 4 | d <- data.frame( 5 | x = c(1, 2, 3, 4, 5, 6), 6 | y = c(2, 2, 2, 3, 7, 10), 7 | g = c('a', 'a', 'a', 'b', 'b' ,'b'), 8 | stringsAsFactors = FALSE 9 | ) 10 | 11 | scale <- 5 12 | 13 | ops <- d %.>% 14 | wrap %.>% # wrap data in a description 15 | extend(., # add a new column 16 | ratio := scale * y / x) %.>% 17 | extend(., # rank the rows by group and order 18 | simple_rank := row_number(), 19 | partitionby = 'g', 20 | orderby = 'ratio', 21 | reverse = 'ratio') %.>% 22 | extend(., # mark the rows we want 23 | choice := simple_rank == 1) 24 | 25 | str <- format(ops) 26 | expect_true(length(grep('scale', str, fixed = TRUE))==0) 27 | expect_true(length(grep('t', str, fixed = TRUE))==1) 28 | if(requireNamespace('rqdatatable', quietly = TRUE)) { 29 | res <- ex(ops) 30 | expect_true(is.data.frame(res)) 31 | } 32 | 33 | invisible(NULL) 34 | } 35 | 36 | test_arrow_vbind() 37 | 38 | -------------------------------------------------------------------------------- /man/apply_right_S4-ANY-rquery_db_info-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ex_data_frame.R 3 | \name{apply_right_S4,ANY,rquery_db_info-method} 4 | \alias{apply_right_S4,ANY,rquery_db_info-method} 5 | \title{Apply pipeline to a database.} 6 | \usage{ 7 | \S4method{apply_right_S4}{ANY,rquery_db_info}( 8 | pipe_left_arg, 9 | pipe_right_arg, 10 | pipe_environment, 11 | left_arg_name, 12 | pipe_string, 13 | right_arg_name 14 | ) 15 | } 16 | \arguments{ 17 | \item{pipe_left_arg}{relop operation tree} 18 | 19 | \item{pipe_right_arg}{rquery_db_info} 20 | 21 | \item{pipe_environment}{environment to evaluate in.} 22 | 23 | \item{left_arg_name}{name, if not NULL name of left argument.} 24 | 25 | \item{pipe_string}{character, name of pipe operator.} 26 | 27 | \item{right_arg_name}{name, if not NULL name of right argument.} 28 | } 29 | \value{ 30 | result 31 | } 32 | \description{ 33 | Apply pipeline to a database with relop %.>% db notation. 34 | } 35 | -------------------------------------------------------------------------------- /man/apply_right_S4-data.frame-relop_arrow-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arrow.R 3 | \name{apply_right_S4,data.frame,relop_arrow-method} 4 | \alias{apply_right_S4,data.frame,relop_arrow-method} 5 | \title{S4 dispatch method for apply_right.} 6 | \usage{ 7 | \S4method{apply_right_S4}{data.frame,relop_arrow}( 8 | pipe_left_arg, 9 | pipe_right_arg, 10 | pipe_environment, 11 | left_arg_name, 12 | pipe_string, 13 | right_arg_name 14 | ) 15 | } 16 | \arguments{ 17 | \item{pipe_left_arg}{left argument} 18 | 19 | \item{pipe_right_arg}{pipe_right_arg argument} 20 | 21 | \item{pipe_environment}{environment to evaluate in} 22 | 23 | \item{left_arg_name}{name, if not NULL name of left argument.} 24 | 25 | \item{pipe_string}{character, name of pipe operator.} 26 | 27 | \item{right_arg_name}{name, if not NULL name of right argument.} 28 | } 29 | \value{ 30 | result 31 | } 32 | \description{ 33 | compose a data.frame and a relop_arrow class 34 | } 35 | -------------------------------------------------------------------------------- /man/apply_right_S4-relop_arrow-relop_arrow-method.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arrow.R 3 | \name{apply_right_S4,relop_arrow,relop_arrow-method} 4 | \alias{apply_right_S4,relop_arrow,relop_arrow-method} 5 | \title{S4 dispatch method for apply_right.} 6 | \usage{ 7 | \S4method{apply_right_S4}{relop_arrow,relop_arrow}( 8 | pipe_left_arg, 9 | pipe_right_arg, 10 | pipe_environment, 11 | left_arg_name, 12 | pipe_string, 13 | right_arg_name 14 | ) 15 | } 16 | \arguments{ 17 | \item{pipe_left_arg}{left argument} 18 | 19 | \item{pipe_right_arg}{pipe_right_arg argument} 20 | 21 | \item{pipe_environment}{environment to evaluate in} 22 | 23 | \item{left_arg_name}{name, if not NULL name of left argument.} 24 | 25 | \item{pipe_string}{character, name of pipe operator.} 26 | 27 | \item{right_arg_name}{name, if not NULL name of right argument.} 28 | } 29 | \value{ 30 | result 31 | } 32 | \description{ 33 | compose two relop_arrow classes 34 | } 35 | -------------------------------------------------------------------------------- /man/arrow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/arrow.R 3 | \name{arrow} 4 | \alias{arrow} 5 | \title{Data arrow} 6 | \usage{ 7 | arrow(pipeline, ..., free_table_key = NULL, strict = FALSE) 8 | } 9 | \arguments{ 10 | \item{pipeline}{pipeline with one source table} 11 | 12 | \item{...}{not used, force later argument to be referred to by name.} 13 | 14 | \item{free_table_key}{name of table to consider free (input) to the pipeline} 15 | 16 | \item{strict}{logical, if TRUE excess columns are considered an error} 17 | } 18 | \value{ 19 | relop_arrow wrapping of pipeline 20 | } 21 | \description{ 22 | A categorical arrow mapping a table to a table. 23 | } 24 | -------------------------------------------------------------------------------- /man/build_join_plan.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{build_join_plan} 4 | \alias{build_join_plan} 5 | \title{Build a join plan.} 6 | \usage{ 7 | build_join_plan(tDesc, ..., check = TRUE) 8 | } 9 | \arguments{ 10 | \item{tDesc}{description of tables from \code{\link{describe_tables}} (and likely altered by user). Note: no column names must intersect with names of the form \code{table_CLEANEDTABNAME_present}.} 11 | 12 | \item{...}{force later arguments to bind by name.} 13 | 14 | \item{check}{logical, if TRUE check the join plan for consistency.} 15 | } 16 | \value{ 17 | detailed column join plan (appropriate for editing) 18 | } 19 | \description{ 20 | Please see \code{vignette('DependencySorting', package = 'rquery')} and \code{vignette('joinController', package= 'rquery')} for more details. 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d <- data.frame(id=1:3, weight= c(200, 140, 98)) 27 | DBI::dbWriteTable(my_db,"d1", d) 28 | DBI::dbWriteTable(my_db,"d2", d) 29 | tDesc <- describe_tables(my_db, c("d1", "d2")) 30 | tDesc$keys[[1]] <- list(PrimaryKey= 'id') 31 | tDesc$keys[[2]] <- list(PrimaryKey= 'id') 32 | print(build_join_plan(tDesc)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | 36 | } 37 | \seealso{ 38 | \code{\link{describe_tables}}, \code{\link{inspect_join_plan}}, \code{\link{graph_join_plan}}, \code{\link{actualize_join_plan}} 39 | } 40 | -------------------------------------------------------------------------------- /man/column_names.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/relop.R 3 | \name{column_names} 4 | \alias{column_names} 5 | \title{Return column names} 6 | \usage{ 7 | column_names(x, ...) 8 | } 9 | \arguments{ 10 | \item{x}{rquery operation tree.} 11 | 12 | \item{...}{generic additional arguments} 13 | } 14 | \value{ 15 | vector of column names 16 | } 17 | \description{ 18 | Return column names 19 | } 20 | \examples{ 21 | 22 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 23 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 24 | d1 <- rq_copy_to(my_db, 'd1', 25 | data.frame(AUC = 0.6, R2 = 0.2)) 26 | d2 <- rq_copy_to(my_db, 'd2', 27 | data.frame(AUC = 0.6, D = 0.3)) 28 | optree <- natural_join(d1, d2, by = "AUC") 29 | cat(format(optree)) 30 | print(column_names(optree)) 31 | DBI::dbDisconnect(my_db) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/columns_used.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/relop.R 3 | \name{columns_used} 4 | \alias{columns_used} 5 | \title{Return columns used} 6 | \usage{ 7 | columns_used(x, ..., using = NULL) 8 | } 9 | \arguments{ 10 | \item{x}{rquery operation tree.} 11 | 12 | \item{...}{generic additional arguments (not used)} 13 | 14 | \item{using}{character, if not NULL set of columns used from above.} 15 | } 16 | \value{ 17 | vector of table qualified column names. 18 | } 19 | \description{ 20 | Return columns used 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d1 <- rq_copy_to(my_db, 'd1', 27 | data.frame(AUC = 0.6, R2 = 0.2)) 28 | d2 <- rq_copy_to(my_db, 'd2', 29 | data.frame(AUC = 0.6, D = 0.3)) 30 | optree <- natural_join(d1, d2, by = "AUC") 31 | cat(format(optree)) 32 | print(columns_used(optree)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/convert_yaml_to_pipeline.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/yaml.R 3 | \name{convert_yaml_to_pipeline} 4 | \alias{convert_yaml_to_pipeline} 5 | \title{Convert a series of simple objects (from YAML deserializaton) to an rquery pipeline.} 6 | \usage{ 7 | convert_yaml_to_pipeline(rep, ..., source = NULL, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{rep}{input objects} 11 | 12 | \item{...}{not used, force later arguments to bind by name} 13 | 14 | \item{source}{input rquery node} 15 | 16 | \item{env}{environment to evaluate in} 17 | } 18 | \value{ 19 | rquery operator tree 20 | } 21 | \description{ 22 | Convert a series of simple objects (from YAML deserializaton) to an rquery pipeline. 23 | } 24 | -------------------------------------------------------------------------------- /man/count_null_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/work_with_NULLs.R 3 | \name{count_null_cols} 4 | \alias{count_null_cols} 5 | \title{Count NULLs per row for given column set.} 6 | \usage{ 7 | count_null_cols(source, cols, count) 8 | } 9 | \arguments{ 10 | \item{source}{incoming rel_op tree or data.frame.} 11 | 12 | \item{cols}{character, columns to track} 13 | 14 | \item{count}{character, column to write count in.} 15 | } 16 | \value{ 17 | rel_op node or data.frame (depending on input). 18 | } 19 | \description{ 20 | Build a query that counts the number of nulls in each row. 21 | } 22 | \examples{ 23 | 24 | # WARNING: example tries to change rquery.rquery_db_executor option to RSQLite and back. 25 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 26 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 27 | RSQLite::initExtension(my_db) 28 | old_o <- options(list("rquery.rquery_db_executor" = list(db = my_db))) 29 | 30 | d <- rq_copy_to(my_db, 'd', 31 | data.frame(AUC = c(0.6, 0.5, NA), 32 | R2 = c(1.0, 0.9, NA))) 33 | op_tree <- d \%.>\% count_null_cols(., c("AUC", "R2"), "nnull") 34 | cat(format(op_tree)) 35 | sql <- to_sql(op_tree, my_db) 36 | cat(sql) 37 | print(DBI::dbGetQuery(my_db, sql)) 38 | 39 | # ad-hoc mode 40 | data.frame(AUC=c(1,NA,0.5), R2=c(NA,1,0)) \%.>\% 41 | op_tree \%.>\% 42 | print(.) 43 | 44 | # cleanup 45 | options(old_o) 46 | DBI::dbDisconnect(my_db) 47 | } 48 | 49 | } 50 | \seealso{ 51 | \code{\link{null_replace}}, \code{\link{mark_null_cols}} 52 | } 53 | -------------------------------------------------------------------------------- /man/describe_tables.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{describe_tables} 4 | \alias{describe_tables} 5 | \title{Build a nice description of a table.} 6 | \usage{ 7 | describe_tables(db, tablenames, ..., keyInspector = key_inspector_all_cols) 8 | } 9 | \arguments{ 10 | \item{db}{database handle} 11 | 12 | \item{tablenames}{character, names of tables to describe.} 13 | 14 | \item{...}{force later arguments to bind by name.} 15 | 16 | \item{keyInspector}{function that determines preferred primary key set for tables.} 17 | } 18 | \value{ 19 | table describing the data. 20 | } 21 | \description{ 22 | Please see \url{https://win-vector.com/2017/05/26/managing-spark-data-handles-in-r/} for details. 23 | Note: one usually needs to alter the keys column which is just populated with all columns. 24 | } 25 | \details{ 26 | Please see \code{vignette('DependencySorting', package = 'rquery')} and \code{vignette('joinController', package= 'rquery')} for more details. 27 | } 28 | \examples{ 29 | 30 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 31 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 32 | ex <- example_employee_date(my_db) 33 | print(describe_tables(my_db, ex$tableName, 34 | keyInspector = key_inspector_sqlite)) 35 | DBI::dbDisconnect(my_db) 36 | } 37 | 38 | 39 | } 40 | \seealso{ 41 | \code{\link{build_join_plan}}, \code{\link{graph_join_plan}}, \code{\link{actualize_join_plan}} 42 | } 43 | -------------------------------------------------------------------------------- /man/drop_columns.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/drop_columns.R 3 | \name{drop_columns} 4 | \alias{drop_columns} 5 | \title{Make a drop columns node (not a relational operation).} 6 | \usage{ 7 | drop_columns(source, drops, ..., strict = FALSE, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{source to drop columns from.} 11 | 12 | \item{drops}{list of distinct column names.} 13 | 14 | \item{...}{force later arguments to bind by name} 15 | 16 | \item{strict}{logical, if TRUE do check columns to be dropped are actually present.} 17 | 18 | \item{env}{environment to look to.} 19 | } 20 | \value{ 21 | drop columns node. 22 | } 23 | \description{ 24 | Note: must keep at least one column. 25 | } 26 | \examples{ 27 | 28 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 29 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 30 | d <- rq_copy_to(my_db, 'd', 31 | data.frame(AUC = 0.6, R2 = 0.2)) 32 | optree <- drop_columns(d, 'AUC') 33 | cat(format(optree)) 34 | sql <- to_sql(optree, my_db) 35 | cat(sql) 36 | print(DBI::dbGetQuery(my_db, sql)) 37 | DBI::dbDisconnect(my_db) 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /man/ex.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wrap_ex.R 3 | \name{ex} 4 | \alias{ex} 5 | \title{Execute a wrapped execution pipeline.} 6 | \usage{ 7 | ex(ops, ..., env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{ops}{rquery pipeline with tables formed by `wrap()`.} 11 | 12 | \item{...}{not used, force later argument to be referred by name} 13 | 14 | \item{env}{environment to work in.} 15 | } 16 | \value{ 17 | data.frame result 18 | } 19 | \description{ 20 | Execute a ops-dag using `code{wrap()}` data as values. 21 | } 22 | \examples{ 23 | 24 | if(requireNamespace('rqdatatable')) { 25 | d <- data.frame(x = 1:3, y = 4:6) 26 | d \%.>\% 27 | wrap(.) \%.>\% 28 | extend(., z := x + y) \%.>\% 29 | ex(.) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/example_employee_date.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{example_employee_date} 4 | \alias{example_employee_date} 5 | \title{Build some example tables (requires DBI).} 6 | \usage{ 7 | example_employee_date(con) 8 | } 9 | \arguments{ 10 | \item{con}{db connection} 11 | } 12 | \value{ 13 | example tables 14 | } 15 | \description{ 16 | Build some example tables (requires DBI). 17 | } 18 | \examples{ 19 | 20 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 21 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 22 | example_employee_date(my_db) 23 | DBI::dbDisconnect(my_db) 24 | } 25 | 26 | } 27 | \keyword{internal} 28 | -------------------------------------------------------------------------------- /man/expand_grid.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/complete_design.R 3 | \name{expand_grid} 4 | \alias{expand_grid} 5 | \title{Cross product vectors in database.} 6 | \usage{ 7 | expand_grid( 8 | db, 9 | values, 10 | ..., 11 | temporary = TRUE, 12 | table_name = (wrapr::mk_tmp_name_source("eg"))(), 13 | qualifiers = NULL 14 | ) 15 | } 16 | \arguments{ 17 | \item{db}{database handle} 18 | 19 | \item{values}{named list of value vectors.} 20 | 21 | \item{...}{force later arguments to bind by name.} 22 | 23 | \item{temporary}{logical if TRUE try to make temporary table.} 24 | 25 | \item{table_name}{name to land result as.} 26 | 27 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 28 | } 29 | \value{ 30 | table handle. 31 | } 32 | \description{ 33 | Cross product vectors in database. 34 | } 35 | \examples{ 36 | 37 | if (requireNamespace("DBI", quietly = TRUE) && 38 | requireNamespace("RSQLite", quietly = TRUE)) { 39 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 40 | values <- list(nums = 1:3, lets = c("a", "b")) 41 | res <- expand_grid(my_db, values) 42 | print(res) 43 | execute(my_db, res) 44 | DBI::dbDisconnect(my_db) 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /man/format_node.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/relop.R 3 | \name{format_node} 4 | \alias{format_node} 5 | \title{Format a single node for printing.} 6 | \usage{ 7 | format_node(node) 8 | } 9 | \arguments{ 10 | \item{node}{node of operator tree to be formatted} 11 | } 12 | \value{ 13 | character display form of the node 14 | } 15 | \description{ 16 | Format a single node for printing. 17 | } 18 | -------------------------------------------------------------------------------- /man/getDBOption.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{getDBOption} 4 | \alias{getDBOption} 5 | \title{Get a database connection option.} 6 | \usage{ 7 | getDBOption(db, optname, default, connection_options = list()) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle.} 11 | 12 | \item{optname}{character, single option name.} 13 | 14 | \item{default}{what to return if not set.} 15 | 16 | \item{connection_options}{name list of per connection options.} 17 | } 18 | \value{ 19 | option value 20 | } 21 | \description{ 22 | Note: we are moving away from global options to options in the DB handle. 23 | } 24 | \examples{ 25 | 26 | if(requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 27 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 28 | print(getDBOption(my_db, "use_DBI_dbExecute")) 29 | DBI::dbDisconnect(my_db) 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /man/key_inspector_all_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{key_inspector_all_cols} 4 | \alias{key_inspector_all_cols} 5 | \title{Return all columns as guess of preferred primary keys.} 6 | \usage{ 7 | key_inspector_all_cols(db, tablename) 8 | } 9 | \arguments{ 10 | \item{db}{database handle} 11 | 12 | \item{tablename}{character, name of table} 13 | } 14 | \value{ 15 | map of keys to keys 16 | } 17 | \description{ 18 | Return all columns as guess of preferred primary keys. 19 | } 20 | \examples{ 21 | 22 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 23 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 24 | DBI::dbWriteTable(my_db, 25 | "d", 26 | data.frame(x=1:3, y=NA)) 27 | print(key_inspector_all_cols(my_db, "d")) 28 | DBI::dbDisconnect(my_db) 29 | } 30 | 31 | } 32 | \seealso{ 33 | \code{describe_tables} 34 | } 35 | -------------------------------------------------------------------------------- /man/key_inspector_postgresql.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{key_inspector_postgresql} 4 | \alias{key_inspector_postgresql} 5 | \title{Return all primary key columns as guess at preferred primary keys for a PostgreSQL handle.} 6 | \usage{ 7 | key_inspector_postgresql(db, tablename) 8 | } 9 | \arguments{ 10 | \item{db}{database handle} 11 | 12 | \item{tablename}{character, name of table} 13 | } 14 | \value{ 15 | map of keys to keys 16 | } 17 | \description{ 18 | Return all primary key columns as guess at preferred primary keys for a PostgreSQL handle. 19 | } 20 | \seealso{ 21 | \code{describe_tables} 22 | } 23 | -------------------------------------------------------------------------------- /man/key_inspector_sqlite.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/join_controller.R 3 | \name{key_inspector_sqlite} 4 | \alias{key_inspector_sqlite} 5 | \title{Return all primary key columns as guess at preferred primary keys for a SQLite handle.} 6 | \usage{ 7 | key_inspector_sqlite(db, tablename) 8 | } 9 | \arguments{ 10 | \item{db}{database handle} 11 | 12 | \item{tablename}{character, name of table} 13 | } 14 | \value{ 15 | map of keys to keys 16 | } 17 | \description{ 18 | Return all primary key columns as guess at preferred primary keys for a SQLite handle. 19 | } 20 | \examples{ 21 | 22 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 23 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 24 | DBI::dbExecute(my_db, " 25 | CREATE TABLE orgtable ( 26 | eid TEXT, 27 | date INTEGER, 28 | dept TEXT, 29 | location TEXT, 30 | PRIMARY KEY (eid, date) 31 | ) 32 | ") 33 | print(key_inspector_sqlite(my_db, "orgtable")) 34 | DBI::dbDisconnect(my_db) 35 | } 36 | 37 | } 38 | \seealso{ 39 | \code{describe_tables} 40 | } 41 | -------------------------------------------------------------------------------- /man/local_td.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/table_source.R 3 | \name{local_td} 4 | \alias{local_td} 5 | \title{Construct a table description of a local data.frame.} 6 | \usage{ 7 | local_td( 8 | d, 9 | ..., 10 | name = NULL, 11 | name_source = wrapr::mk_tmp_name_source("rqltd"), 12 | env = parent.frame() 13 | ) 14 | } 15 | \arguments{ 16 | \item{d}{data.frame or name of data.frame to use as a data source.} 17 | 18 | \item{...}{not used, force later arguments to be optional.} 19 | 20 | \item{name}{if not null name to user for table.} 21 | 22 | \item{name_source}{temporary name source.} 23 | 24 | \item{env}{environment to work in.} 25 | } 26 | \value{ 27 | a relop representation of the data 28 | } 29 | \description{ 30 | Construct a table description of a local data.frame. 31 | } 32 | \examples{ 33 | 34 | d <- data.frame(x = 1) 35 | local_td(d) 36 | local_td("d") 37 | local_td(as.name("d")) 38 | local_td(data.frame(x = 1)) 39 | d \%.>\% local_td # needs wrapr 1.5.0 or newer to capture name 40 | 41 | } 42 | \seealso{ 43 | \code{\link{db_td}}, \code{\link{mk_td}} 44 | } 45 | -------------------------------------------------------------------------------- /man/make_assignments.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/make_assignments.R 3 | \name{make_assignments} 4 | \alias{make_assignments} 5 | \title{Make a list of assignments, applying many functions to many columns.} 6 | \usage{ 7 | make_assignments(columns, funs, ..., sep = "_", prefix = TRUE) 8 | } 9 | \arguments{ 10 | \item{columns}{character, vector of column names to take values from.} 11 | 12 | \item{funs}{character, names of functions to apply.} 13 | 14 | \item{...}{not used, forced later parameters to bind by name} 15 | 16 | \item{sep}{character, naming separator} 17 | 18 | \item{prefix}{logical, if TRUE place function names prior, else after in results.} 19 | } 20 | \description{ 21 | Make a list of assignments, applying each function to each column named. 22 | Intended to be used as an argument in \code{extend_se()} or \code{project_se()}. 23 | } 24 | \examples{ 25 | 26 | assignments <- make_assignments(c('x', 'y'), c('mean', med = 'median')) 27 | print(assignments) 28 | ops <- mk_td('d', c('x', 'y')) \%.>\% project_se(., assignments) 29 | cat(format(ops)) 30 | 31 | } 32 | -------------------------------------------------------------------------------- /man/mark_null_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/work_with_NULLs.R 3 | \name{mark_null_cols} 4 | \alias{mark_null_cols} 5 | \title{Indicate NULLs per row for given column set.} 6 | \usage{ 7 | mark_null_cols(source, cols) 8 | } 9 | \arguments{ 10 | \item{source}{incoming rel_op tree or data.frame.} 11 | 12 | \item{cols}{named character, values are columns to track, names are where to land indicators.} 13 | } 14 | \value{ 15 | rel_op node or data.frame (depending on input). 16 | } 17 | \description{ 18 | Build a query that creates NULL indicators for nulls in selected columns. 19 | } 20 | \examples{ 21 | 22 | # WARNING: example tries to change rquery.rquery_db_executor option to RSQLite and back. 23 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 24 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 25 | RSQLite::initExtension(my_db) 26 | old_o <- options(list("rquery.rquery_db_executor" = list(db = my_db))) 27 | 28 | d <- rq_copy_to(my_db, 'd', 29 | data.frame(AUC = c(0.6, 0.5, NA), 30 | R2 = c(1.0, 0.9, NA))) 31 | op_tree <- d \%.>\% mark_null_cols(., qc(AUC_NULL, R2_NULL) \%:=\% 32 | qc(AUC, R2)) 33 | cat(format(op_tree)) 34 | sql <- to_sql(op_tree, my_db) 35 | cat(sql) 36 | print(DBI::dbGetQuery(my_db, sql)) 37 | 38 | # ad-hoc mode 39 | data.frame(AUC=c(1,NA,0.5), R2=c(NA,1,0)) \%.>\% 40 | op_tree \%.>\% 41 | print(.) 42 | 43 | # cleanup 44 | options(old_o) 45 | DBI::dbDisconnect(my_db) 46 | } 47 | 48 | } 49 | \seealso{ 50 | \code{\link{null_replace}}, \code{\link{count_null_cols}} 51 | } 52 | -------------------------------------------------------------------------------- /man/materialize_node.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/materialize_node.R 3 | \name{materialize_node} 4 | \alias{materialize_node} 5 | \title{Create a materialize node.} 6 | \usage{ 7 | materialize_node( 8 | source, 9 | table_name = (wrapr::mk_tmp_name_source("rquerymn"))(), 10 | ..., 11 | qualifiers = NULL 12 | ) 13 | } 14 | \arguments{ 15 | \item{source}{source to work from (relop node)} 16 | 17 | \item{table_name}{character, name of caching table} 18 | 19 | \item{...}{not used, force later argument to bind by name} 20 | 21 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 22 | } 23 | \value{ 24 | relop materialize_node 25 | } 26 | \description{ 27 | Write results into a specified table. Result is transient, lives only for the duration of the 28 | pipeline calculation. This node is only used to break up or un-nest calculations, not for value sharing or 29 | re-use. 30 | } 31 | \details{ 32 | Note this node can not be used in multiple paths in the same rel_op tree as it re-uses table names and 33 | re-computes each time called. 34 | } 35 | \seealso{ 36 | \code{\link{rsummary_node}}, \code{\link{non_sql_node}} 37 | } 38 | -------------------------------------------------------------------------------- /man/null_replace.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/null_replace.R 3 | \name{null_replace} 4 | \alias{null_replace} 5 | \title{Create a null_replace node.} 6 | \usage{ 7 | null_replace(src, cols, value, ..., note_col = NULL, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{src}{relop or data.frame data source.} 11 | 12 | \item{cols}{character, columns to work on.} 13 | 14 | \item{value}{scalar, value to write.} 15 | 16 | \item{...}{force later arguments to bind by name.} 17 | 18 | \item{note_col}{character, if not NULL record number of columns altered per-row in this column.} 19 | 20 | \item{env}{environment to look to.} 21 | } 22 | \value{ 23 | null_replace node or data.frame. 24 | } 25 | \description{ 26 | Replace NA/NULL is specified columns with the given replacement value. 27 | } 28 | \examples{ 29 | 30 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 31 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 32 | d1 <- rq_copy_to(my_db, 'd1', 33 | data.frame(A = c(NA, 2, 3, NA), B = c(3, NA, 4, NA))) 34 | optree <- null_replace(d1, qc(A, B), 35 | 0.0, note_col = "alterations") 36 | cat(format(optree)) 37 | sql <- to_sql(optree, my_db) 38 | cat(sql) 39 | print(DBI::dbGetQuery(my_db, sql)) 40 | DBI::dbDisconnect(my_db) 41 | } 42 | 43 | } 44 | \seealso{ 45 | \code{\link{count_null_cols}}, \code{\link{mark_null_cols}} 46 | } 47 | -------------------------------------------------------------------------------- /man/op_diagram.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/op_diagram.R 3 | \name{op_diagram} 4 | \alias{op_diagram} 5 | \title{Build a diagram of a optree pipeline.} 6 | \usage{ 7 | op_diagram(optree, ..., merge_tables = FALSE, show_table_columns = TRUE) 8 | } 9 | \arguments{ 10 | \item{optree}{operation tree pipeline (or list of such).} 11 | 12 | \item{...}{force other argument to be by name.} 13 | 14 | \item{merge_tables}{logical, if TRUE merge all same table references into one node. rel_op nodes that declare a materialize_as name will be cross-linked.} 15 | 16 | \item{show_table_columns}{logical, if TRUE show table columns.} 17 | } 18 | \value{ 19 | character DiagrammeR::grViz() ready text. 20 | } 21 | \description{ 22 | Build a diagram of a optree pipeline. 23 | } 24 | \examples{ 25 | 26 | d <- mk_td('d', 27 | columns = qc(AUC, R2)) 28 | optree <- d \%.>\% 29 | extend(., v \%:=\% ifelse(AUC>0.5, R2, 1.0)) \%.>\% 30 | quantile_node(.) \%.>\% 31 | natural_join(., d, jointype = "LEFT", by = "AUC") \%.>\% 32 | orderby(., "AUC") 33 | 34 | cat(format(optree)) 35 | 36 | cat(op_diagram(optree)) 37 | 38 | # if(requireNamespace("DiagrammeR", quietly = TRUE)) { 39 | # optree \%.>\% 40 | # op_diagram(., merge_tables = TRUE) \%.>\% 41 | # DiagrammeR::grViz(.) \%.>\% 42 | # print(.) 43 | # # # or to render to png 44 | # # optree \%.>\% 45 | # # op_diagram(., merge_tables = TRUE) \%.>\% 46 | # # DiagrammeR::DiagrammeR(diagram = ., type = "grViz") \%.>\% 47 | # # DiagrammeRsvg::export_svg(.) \%.>\% 48 | # # charToRaw(.) \%.>\% 49 | # # rsvg::rsvg_png(., file = "diagram1.png") 50 | # } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /man/order_expr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/order_expr.R 3 | \name{order_expr} 4 | \alias{order_expr} 5 | \alias{order_expr_nse} 6 | \title{Make a order_expr node.} 7 | \usage{ 8 | order_expr(source, expr, env = parent.frame()) 9 | 10 | order_expr_nse(source, expr, env = parent.frame()) 11 | } 12 | \arguments{ 13 | \item{source}{source to select from.} 14 | 15 | \item{expr}{expression to order_expr.} 16 | 17 | \item{env}{environment to look to.} 18 | } 19 | \value{ 20 | select columns node. 21 | } 22 | \description{ 23 | order_expr() uses bquote() .()-style escaping. 24 | } 25 | \examples{ 26 | 27 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 28 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 29 | d <- rq_copy_to(my_db, 'd', 30 | data.frame(AUC = 0.6, R2 = 0.2, z = 3)) 31 | TARGETCOL = as.name("AUC") 32 | optree <- order_expr(d, .(TARGETCOL)/R2) \%.>\% 33 | select_columns(., "R2") 34 | cat(format(optree)) 35 | sql <- to_sql(optree, my_db) 36 | cat(sql) 37 | print(DBI::dbGetQuery(my_db, sql)) 38 | DBI::dbDisconnect(my_db) 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /man/order_expr_se.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/order_expr.R 3 | \name{order_expr_se} 4 | \alias{order_expr_se} 5 | \title{Make a order_expr node.} 6 | \usage{ 7 | order_expr_se(source, expr, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{source to select from.} 11 | 12 | \item{expr}{expression to order_expr in ascending order.} 13 | 14 | \item{env}{environment to look for values in.} 15 | } 16 | \value{ 17 | select columns node. 18 | } 19 | \description{ 20 | Make a order_expr node. 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d <- rq_copy_to(my_db, 'd', 27 | data.frame(AUC = 0.6, R2 = 0.2)) 28 | optree <- order_expr_se(d, "AUC/R2") 29 | cat(format(optree)) 30 | sql <- to_sql(optree, my_db) 31 | cat(sql) 32 | print(DBI::dbGetQuery(my_db, sql)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /man/pre_sql_fn.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_fn} 4 | \alias{pre_sql_fn} 5 | \title{pre_sql_token funtion name} 6 | \usage{ 7 | pre_sql_fn(value) 8 | } 9 | \arguments{ 10 | \item{value}{character, token string} 11 | } 12 | \value{ 13 | pre_sql_token 14 | 15 | pre_sql_token 16 | } 17 | \description{ 18 | pre_sql_token funtion name 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/pre_sql_identifier.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_identifier} 4 | \alias{pre_sql_identifier} 5 | \title{pre_sql_identifier: abstract name of a column and where it is comming from} 6 | \usage{ 7 | pre_sql_identifier(column_name) 8 | } 9 | \arguments{ 10 | \item{column_name}{character name of column} 11 | } 12 | \value{ 13 | pre_sql_token 14 | } 15 | \description{ 16 | represents a value from a given sub-table or sub-expression 17 | source is name of source 18 | name is name for term 19 | } 20 | \keyword{internal} 21 | -------------------------------------------------------------------------------- /man/pre_sql_string.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_string} 4 | \alias{pre_sql_string} 5 | \title{pre_sql_string} 6 | \usage{ 7 | pre_sql_string(value) 8 | } 9 | \arguments{ 10 | \item{value}{string} 11 | } 12 | \value{ 13 | pre_sql_token 14 | } 15 | \description{ 16 | represents a string constant 17 | value character string 18 | } 19 | \keyword{internal} 20 | -------------------------------------------------------------------------------- /man/pre_sql_sub_expr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_sub_expr} 4 | \alias{pre_sql_sub_expr} 5 | \title{pre_sql_sub_expr} 6 | \usage{ 7 | pre_sql_sub_expr(terms, info = NULL) 8 | } 9 | \arguments{ 10 | \item{terms}{list of pre_sql tokens} 11 | 12 | \item{info}{named list of extra info with a name slot containing a single string without spaces.} 13 | } 14 | \value{ 15 | pre_sql_sub_expr 16 | } 17 | \description{ 18 | represents an expression. Unnamed list of pre_sql_terms and character. 19 | } 20 | -------------------------------------------------------------------------------- /man/pre_sql_to_query.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_to_query} 4 | \alias{pre_sql_to_query} 5 | \title{Return SQL transform of tokens.} 6 | \usage{ 7 | pre_sql_to_query( 8 | x, 9 | db_info, 10 | ..., 11 | source_table = NULL, 12 | source_limit = NA_real_, 13 | using = NULL, 14 | qualifiers = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{parsed tokens.} 19 | 20 | \item{db_info}{DBI connnection or rquery_db_info object} 21 | 22 | \item{...}{generic additional arguments (not used).} 23 | 24 | \item{source_table}{character if not NULL name of source table.} 25 | 26 | \item{source_limit}{numeric if not NULL limit sources to this many rows.} 27 | 28 | \item{using}{character, if not NULL set of columns used from above.} 29 | 30 | \item{qualifiers}{named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 31 | } 32 | \value{ 33 | SQL command 34 | } 35 | \description{ 36 | Return SQL transform of tokens. 37 | } 38 | \keyword{internal} 39 | -------------------------------------------------------------------------------- /man/pre_sql_to_query.pre_sql_sub_expr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_to_query.pre_sql_sub_expr} 4 | \alias{pre_sql_to_query.pre_sql_sub_expr} 5 | \title{Convert a pre_sql token object to SQL query text.} 6 | \usage{ 7 | \method{pre_sql_to_query}{pre_sql_sub_expr}( 8 | x, 9 | db_info, 10 | ..., 11 | source_table = NULL, 12 | source_limit = NA_real_, 13 | using = NULL, 14 | qualifiers = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{the pre_sql token} 19 | 20 | \item{db_info}{representation of the database to convert to} 21 | 22 | \item{...}{force later arguments to be by name} 23 | 24 | \item{source_table}{concrete table for query} 25 | 26 | \item{source_limit}{numeric limit on rows from this source table} 27 | 28 | \item{using}{TBD} 29 | 30 | \item{qualifiers}{named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 31 | } 32 | \value{ 33 | SQL query text 34 | } 35 | \description{ 36 | Convert a pre_sql token object to SQL query text. 37 | } 38 | \keyword{internal} 39 | -------------------------------------------------------------------------------- /man/pre_sql_to_query.pre_sql_token.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_to_query.pre_sql_token} 4 | \alias{pre_sql_to_query.pre_sql_token} 5 | \title{Convert a pre_sql token object to SQL query text.} 6 | \usage{ 7 | \method{pre_sql_to_query}{pre_sql_token}( 8 | x, 9 | db_info, 10 | ..., 11 | source_table = NULL, 12 | source_limit = NA_real_, 13 | using = NULL, 14 | qualifiers = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{x}{the pre_sql token} 19 | 20 | \item{db_info}{representation of the database to convert to} 21 | 22 | \item{...}{force later arguments to be by name} 23 | 24 | \item{source_table}{concrete table for query} 25 | 26 | \item{source_limit}{numeric limit on rows from this source table} 27 | 28 | \item{using}{TBD} 29 | 30 | \item{qualifiers}{named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 31 | } 32 | \value{ 33 | SQL query text 34 | } 35 | \description{ 36 | Convert a pre_sql token object to SQL query text. 37 | } 38 | \keyword{internal} 39 | -------------------------------------------------------------------------------- /man/pre_sql_token.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{pre_sql_token} 4 | \alias{pre_sql_token} 5 | \title{pre_sql_token} 6 | \usage{ 7 | pre_sql_token(value) 8 | } 9 | \arguments{ 10 | \item{value}{character, token string} 11 | } 12 | \value{ 13 | pre_sql_token 14 | } 15 | \description{ 16 | general token 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/quantile_cols.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/quantile.R 3 | \name{quantile_cols} 4 | \alias{quantile_cols} 5 | \title{Compute quantiles of specified columns 6 | (without interpolation, needs a database with window functions).} 7 | \usage{ 8 | quantile_cols( 9 | db, 10 | incoming_table_name, 11 | ..., 12 | probs = seq(0, 1, 0.25), 13 | probs_name = "quantile_probability", 14 | cols = rq_colnames(db, incoming_table_name), 15 | qualifiers = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{db}{database connection} 20 | 21 | \item{incoming_table_name}{name of table to compute quantiles of} 22 | 23 | \item{...}{force later arguments to bind by name} 24 | 25 | \item{probs}{numeric, probabilities to compute quantiles of} 26 | 27 | \item{probs_name}{character name for probability column} 28 | 29 | \item{cols}{character, columns to compute quantiles of} 30 | 31 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 32 | } 33 | \value{ 34 | data.frame of quantiles 35 | } 36 | \description{ 37 | Compute quantiles of specified columns 38 | (without interpolation, needs a database with window functions). 39 | } 40 | \seealso{ 41 | \code{\link{quantile_node}}, \code{\link{rsummary}} 42 | } 43 | -------------------------------------------------------------------------------- /man/quantile_node.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/quantile.R 3 | \name{quantile_node} 4 | \alias{quantile_node} 5 | \title{Compute quantiles over non-NULL values 6 | (without interpolation, needs a database with window functions).} 7 | \usage{ 8 | quantile_node( 9 | source, 10 | cols = NULL, 11 | ..., 12 | probs_name = "quantile_probability", 13 | probs = seq(0, 1, 0.25), 14 | tmp_name_source = wrapr::mk_tmp_name_source("qn"), 15 | temporary = TRUE, 16 | qualifiers = NULL 17 | ) 18 | } 19 | \arguments{ 20 | \item{source}{source to select from (relop or data.frame).} 21 | 22 | \item{cols}{character, compute quantiles for these columns (NULL indicates all columns).} 23 | 24 | \item{...}{force later arguments to be bound by name} 25 | 26 | \item{probs_name}{character, column name to write probs in.} 27 | 28 | \item{probs}{numeric quantiles to compute} 29 | 30 | \item{tmp_name_source}{wrapr::mk_tmp_name_source(), temporary name generator.} 31 | 32 | \item{temporary}{logical, if TRUE use temporary tables} 33 | 34 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 35 | } 36 | \value{ 37 | table of quantiles 38 | } 39 | \description{ 40 | Please see \url{https://github.com/WinVector/rquery/blob/master/extras/Summary_Example.md} for an example. 41 | } 42 | \details{ 43 | This is a non_sql_node, so please see \code{\link{non_sql_node}} for some of the issues for this node type. 44 | } 45 | \seealso{ 46 | \code{\link{quantile_cols}}, \code{\link{rsummary}}, \code{\link{non_sql_node}} 47 | } 48 | -------------------------------------------------------------------------------- /man/quote_identifier.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{quote_identifier} 4 | \alias{quote_identifier} 5 | \title{Quote an identifier.} 6 | \usage{ 7 | quote_identifier(x, id) 8 | } 9 | \arguments{ 10 | \item{x}{database handle or rquery_db_info object.} 11 | 12 | \item{id}{character to quote} 13 | } 14 | \value{ 15 | quoted identifier 16 | } 17 | \description{ 18 | Quote an identifier. 19 | } 20 | -------------------------------------------------------------------------------- /man/quote_literal.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{quote_literal} 4 | \alias{quote_literal} 5 | \title{Quote a value} 6 | \usage{ 7 | quote_literal(x, o) 8 | } 9 | \arguments{ 10 | \item{x}{database handle or rquery_db_info object.} 11 | 12 | \item{o}{value to quote} 13 | } 14 | \value{ 15 | quoted string 16 | } 17 | \description{ 18 | Quote a value 19 | } 20 | -------------------------------------------------------------------------------- /man/quote_string.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{quote_string} 4 | \alias{quote_string} 5 | \title{Quote a string} 6 | \usage{ 7 | quote_string(x, s) 8 | } 9 | \arguments{ 10 | \item{x}{database handle or rquery_db_info object.} 11 | 12 | \item{s}{character to quote} 13 | } 14 | \value{ 15 | quoted string 16 | } 17 | \description{ 18 | Quote a string 19 | } 20 | -------------------------------------------------------------------------------- /man/quote_table_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{quote_table_name} 4 | \alias{quote_table_name} 5 | \title{Quote a table name.} 6 | \usage{ 7 | quote_table_name(x, id, ..., qualifiers = character(0)) 8 | } 9 | \arguments{ 10 | \item{x}{database handle or rquery_db_info object.} 11 | 12 | \item{id}{character to quote} 13 | 14 | \item{...}{not used, force later arguments to bind by name.} 15 | 16 | \item{qualifiers}{named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | } 18 | \value{ 19 | quoted identifier 20 | } 21 | \description{ 22 | Quote a table name. 23 | } 24 | -------------------------------------------------------------------------------- /man/rename_columns.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rename.R 3 | \name{rename_columns} 4 | \alias{rename_columns} 5 | \title{Make a rename columns node (copies columns not renamed).} 6 | \usage{ 7 | rename_columns(source, cmap, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{source to rename from.} 11 | 12 | \item{cmap}{map written as new column names as keys and old column names as values.} 13 | 14 | \item{env}{environment to look to.} 15 | } 16 | \value{ 17 | rename columns node. 18 | } 19 | \description{ 20 | Make a rename columns node (copies columns not renamed). 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d <- rq_copy_to(my_db, 'd', 27 | data.frame(AUC = 0.6, R2 = 0.2, z = 3)) 28 | op_tree <- rename_columns(d, c('R2' \%:=\% 'AUC', 'AUC' \%:=\% 'R2')) 29 | cat(format(op_tree)) 30 | sql <- to_sql(op_tree, my_db) 31 | cat(sql) 32 | print(DBI::dbGetQuery(my_db, sql)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/row_counts.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/row_counts.R 3 | \name{row_counts} 4 | \alias{row_counts} 5 | \title{Build an optree pipeline counts rows.} 6 | \usage{ 7 | row_counts(source, ..., groupby = character(0), env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{relop tree or data.frame source.} 11 | 12 | \item{...}{force later arguments to bind by name.} 13 | 14 | \item{groupby}{partitioning (window function) column names.} 15 | 16 | \item{env}{environment to look for values in.} 17 | } 18 | \description{ 19 | This is an example of building up a desired pre-prepared pipeline fragment from relop nodes. 20 | } 21 | \examples{ 22 | 23 | # by hand logistic regression example 24 | d <- mk_td("survey_table", 25 | c("subjectID", "surveyCategory", "assessmentTotal")) 26 | optree <- d \%.>\% 27 | row_counts(., groupby = "subjectID") 28 | cat(format(optree)) 29 | 30 | } 31 | -------------------------------------------------------------------------------- /man/rq_colnames.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_colnames} 4 | \alias{rq_colnames} 5 | \title{List table column names.} 6 | \usage{ 7 | rq_colnames(db, table_name, ..., qualifiers = NULL) 8 | } 9 | \arguments{ 10 | \item{db}{Connection handle} 11 | 12 | \item{table_name}{character table name} 13 | 14 | \item{...}{not used, force later argument to bind by name} 15 | 16 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | } 18 | \value{ 19 | character list of column names 20 | } 21 | \description{ 22 | List table column names. 23 | } 24 | -------------------------------------------------------------------------------- /man/rq_connection_advice.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_connection_advice} 4 | \alias{rq_connection_advice} 5 | \title{Get advice for a DB connection (beyond tests).} 6 | \usage{ 7 | rq_connection_advice(db) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle} 11 | } 12 | \value{ 13 | named list of options 14 | } 15 | \description{ 16 | These settings are set by the package maintainers based on experience with 17 | specific databases. 18 | } 19 | \examples{ 20 | 21 | if(requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 22 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 23 | print(rq_connection_name(my_db)) 24 | print(rq_connection_advice(my_db)) 25 | DBI::dbDisconnect(my_db) 26 | } 27 | 28 | } 29 | \seealso{ 30 | \code{\link{rq_connection_tests}} 31 | } 32 | -------------------------------------------------------------------------------- /man/rq_connection_name.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_connection_name} 4 | \alias{rq_connection_name} 5 | \title{Build a canonical name for a db connection class.} 6 | \usage{ 7 | rq_connection_name(db) 8 | } 9 | \arguments{ 10 | \item{db}{Database connection handle.} 11 | } 12 | \value{ 13 | character, key version of handle for option lookups. 14 | } 15 | \description{ 16 | Build a canonical name for a db connection class. 17 | } 18 | \examples{ 19 | 20 | if(requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 21 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 22 | print(rq_connection_name(my_db)) 23 | DBI::dbDisconnect(my_db) 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /man/rq_connection_tests.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_connection_tests} 4 | \alias{rq_connection_tests} 5 | \title{Try and test database for some option settings.} 6 | \usage{ 7 | rq_connection_tests(db, ..., overrides = NULL, use_advice = TRUE) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle.} 11 | 12 | \item{...}{force later arguments to bind by name.} 13 | 14 | \item{overrides}{named character vector or list, options (just name, not DB qualification) to force} 15 | 16 | \item{use_advice}{logical if TRUE incorporate hard-coded advice.} 17 | } 18 | \value{ 19 | named list of options 20 | } 21 | \description{ 22 | These settings are estimated by experiments. This is not 23 | the full set of options- but just the ones tested here. 24 | } 25 | \details{ 26 | Note: tests are currently run in the default schema. Also it is normal to see some warning/error 27 | messages as different database capabilities are tested. 28 | } 29 | \examples{ 30 | 31 | if(requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 32 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 33 | print(rq_connection_name(my_db)) 34 | print(rq_connection_tests(my_db, 35 | overrides = c("use_DBI_dbExistsTable" = FALSE))) 36 | # the following would set options 37 | # print(options(rq_connection_tests(my_db))) 38 | DBI::dbDisconnect(my_db) 39 | } 40 | 41 | } 42 | \seealso{ 43 | \code{\link{rq_connection_advice}} 44 | } 45 | -------------------------------------------------------------------------------- /man/rq_copy_to.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_copy_to} 4 | \alias{rq_copy_to} 5 | \title{Copy local R table to remote data handle.} 6 | \usage{ 7 | rq_copy_to( 8 | db, 9 | table_name, 10 | d, 11 | ..., 12 | qualifiers = NULL, 13 | overwrite = FALSE, 14 | temporary = TRUE, 15 | rowidcolumn = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{db}{database connection handle.} 20 | 21 | \item{table_name}{name of table to create.} 22 | 23 | \item{d}{data.frame to copy to database.} 24 | 25 | \item{...}{force later argument to be by name} 26 | 27 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 28 | 29 | \item{overwrite}{logical, if TRUE try to overwrite existing table.} 30 | 31 | \item{temporary}{logical, if TRUE try to mark table as temporary.} 32 | 33 | \item{rowidcolumn}{character, name to land row-ids.} 34 | } 35 | \value{ 36 | a relop representation of the data 37 | } 38 | \description{ 39 | Copy local R table to remote data handle. 40 | } 41 | \examples{ 42 | 43 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 44 | db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 45 | d <- rq_copy_to(db, 'd', 46 | data.frame(AUC = 0.6, R2 = 0.2)) 47 | 48 | sql <- to_sql(d, db) 49 | cat(sql) 50 | print(DBI::dbGetQuery(db, "SELECT * FROM d")) 51 | DBI::dbDisconnect(db) 52 | } 53 | 54 | } 55 | \seealso{ 56 | \code{\link{db_td}}, \code{\link{mk_td}}, \code{\link{materialize}}, \code{\link{execute}}, \code{\link{to_sql}} 57 | } 58 | -------------------------------------------------------------------------------- /man/rq_execute.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_execute} 4 | \alias{rq_execute} 5 | \title{Execute a query, typically an update that is not supposed to return results.} 6 | \usage{ 7 | rq_execute(db, q) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle} 11 | 12 | \item{q}{character query} 13 | } 14 | \value{ 15 | nothing 16 | } 17 | \description{ 18 | Execute a query, typically an update that is not supposed to return results. 19 | } 20 | \seealso{ 21 | \code{\link{db_td}} 22 | } 23 | -------------------------------------------------------------------------------- /man/rq_function_mappings.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{rq_function_mappings} 4 | \alias{rq_function_mappings} 5 | \title{Return function mappings for a connection} 6 | \usage{ 7 | rq_function_mappings(db, ..., qualifiers = NULL) 8 | } 9 | \arguments{ 10 | \item{db}{a rquery_db_info} 11 | 12 | \item{...}{not used, force later arguments to bind by name} 13 | 14 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 15 | } 16 | \value{ 17 | data.frame of function mappings 18 | } 19 | \description{ 20 | Return function mappings for a connection 21 | } 22 | \keyword{internal} 23 | -------------------------------------------------------------------------------- /man/rq_get_query.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_get_query} 4 | \alias{rq_get_query} 5 | \title{Execute a get query, typically a non-update that is supposed to return results.} 6 | \usage{ 7 | rq_get_query(db, q) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle} 11 | 12 | \item{q}{character query} 13 | } 14 | \value{ 15 | nothing 16 | } 17 | \description{ 18 | Execute a get query, typically a non-update that is supposed to return results. 19 | } 20 | \seealso{ 21 | \code{\link{db_td}} 22 | } 23 | -------------------------------------------------------------------------------- /man/rq_head.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_head} 4 | \alias{rq_head} 5 | \title{Get head of db table} 6 | \usage{ 7 | rq_head(db, table_name, ..., qualifiers = NULL, limit = 6L) 8 | } 9 | \arguments{ 10 | \item{db}{Connection handle} 11 | 12 | \item{table_name}{character table name} 13 | 14 | \item{...}{not used, force later argument to bind by name} 15 | 16 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | 18 | \item{limit}{integer, how many rows to take} 19 | } 20 | \value{ 21 | first few rows 22 | } 23 | \description{ 24 | Get head of db table 25 | } 26 | -------------------------------------------------------------------------------- /man/rq_nrow.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_nrow} 4 | \alias{rq_nrow} 5 | \title{Count rows and return as numeric} 6 | \usage{ 7 | rq_nrow(db, table_name, ..., qualifiers = NULL) 8 | } 9 | \arguments{ 10 | \item{db}{database connection} 11 | 12 | \item{table_name}{character, name of table} 13 | 14 | \item{...}{not used, force later argument to bind by name} 15 | 16 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | } 18 | \value{ 19 | numeric row count 20 | } 21 | \description{ 22 | Count rows and return as numeric 23 | } 24 | \seealso{ 25 | \code{\link{db_td}} 26 | } 27 | -------------------------------------------------------------------------------- /man/rq_remove_table.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_remove_table} 4 | \alias{rq_remove_table} 5 | \title{Remove table} 6 | \usage{ 7 | rq_remove_table(db, table_name, ..., qualifiers = NULL) 8 | } 9 | \arguments{ 10 | \item{db}{database connection.} 11 | 12 | \item{table_name}{character, name of table to create.} 13 | 14 | \item{...}{not used, force later argument to bind by name} 15 | 16 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | } 18 | \value{ 19 | logical TRUE if table existed, else FALSE 20 | } 21 | \description{ 22 | Remove table 23 | } 24 | \seealso{ 25 | \code{\link{db_td}} 26 | } 27 | -------------------------------------------------------------------------------- /man/rq_table_exists.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{rq_table_exists} 4 | \alias{rq_table_exists} 5 | \title{Check if a table exists.} 6 | \usage{ 7 | rq_table_exists(db, table_name, ..., qualifiers = NULL) 8 | } 9 | \arguments{ 10 | \item{db}{Connection handle} 11 | 12 | \item{table_name}{character table name} 13 | 14 | \item{...}{not used, force later argument to bind by name} 15 | 16 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 17 | } 18 | \value{ 19 | logical TRUE if table exists. 20 | } 21 | \description{ 22 | Check if a table exists. 23 | } 24 | \seealso{ 25 | \code{\link{db_td}} 26 | } 27 | -------------------------------------------------------------------------------- /man/rquery_db_info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{rquery_db_info} 4 | \alias{rquery_db_info} 5 | \title{Build a db information stand-in} 6 | \usage{ 7 | rquery_db_info( 8 | ..., 9 | connection = NULL, 10 | is_dbi = FALSE, 11 | identifier_quote_char = "\\"", 12 | string_quote_char = "'", 13 | overrides = NULL, 14 | note = "", 15 | connection_options = rq_connection_advice(connection), 16 | db_methods = rquery_default_methods() 17 | ) 18 | } 19 | \arguments{ 20 | \item{...}{force all arguments to be by name.} 21 | 22 | \item{connection}{connection handle to database or Spark.} 23 | 24 | \item{is_dbi}{if TRUE the database connection can be used with DBI.} 25 | 26 | \item{identifier_quote_char}{character, quote to put around identifiers.} 27 | 28 | \item{string_quote_char}{character, quote to put around strings.} 29 | 30 | \item{overrides}{named list of functions to place in info.} 31 | 32 | \item{note}{character note to add to display form.} 33 | 34 | \item{connection_options}{named list of per-connection options.} 35 | 36 | \item{db_methods}{named list of to_sql methods.} 37 | } 38 | \value{ 39 | rquery_db_info object 40 | } 41 | \description{ 42 | Build a db information stand-in 43 | } 44 | -------------------------------------------------------------------------------- /man/rquery_default_db_info.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_info.R 3 | \name{rquery_default_db_info} 4 | \alias{rquery_default_db_info} 5 | \title{An example \code{rquery_db_info} object useful for formatting \code{SQL} without a database connection.} 6 | \usage{ 7 | rquery_default_db_info() 8 | } 9 | \value{ 10 | a rquery_db_info without a connection and vanilla settings. 11 | } 12 | \description{ 13 | An example \code{rquery_db_info} object useful for formatting \code{SQL} without a database connection. 14 | } 15 | -------------------------------------------------------------------------------- /man/rquery_default_methods.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_def_methods_default.R 3 | \name{rquery_default_methods} 4 | \alias{rquery_default_methods} 5 | \title{Default to_sql method implementations.} 6 | \usage{ 7 | rquery_default_methods() 8 | } 9 | \value{ 10 | default implementation methods 11 | } 12 | \description{ 13 | Default to_sql method implementations. 14 | } 15 | \keyword{internal} 16 | -------------------------------------------------------------------------------- /man/rstr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/rlook.R 3 | \name{rstr} 4 | \alias{rstr} 5 | \alias{rlook} 6 | \title{Quick look at remote data} 7 | \usage{ 8 | rstr( 9 | my_db, 10 | tableName, 11 | ..., 12 | displayRows = 10, 13 | countRows = TRUE, 14 | qualifiers = NULL 15 | ) 16 | 17 | rlook( 18 | my_db, 19 | tableName, 20 | ..., 21 | displayRows = 10, 22 | countRows = TRUE, 23 | qualifiers = NULL 24 | ) 25 | } 26 | \arguments{ 27 | \item{my_db}{database handle} 28 | 29 | \item{tableName}{name of table to look at} 30 | 31 | \item{...}{not used, force later arguments to bind by name} 32 | 33 | \item{displayRows}{number of rows to sample} 34 | 35 | \item{countRows}{logical, if TRUE return row count.} 36 | 37 | \item{qualifiers}{optional named ordered vector of strings carrying additional db hierarchy terms, such as schema.} 38 | } 39 | \value{ 40 | str view of data 41 | } 42 | \description{ 43 | Quick look at remote data 44 | } 45 | \examples{ 46 | 47 | if ( requireNamespace("DBI", quietly = TRUE) && 48 | requireNamespace("RSQLite", quietly = TRUE)) { 49 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 50 | DBI::dbWriteTable(my_db, 51 | 'd', 52 | data.frame(AUC = 0.6, R2 = 0.2), 53 | overwrite = TRUE, 54 | temporary = TRUE) 55 | rlook(my_db, 'd') 56 | DBI::dbDisconnect(my_db) 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /man/select_columns.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/select_columns.R 3 | \name{select_columns} 4 | \alias{select_columns} 5 | \title{Make a select columns node (not a relational operation).} 6 | \usage{ 7 | select_columns(source, columns, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{source to select from.} 11 | 12 | \item{columns}{list of distinct column names.} 13 | 14 | \item{env}{environment to look to.} 15 | } 16 | \value{ 17 | select columns node. 18 | } 19 | \description{ 20 | Make a select columns node (not a relational operation). 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d <- rq_copy_to(my_db, 'd', 27 | data.frame(AUC = 0.6, R2 = 0.2)) 28 | optree <- select_columns(d, 'AUC') 29 | cat(format(optree)) 30 | sql <- to_sql(optree, my_db) 31 | cat(sql) 32 | print(DBI::dbGetQuery(my_db, sql)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /man/select_rows.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/select_rows.R 3 | \name{select_rows} 4 | \alias{select_rows} 5 | \alias{select_rows_nse} 6 | \title{Make a select rows node.} 7 | \usage{ 8 | select_rows(source, expr, env = parent.frame()) 9 | 10 | select_rows_nse(source, expr, env = parent.frame()) 11 | } 12 | \arguments{ 13 | \item{source}{source to select from.} 14 | 15 | \item{expr}{expression to select rows.} 16 | 17 | \item{env}{environment to look to.} 18 | } 19 | \value{ 20 | select rows node. 21 | } 22 | \description{ 23 | Supports \code{bquote()} \code{.()}-style name abstraction including \code{.(-)} notation to promote strings to names 24 | (please see here: \url{https://github.com/WinVector/rquery/blob/master/Examples/Substitution/Substitution.md}). 25 | } 26 | \examples{ 27 | 28 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 29 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 30 | d <- rq_copy_to(my_db, 'd', 31 | data.frame(AUC = 0.6, R2 = 0.2, z = 3)) 32 | TARGETCOL = as.name("AUC") 33 | optree <- select_rows(d, .(TARGETCOL) >= 0.5) \%.>\% 34 | select_columns(., "R2") 35 | cat(format(optree)) 36 | sql <- to_sql(optree, my_db) 37 | cat(sql) 38 | print(DBI::dbGetQuery(my_db, sql)) 39 | DBI::dbDisconnect(my_db) 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /man/select_rows_se.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/select_rows.R 3 | \name{select_rows_se} 4 | \alias{select_rows_se} 5 | \title{Make a select rows node.} 6 | \usage{ 7 | select_rows_se(source, expr, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{source}{source to select from.} 11 | 12 | \item{expr}{expression to select rows.} 13 | 14 | \item{env}{environment to look for values in.} 15 | } 16 | \value{ 17 | select rows node. 18 | } 19 | \description{ 20 | Make a select rows node. 21 | } 22 | \examples{ 23 | 24 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 25 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 26 | d <- rq_copy_to(my_db, 'd', 27 | data.frame(AUC = 0.6, R2 = 0.2)) 28 | optree <- select_rows_se(d, "AUC >= 0.5") 29 | cat(format(optree)) 30 | sql <- to_sql(optree, my_db) 31 | cat(sql) 32 | print(DBI::dbGetQuery(my_db, sql)) 33 | DBI::dbDisconnect(my_db) 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /man/setDBOpt.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{setDBOpt} 4 | \alias{setDBOpt} 5 | \title{Set a database connection option.} 6 | \usage{ 7 | setDBOpt(db, optname, val) 8 | } 9 | \arguments{ 10 | \item{db}{rquery_db_info instance} 11 | 12 | \item{optname}{character, single option name.} 13 | 14 | \item{val}{value to set} 15 | } 16 | \value{ 17 | db 18 | } 19 | \description{ 20 | If db is of class rquery_db_info it sets the appropriate connection option, not the global state. 21 | } 22 | -------------------------------------------------------------------------------- /man/setDBOption.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/db_ops.R 3 | \name{setDBOption} 4 | \alias{setDBOption} 5 | \title{Set a database connection option.} 6 | \usage{ 7 | setDBOption(db, optname, val) 8 | } 9 | \arguments{ 10 | \item{db}{database connection handle.} 11 | 12 | \item{optname}{character, single option name.} 13 | 14 | \item{val}{value to set} 15 | } 16 | \value{ 17 | original options value 18 | } 19 | \description{ 20 | Note: we are moving away from global options to options in the DB handle. 21 | Prefer \code{\link{setDBOpt}}. 22 | } 23 | -------------------------------------------------------------------------------- /man/str_pre_sql_sub_expr.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/pre_sql.R 3 | \name{str_pre_sql_sub_expr} 4 | \alias{str_pre_sql_sub_expr} 5 | \title{Structure of a pre_sql_sub_expr} 6 | \usage{ 7 | str_pre_sql_sub_expr(x) 8 | } 9 | \arguments{ 10 | \item{x}{a pre_sql_sub_expr} 11 | } 12 | \value{ 13 | charcter presentation with {} denoting nesting 14 | } 15 | \description{ 16 | Structure of a pre_sql_sub_expr 17 | } 18 | \keyword{internal} 19 | -------------------------------------------------------------------------------- /man/tables_used.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/relop.R 3 | \name{tables_used} 4 | \alias{tables_used} 5 | \title{Return vector of table names used.} 6 | \usage{ 7 | tables_used(node, ...) 8 | } 9 | \arguments{ 10 | \item{node}{rquery tree to examine.} 11 | 12 | \item{...}{(not used)} 13 | } 14 | \value{ 15 | names of tables used. 16 | } 17 | \description{ 18 | Return vector of table names used. 19 | } 20 | \examples{ 21 | 22 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 23 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 24 | d1 <- rq_copy_to(my_db, 'd1', 25 | data.frame(AUC = 0.6, R2 = 0.2)) 26 | d2 <- rq_copy_to(my_db, 'd2', 27 | data.frame(AUC = 0.6, D = 0.3)) 28 | optree <- natural_join(d1, d2, by = "AUC") 29 | cat(format(optree)) 30 | print(tables_used(optree)) 31 | DBI::dbDisconnect(my_db) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/theta_join.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theta_join.R 3 | \name{theta_join} 4 | \alias{theta_join} 5 | \alias{theta_join_nse} 6 | \title{Make a theta_join node.} 7 | \usage{ 8 | theta_join( 9 | a, 10 | b, 11 | expr, 12 | ..., 13 | jointype = "INNER", 14 | suffix = c("_a", "_b"), 15 | env = parent.frame() 16 | ) 17 | 18 | theta_join_nse( 19 | a, 20 | b, 21 | expr, 22 | ..., 23 | jointype = "INNER", 24 | suffix = c("_a", "_b"), 25 | env = parent.frame() 26 | ) 27 | } 28 | \arguments{ 29 | \item{a}{source to select from.} 30 | 31 | \item{b}{source to select from.} 32 | 33 | \item{expr}{unquoted join condition} 34 | 35 | \item{...}{force later arguments to be by name} 36 | 37 | \item{jointype}{type of join ('INNER', 'LEFT', 'RIGHT', 'FULL').} 38 | 39 | \item{suffix}{character length 2, suffices to disambiguate columns.} 40 | 41 | \item{env}{environment to look for values in.} 42 | } 43 | \value{ 44 | theta_join node. 45 | } 46 | \description{ 47 | Theta join is a join on an arbitrary predicate. 48 | } 49 | \examples{ 50 | 51 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 52 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 53 | d1 <- rq_copy_to(my_db, 'd1', 54 | data.frame(AUC = 0.6, R2 = 0.2)) 55 | d2 <- rq_copy_to(my_db, 'd2', 56 | data.frame(AUC2 = 0.4, R2 = 0.3)) 57 | optree <- theta_join(d1, d2, AUC >= AUC2) 58 | cat(format(optree)) 59 | sql <- to_sql(optree, my_db) 60 | cat(sql) 61 | print(DBI::dbGetQuery(my_db, sql)) 62 | DBI::dbDisconnect(my_db) 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /man/theta_join_se.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/theta_join.R 3 | \name{theta_join_se} 4 | \alias{theta_join_se} 5 | \title{Make a theta_join node.} 6 | \usage{ 7 | theta_join_se( 8 | a, 9 | b, 10 | expr, 11 | ..., 12 | jointype = "INNER", 13 | suffix = c("_a", "_b"), 14 | env = parent.frame() 15 | ) 16 | } 17 | \arguments{ 18 | \item{a}{source to select from.} 19 | 20 | \item{b}{source to select from.} 21 | 22 | \item{expr}{quoted join conditions} 23 | 24 | \item{...}{force later arguments to be by name} 25 | 26 | \item{jointype}{type of join ('INNER', 'LEFT', 'RIGHT', 'FULL').} 27 | 28 | \item{suffix}{character length 2, suffices to disambiguate columns.} 29 | 30 | \item{env}{environment to look for values in.} 31 | } 32 | \value{ 33 | theta_join node. 34 | } 35 | \description{ 36 | Theta join is a join on an arbitrary predicate. 37 | } 38 | \examples{ 39 | 40 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 41 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 42 | d1 <- rq_copy_to(my_db, 'd1', 43 | data.frame(AUC = 0.6, R2 = 0.2)) 44 | d2 <- rq_copy_to(my_db, 'd2', 45 | data.frame(AUC2 = 0.4, R2 = 0.3)) 46 | optree <- theta_join_se(d1, d2, "AUC >= AUC2") 47 | cat(format(optree)) 48 | sql <- to_sql(optree, my_db) 49 | cat(sql) 50 | print(DBI::dbGetQuery(my_db, sql)) 51 | DBI::dbDisconnect(my_db) 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /man/to_transport_representation.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/yaml.R 3 | \name{to_transport_representation} 4 | \alias{to_transport_representation} 5 | \title{Convert an rquery op diagram to a simple representation, appropriate for conversion to YAML.} 6 | \usage{ 7 | to_transport_representation(ops, ..., convert_named_vectors_to_lists = TRUE) 8 | } 9 | \arguments{ 10 | \item{ops}{rquery operator dag} 11 | 12 | \item{...}{not used, force later arguments to be by name} 13 | 14 | \item{convert_named_vectors_to_lists}{logical, if TRUE convert named vectors to lists} 15 | } 16 | \value{ 17 | represenation structure 18 | } 19 | \description{ 20 | Convert an rquery op diagram to a simple representation, appropriate for conversion to YAML. 21 | } 22 | -------------------------------------------------------------------------------- /man/tokenize_for_SQL.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/tokenize_for_sql.R 3 | \name{tokenize_for_SQL} 4 | \alias{tokenize_for_SQL} 5 | \title{Cross-parse from an R parse tree into SQL.} 6 | \usage{ 7 | tokenize_for_SQL(lexpr, colnames, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{lexpr}{item from \code{substitute}} 11 | 12 | \item{colnames}{column names of table} 13 | 14 | \item{env}{environment to look for values} 15 | } 16 | \value{ 17 | sql info: list(presentation, parsed_toks(list of tokens), sql_text, symbols_used, symbols_produced, free_symbols) 18 | } 19 | \description{ 20 | Cross-parse from an R parse tree into SQL. 21 | } 22 | \examples{ 23 | 24 | tokenize_for_SQL(substitute(1 + 2), colnames= NULL) 25 | tokenize_for_SQL(substitute(a := 3), colnames= NULL) 26 | tokenize_for_SQL(substitute(a \%:=\% ( 3 + 4 )), colnames= NULL) 27 | 28 | } 29 | \keyword{internal} 30 | -------------------------------------------------------------------------------- /man/unionall.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/union_all.R 3 | \name{unionall} 4 | \alias{unionall} 5 | \title{Make an unionall node (not a relational operation).} 6 | \usage{ 7 | unionall(sources, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{sources}{list of relop trees or list of data.frames} 11 | 12 | \item{env}{environment to look to.} 13 | } 14 | \value{ 15 | order_by node or altered data.frame. 16 | } 17 | \description{ 18 | Concatenate tables by rows. 19 | } 20 | \examples{ 21 | 22 | if (requireNamespace("DBI", quietly = TRUE) && requireNamespace("RSQLite", quietly = TRUE)) { 23 | my_db <- DBI::dbConnect(RSQLite::SQLite(), ":memory:") 24 | d <- rq_copy_to(my_db, 'd', 25 | data.frame(AUC = 0.6, R2 = 0.2)) 26 | optree <- unionall(list(d, d, d)) 27 | cat(format(optree)) 28 | sql <- to_sql(optree, my_db, limit = 2) 29 | cat(sql) 30 | print(DBI::dbGetQuery(my_db, sql)) 31 | DBI::dbDisconnect(my_db) 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /man/wrap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/wrap_ex.R 3 | \name{wrap} 4 | \alias{wrap} 5 | \title{Wrap a data frame for later execution.} 6 | \usage{ 7 | wrap(d, ..., table_name = NULL, env = parent.frame()) 8 | } 9 | \arguments{ 10 | \item{d}{data.frame} 11 | 12 | \item{...}{not used, force later argument to be referred by name} 13 | 14 | \item{table_name}{character, name of table} 15 | 16 | \item{env}{environment to work in.} 17 | } 18 | \value{ 19 | a table description, with data attached 20 | } 21 | \description{ 22 | Create a table description that includes the actual data. Prevents wastefull table copies in 23 | immediate pipelines. Used with \code{ex()}. 24 | } 25 | \examples{ 26 | 27 | if(requireNamespace('rqdatatable')) { 28 | d <- data.frame(x = 1:3, y = 4:6) 29 | d \%.>\% 30 | wrap(.) \%.>\% 31 | extend(., z := x + y) \%.>\% 32 | ex(.) 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /rquery.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: knitr 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | -------------------------------------------------------------------------------- /tests/tinytest.R: -------------------------------------------------------------------------------- 1 | 2 | if ( requireNamespace("tinytest", quietly=TRUE) ){ 3 | tinytest::test_package("rquery") 4 | } 5 | 6 | -------------------------------------------------------------------------------- /tools/pipe_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/tools/pipe_diagram.png -------------------------------------------------------------------------------- /tools/rquery.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/tools/rquery.jpg -------------------------------------------------------------------------------- /vignettes/parameterized_rquery.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/vignettes/parameterized_rquery.png -------------------------------------------------------------------------------- /vignettes/present-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/vignettes/present-2.png -------------------------------------------------------------------------------- /vignettes/runtimes_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/WinVector/rquery/ce20c07536d8930fb59663778026e2cae380d489/vignettes/runtimes_1.png --------------------------------------------------------------------------------