galaaz 0.4.10 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +26 -0
- data/LICENSE +0 -0
- data/README.md +3123 -882
- data/Rakefile +62 -41
- data/bin/galaaz-bootstrap +137 -0
- data/bin/galaaz-jruby +14 -0
- data/bin/galaaz_jruby_env.inc.sh +6 -0
- data/bin/gbookdown +64 -0
- data/bin/gknit +223 -6
- data/bin/gknit-draft +105 -0
- data/bin/gknit-draft.rb +28 -0
- data/bin/gknit_Rscript +127 -0
- data/bin/grun +27 -1
- data/bin/gstudio +49 -4
- data/bin/{gstudio.rb → gstudio_irb.rb} +0 -0
- data/bin/gstudio_pry.rb +7 -0
- data/bin/install-tinytex +6 -0
- data/bin/run_all_rspec +43 -0
- data/bin/run_example +14 -0
- data/bin/run_old_rspec +19 -0
- data/bin/run_rspec +23 -0
- data/bin/run_rspec_subset +38 -0
- data/bin/run_slow_rspec +19 -0
- data/blogs/R-on-Rails-Planning-Document.md +940 -0
- data/blogs/README.md +100 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +38 -66
- data/blogs/galaaz_ggplot/galaaz_ggplot.log +754 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.md +364 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot.tex +607 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
- data/blogs/galaaz_ggplot/midwest.Rmd +3 -3
- data/blogs/galaaz_ggplot/midwest_external_png +0 -0
- data/blogs/gknit/gknit.Rmd +52 -55
- data/blogs/gknit/gknit.md +94 -94
- data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
- data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
- data/blogs/gknit/lst.rds +0 -0
- data/blogs/gknit/model.rb +1 -1
- data/blogs/gknit/stats.bib +0 -0
- data/blogs/manual/include_model_local_repro.Rmd +14 -0
- data/blogs/manual/include_model_local_repro.md +75 -0
- data/blogs/manual/lst.rds +0 -0
- data/blogs/manual/manual.Rmd +1582 -196
- data/blogs/manual/manual.log +1786 -0
- data/blogs/manual/manual.md +3107 -890
- data/blogs/manual/manual.tex +3018 -1086
- data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
- data/blogs/manual/manual_files/figure-html/diverging_bar.png +0 -0
- data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
- data/blogs/manual/model.rb +41 -0
- data/blogs/nse_dplyr/nse_dplyr.Rmd +277 -151
- data/blogs/nse_dplyr/nse_dplyr.log +928 -0
- data/blogs/nse_dplyr/nse_dplyr.md +457 -293
- data/blogs/oh_my/not_so.rb +0 -0
- data/blogs/oh_my/oh_my.Rmd +1234 -25
- data/blogs/oh_my/oh_my.log +804 -0
- data/blogs/oh_my/oh_my.md +1808 -228
- data/blogs/oh_my/oh_my.tex +821 -0
- data/blogs/oh_my/old.Rmd +15 -14
- data/blogs/ruby_plot/ruby_plot.Rmd +58 -82
- data/blogs/ruby_plot/ruby_plot.log +885 -0
- data/blogs/ruby_plot/ruby_plot.md +71 -103
- data/blogs/ruby_plot/ruby_plot.tex +940 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
- data/blogs/test/test.Rmd +14 -0
- data/examples/50Plots_MasterList/Images/midwest-scatterplot.PNG +0 -0
- data/examples/50Plots_MasterList/ScatterPlot.rb +0 -0
- data/examples/50Plots_MasterList/scatter_plot.rb +0 -0
- data/examples/Bibliography/master.bib +50 -0
- data/examples/Bibliography/stats.bib +72 -0
- data/examples/R/calc.R +0 -0
- data/examples/R/java_interop.R +0 -0
- data/examples/bioconductor_deseq2_airway/Documentation/DESeq2-airway-walkthrough.md +56 -0
- data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +53 -0
- data/examples/bioconductor_deseq2_airway/bench_r_three_same_process.R +34 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +33 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +34 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_minimal.R +30 -0
- data/examples/bioconductor_deseq2_airway/deseq2_airway_pipeline_for_bench.R +36 -0
- data/examples/islr/all.rb +13 -0
- data/examples/islr/ch2.spec.rb +37 -7
- data/examples/islr/ch3.spec.rb +11 -2
- data/examples/islr/ch3_boston.rb +27 -0
- data/examples/islr/ch3_multiple_regression.rb +0 -0
- data/examples/islr/ch6.spec.rb +24 -1
- data/examples/islr/x_y_rnorm.jpg +0 -0
- data/examples/latex_templates/Test-acm_article/Makefile +16 -0
- data/examples/latex_templates/Test-acm_article/Test-acm_article.Rmd +65 -0
- data/examples/latex_templates/Test-acm_article/acm_proc_article-sp.cls +1670 -0
- data/examples/latex_templates/Test-acm_article/sensys-abstract.cls +703 -0
- data/examples/latex_templates/Test-acm_article/sigproc.bib +59 -0
- data/examples/latex_templates/Test-acs_article/Test-acs_article.Rmd +260 -0
- data/examples/latex_templates/Test-acs_article/acs-Test-acs_article.bib +11 -0
- data/examples/latex_templates/Test-acs_article/acs-my_output.bib +11 -0
- data/examples/latex_templates/Test-acs_article/acstest.bib +17 -0
- data/examples/latex_templates/Test-aea_article/AEA.cls +1414 -0
- data/{blogs/gknit/marshal.dump → examples/latex_templates/Test-aea_article/BibFile.bib} +0 -0
- data/examples/latex_templates/Test-aea_article/Test-aea_article.Rmd +108 -0
- data/examples/latex_templates/Test-aea_article/aea.bst +1269 -0
- data/examples/latex_templates/Test-aea_article/multicol.sty +853 -0
- data/examples/latex_templates/Test-aea_article/references.bib +0 -0
- data/examples/latex_templates/Test-aea_article/setspace.sty +546 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.Rmd +256 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.pdfsync +3397 -0
- data/examples/latex_templates/Test-ams_article/Test-ams_article.Rmd +215 -0
- data/examples/latex_templates/Test-ams_article/amstest.bib +436 -0
- data/examples/latex_templates/Test-asa_article/Test-asa_article.Rmd +153 -0
- data/examples/latex_templates/Test-asa_article/agsm.bst +1353 -0
- data/examples/latex_templates/Test-asa_article/bibliography.bib +233 -0
- data/examples/latex_templates/Test-ieee_article/IEEEtran.bst +2409 -0
- data/examples/latex_templates/Test-ieee_article/IEEEtran.cls +6346 -0
- data/examples/latex_templates/Test-ieee_article/Test-ieee_article.Rmd +175 -0
- data/examples/latex_templates/Test-ieee_article/mybibfile.bib +20 -0
- data/examples/latex_templates/Test-rjournal_article/RJournal.sty +335 -0
- data/examples/latex_templates/Test-rjournal_article/RJreferences.bib +18 -0
- data/examples/latex_templates/Test-rjournal_article/Test-rjournal_article.Rmd +52 -0
- data/examples/latex_templates/Test-springer_article/Test-springer_article.Rmd +65 -0
- data/examples/latex_templates/Test-springer_article/bibliography.bib +26 -0
- data/examples/latex_templates/Test-springer_article/spbasic.bst +1658 -0
- data/examples/latex_templates/Test-springer_article/spmpsci.bst +1512 -0
- data/examples/latex_templates/Test-springer_article/spphys.bst +1443 -0
- data/examples/latex_templates/Test-springer_article/svglov3.clo +113 -0
- data/examples/latex_templates/Test-springer_article/svjour3.cls +1431 -0
- data/examples/misc/baseball.csv +0 -0
- data/examples/misc/ggplot.rb +3 -2
- data/examples/misc/moneyball.rb +0 -0
- data/examples/misc/subsetting.rb +0 -0
- data/examples/multithread_shards_to_r/shards_to_r.rb +67 -0
- data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.Rmd +73 -0
- data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.Rmd +382 -0
- data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.Rmd +164 -0
- data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.Rmd +92 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/attend-grade-relationships.csv +482 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.Rmd +280 -0
- data/examples/rmarkdown/svm-xaringan-example/svm-xaringan-example.Rmd +386 -0
- data/examples/sthda_ggplot/README.md +0 -0
- data/examples/sthda_ggplot/RUN.md +41 -0
- data/examples/sthda_ggplot/all.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +2 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +0 -0
- data/examples/sthda_ggplot/one_variable_continuous/stat.rb +0 -0
- data/examples/sthda_ggplot/one_variable_discrete/bar.rb +0 -0
- data/examples/sthda_ggplot/qplots/box_violin_dot.rb +0 -0
- data/examples/sthda_ggplot/qplots/scatter_plots.rb +0 -0
- data/examples/sthda_ggplot/scatter_gg.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +0 -0
- data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +4 -3
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +0 -0
- data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +0 -0
- data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +0 -0
- data/ext/new_bridge/Makefile +46 -0
- data/ext/new_bridge/galaaz_gatekeeper_phase0.cpp +12 -0
- data/ext/new_bridge/galaaz_gatekeeper_phase1.cpp +1639 -0
- data/lib/R_interface/galaaz_device.R +20 -0
- data/lib/R_interface/include_engine.R +109 -0
- data/lib/R_interface/new_bridge_adapter.rb +824 -0
- data/lib/R_interface/r.rb +177 -25
- data/lib/R_interface/r_arrow.rb +113 -0
- data/lib/R_interface/r_libs.R +4 -4
- data/lib/R_interface/r_methods.rb +13 -116
- data/lib/R_interface/r_module_s.rb +0 -0
- data/lib/R_interface/rbinary_operators.rb +20 -2
- data/lib/R_interface/rclosure.rb +5 -1
- data/lib/R_interface/rdata_frame.rb +34 -70
- data/lib/R_interface/rdevice.rb +125 -0
- data/lib/R_interface/rdevices.R +0 -0
- data/lib/R_interface/renvironment.rb +10 -4
- data/lib/R_interface/rexpression.rb +5 -1
- data/lib/R_interface/rindexed_object.rb +41 -13
- data/lib/R_interface/rlanguage.rb +20 -62
- data/lib/R_interface/rlist.rb +115 -25
- data/lib/R_interface/rlogical_operators.rb +0 -0
- data/lib/R_interface/rmatrix.rb +2 -11
- data/lib/R_interface/rmd_indexed_object.rb +5 -1
- data/lib/R_interface/robject.rb +348 -290
- data/lib/R_interface/rpkg.rb +1 -0
- data/lib/R_interface/rsupport.rb +610 -331
- data/lib/R_interface/rsupport_scope.rb +2 -1
- data/lib/R_interface/rsymbol.rb +50 -0
- data/lib/R_interface/ruby_callback.rb +2 -3
- data/lib/R_interface/ruby_extensions.rb +225 -175
- data/lib/R_interface/runary_operators.rb +0 -0
- data/lib/R_interface/rvector.rb +147 -31
- data/lib/galaaz.rb +0 -0
- data/lib/galaaz_jruby.rb +22 -0
- data/lib/gknit/diagnostics.rb +50 -0
- data/lib/gknit/draft.rb +111 -0
- data/lib/gknit/include_engine.rb +15 -7
- data/lib/gknit/knitr_engine.rb +223 -107
- data/lib/gknit/rb_engine.rb +3 -3
- data/lib/gknit/ruby_engine.rb +0 -0
- data/lib/gknit.rb +3 -0
- data/lib/new_bridge/bootstrap/windows_bootstrap.rb +285 -0
- data/lib/new_bridge/envelope.rb +51 -0
- data/lib/new_bridge/eval_result.rb +26 -0
- data/lib/new_bridge/framing.rb +39 -0
- data/lib/new_bridge/instance_pool_client.rb +38 -0
- data/lib/new_bridge/r_instance_manager.rb +404 -0
- data/lib/new_bridge/session_client.rb +530 -0
- data/lib/new_bridge/tcp_framed.rb +44 -0
- data/lib/new_bridge.rb +9 -0
- data/lib/util/exec_ruby.rb +95 -46
- data/lib/util/inline_file.rb +35 -30
- data/new_bridge_specs/benchmark_phase5_5_unboxing_spec.rb +96 -0
- data/new_bridge_specs/eval_r_async_spec.rb +113 -0
- data/new_bridge_specs/integration_phase5_1_concurrent_spec.rb +50 -0
- data/new_bridge_specs/integration_phase5_1_eval_spec.rb +16 -0
- data/new_bridge_specs/integration_phase5_1_r_api_spec.rb +25 -0
- data/new_bridge_specs/integration_phase5_1_smoke_spec.rb +31 -0
- data/new_bridge_specs/integration_phase5_2_dataframe_unboxing_spec.rb +19 -0
- data/new_bridge_specs/integration_phase5_2_handle_eval_unboxing_spec.rb +25 -0
- data/new_bridge_specs/integration_phase5_3_callback_args_spec.rb +28 -0
- data/new_bridge_specs/integration_phase5_3_callback_error_spec.rb +22 -0
- data/new_bridge_specs/integration_phase5_3_callback_timeout_spec.rb +28 -0
- data/new_bridge_specs/integration_phase5_3_callbacks_smoke_spec.rb +22 -0
- data/new_bridge_specs/integration_phase5_3_edge_cases_spec.rb +52 -0
- data/new_bridge_specs/integration_phase5_3_nested_spec.rb +30 -0
- data/new_bridge_specs/integration_phase5_4_concurrent_sessions_spec.rb +53 -0
- data/new_bridge_specs/integration_phase5_4_nested_session_callbacks_spec.rb +49 -0
- data/new_bridge_specs/integration_phase5_4_session_routing_spec.rb +38 -0
- data/new_bridge_specs/integration_phase5_5_stress_concurrency_spec.rb +52 -0
- data/new_bridge_specs/integration_phase5_5_unbox_walk_spec.rb +46 -0
- data/new_bridge_specs/phase0_protocol_spec.rb +96 -0
- data/new_bridge_specs/phase1_req_ret_spec.rb +66 -0
- data/new_bridge_specs/phase2_multi_instance_spec.rb +67 -0
- data/new_bridge_specs/phase3_callbacks_spec.rb +71 -0
- data/new_bridge_specs/phase4_2_hardening_spec.rb +252 -0
- data/new_bridge_specs/phase4_3_r_instance_manager_spec.rb +85 -0
- data/new_bridge_specs/phase4_nested_callbacks_spec.rb +123 -0
- data/r_requires/ggplot.rb +0 -0
- data/r_requires/knitr.rb +0 -0
- data/specs/all.rb +15 -11
- data/specs/arrow_from_ruby_batches_spec.rb +50 -0
- data/specs/arrow_semantics_spec.rb +64 -0
- data/specs/bridge_concurrent_spec.rb +46 -0
- data/specs/bridge_nested_spec.rb +25 -0
- data/specs/dataframe_semantics_spec.rb +122 -0
- data/specs/dataframe_single_index_logical_filter_spec.rb +21 -0
- data/specs/dispatch_probe_cache_spec.rb +38 -0
- data/specs/dispatch_probe_error_class_fallback_spec.rb +20 -0
- data/specs/dispatch_probe_fallback_spec.rb +18 -0
- data/specs/environment_semantics_spec.rb +89 -0
- data/specs/field_access_spec.rb +31 -0
- data/specs/figures/bg.jpeg +0 -0
- data/specs/figures/bg.png +0 -0
- data/specs/figures/bg.svg +168 -57
- data/specs/figures/dose_len.png +0 -0
- data/specs/figures/no_args.jpeg +0 -0
- data/specs/figures/no_args.png +0 -0
- data/specs/figures/no_args.svg +168 -57
- data/specs/figures/width_height.jpeg +0 -0
- data/specs/figures/width_height.png +0 -0
- data/specs/figures/width_height_units1.jpeg +0 -0
- data/specs/figures/width_height_units1.png +0 -0
- data/specs/figures/width_height_units2.jpeg +0 -0
- data/specs/figures/width_height_units2.png +0 -0
- data/specs/formula_semantics_spec.rb +81 -0
- data/specs/galaaz_util_exec_ruby_spec.rb +85 -0
- data/specs/galaaz_util_inline_file_spec.rb +54 -0
- data/specs/gknit_cli_option_permutation_spec.rb +24 -0
- data/specs/gknit_include_engine_spec.rb +72 -0
- data/specs/gknit_install_timeout_report_spec.rb +69 -0
- data/specs/gknit_internal_error_report_spec.rb +57 -0
- data/specs/gknit_vector_map_output_spec.rb +59 -0
- data/specs/globalenv_guardrail_spec.rb +52 -0
- data/specs/language_expression_semantics_spec.rb +145 -0
- data/specs/list_semantics_spec.rb +111 -0
- data/specs/new_bridge_bulk_dataframe_transfer_spec.rb +44 -0
- data/specs/new_bridge_bulk_vector_transfer_spec.rb +73 -0
- data/specs/new_bridge_callback_timeout_spec.rb +69 -0
- data/specs/new_bridge_eval_r_fallback_spec.rb +55 -0
- data/specs/nil_null_spec.rb +42 -0
- data/specs/object_build_phase2_spec.rb +53 -0
- data/specs/phase1_callback_bridge_spec.rb +84 -0
- data/specs/phase2_gknit_generic_rendering_guardrail_spec.rb +46 -0
- data/specs/phase2_gknit_no_raw_code_leakage_spec.rb +43 -0
- data/specs/phase3_gknit_generic_graphics_capture_spec.rb +71 -0
- data/specs/plot_device_semantics_spec.rb +28 -0
- data/specs/plot_snapshot_semantics_spec.rb +58 -0
- data/specs/protocol_result_spec.rb +236 -0
- data/specs/r_batch_fail_fast_spec.rb +47 -0
- data/specs/r_bridge_bootstrap_spec.rb +11 -0
- data/specs/r_devices.spec.rb +1 -1
- data/specs/r_eval.spec.rb +16 -18
- data/specs/r_function.spec.rb +1 -1
- data/specs/r_instance_manager_spec.rb +285 -0
- data/specs/r_list_apply.spec.rb +15 -15
- data/specs/r_matrix.spec.rb +0 -0
- data/specs/r_nse.spec.rb +5 -5
- data/specs/r_object_send_dispatch_spec.rb +13 -0
- data/specs/r_vector_comparator_spec.rb +8 -0
- data/specs/r_vector_creation.spec.rb +0 -0
- data/specs/r_vector_functions.spec.rb +0 -0
- data/specs/r_vector_object.spec.rb +0 -0
- data/specs/r_vector_operators.spec.rb +0 -0
- data/specs/r_vector_structured_scalar_reads_spec.rb +35 -0
- data/specs/r_vector_subsetting.spec.rb +0 -0
- data/specs/range_helper_spec.rb +21 -0
- data/specs/rsupport_scope_spec.rb +28 -0
- data/specs/rsupport_var_name_thread_safety_spec.rb +24 -0
- data/specs/scalar_character_spec.rb +44 -0
- data/specs/scoped_symbol_dsl_refinement_spec.rb +40 -0
- data/specs/session_env_bridge_spec.rb +25 -0
- data/specs/simplecov_bootstrap_spec.rb +10 -0
- data/specs/spec_helper.rb +10 -0
- data/specs/tmp.rb +41 -20
- data/specs/unboxing_recursion_regression_spec.rb +30 -0
- data/specs/unboxing_spec.rb +49 -0
- data/specs/verify_callbacks.rb +42 -0
- data/sty/galaaz.sty +0 -0
- data/version.rb +1 -1
- metadata +239 -71
- data/blogs/galaaz_ggplot/galaaz_ggplot.aux +0 -41
- data/blogs/galaaz_ggplot/galaaz_ggplot.html +0 -705
- data/blogs/galaaz_ggplot/galaaz_ggplot.out +0 -10
- data/blogs/galaaz_ggplot/galaaz_ggplot.pdf +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/midwest_rb.pdf +0 -0
- data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/scatter_plot_rb.pdf +0 -0
- data/blogs/galaaz_ggplot/midwest.html +0 -188
- data/blogs/gknit/gknit.html +0 -2266
- data/blogs/gknit/gknit.pdf +0 -0
- data/blogs/gknit/gknit.tex +0 -1358
- data/blogs/manual/graph.rb +0 -29
- data/blogs/manual/manual.html +0 -2995
- data/blogs/manual/manual.pdf +0 -0
- data/blogs/manual/manual_files/figure-latex/diverging_bar.pdf +0 -0
- data/blogs/nse_dplyr/nse_dplyr.html +0 -960
- data/blogs/nse_dplyr/nse_dplyr.pdf +0 -0
- data/blogs/nse_dplyr/nse_dplyr.tex +0 -1373
- data/blogs/oh_my/oh_my.html +0 -680
- data/blogs/ruby_plot/ruby_plot.Rmd_external_figs +0 -662
- data/blogs/ruby_plot/ruby_plot.html +0 -729
- data/blogs/ruby_plot/ruby_plot.pdf +0 -0
- data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.svg +0 -57
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.svg +0 -106
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.svg +0 -110
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.svg +0 -174
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.svg +0 -236
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.svg +0 -296
- data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.svg +0 -236
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.svg +0 -218
- data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.svg +0 -128
- data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.svg +0 -150
- data/examples/paper/paper.rb +0 -36
- data/specs/r_dataframe.spec.rb +0 -379
- data/specs/r_environment.spec.rb +0 -140
- data/specs/r_formula.spec.rb +0 -232
- data/specs/r_language.spec.rb +0 -112
- data/specs/r_list.spec.rb +0 -293
- data/specs/r_plots.spec.rb +0 -72
- data/specs/ruby_expression.spec.rb +0 -315
data/blogs/gknit/gknit.Rmd
CHANGED
|
@@ -3,17 +3,18 @@ title: "How to do reproducible research in Ruby with gKnit"
|
|
|
3
3
|
author:
|
|
4
4
|
- "Rodrigo Botafogo"
|
|
5
5
|
- "Daniel Mossé - University of Pittsburgh"
|
|
6
|
-
tags: [Tech, Data Science, Ruby, R,
|
|
7
|
-
date: "29/04/2019"
|
|
6
|
+
tags: [Tech, Data Science, Ruby, R, JRuby, "GNU R", Galaaz, gKnit, knitr]
|
|
7
|
+
date: "29/04/2019 (narrative updated for Galaaz 2.0, 2026)"
|
|
8
8
|
bibliography: stats.bib
|
|
9
9
|
output:
|
|
10
|
-
html_document:
|
|
11
|
-
self_contained: true
|
|
12
|
-
keep_md: true
|
|
13
10
|
pdf_document:
|
|
14
11
|
includes:
|
|
15
12
|
in_header: ["../../sty/galaaz.sty"]
|
|
16
13
|
number_sections: yes
|
|
14
|
+
html_document:
|
|
15
|
+
self_contained: true
|
|
16
|
+
keep_md: true
|
|
17
|
+
biblio-style: apsr
|
|
17
18
|
---
|
|
18
19
|
|
|
19
20
|
```{r setup, echo=FALSE}
|
|
@@ -39,7 +40,7 @@ single document or set of documents that when distributed to peers could be reru
|
|
|
39
40
|
the same output and reports.
|
|
40
41
|
|
|
41
42
|
The R community has put a great deal of effort in reproducible research. In 2002, Sweave was
|
|
42
|
-
introduced and it allowed mixing R code with
|
|
43
|
+
introduced and it allowed mixing R code with LaTeX, generating high-quality PDF documents. A
|
|
43
44
|
Sweave document could include code, the results of executing the code, graphics and text
|
|
44
45
|
such that it contained the whole narrative to reproduce the research. In
|
|
45
46
|
2012, Knitr, developed by Yihui Xie from RStudio was released to replace Sweave and to
|
|
@@ -48,7 +49,7 @@ were necessary for Sweave.
|
|
|
48
49
|
|
|
49
50
|
With Knitr, __R markdown__ was also developed, an extension to the
|
|
50
51
|
Markdown format. With __R markdown__ and Knitr it is possible to generate reports in a multitude
|
|
51
|
-
of formats such as HTML,
|
|
52
|
+
of formats such as HTML, Markdown, LaTeX, PDF, DVI, etc. __R markdown__ also allows the use of
|
|
52
53
|
multiple programming languages such as R, Ruby, Python, etc. in the same document.
|
|
53
54
|
|
|
54
55
|
In __R markdown__, text is interspersed with
|
|
@@ -95,8 +96,8 @@ puts lst
|
|
|
95
96
|
```
|
|
96
97
|
|
|
97
98
|
In the Python community, the same effort to have code and text in an integrated environment
|
|
98
|
-
started around the first decade of
|
|
99
|
-
Fernando Pérez
|
|
99
|
+
started around the first decade of the 2000s. In 2006 IPython 0.7.2 was released. In 2014,
|
|
100
|
+
Fernando Pérez spun off the Jupyter project from IPython, creating a web-based interactive
|
|
100
101
|
computation environment. Jupyter can now be used with many languages, including Ruby with the
|
|
101
102
|
iruby gem (https://github.com/SciRuby/iruby). In order to have multiple languages in a Jupyter
|
|
102
103
|
notebook the SoS kernel was developed (https://vatlab.github.io/sos-docs/).
|
|
@@ -108,15 +109,14 @@ written both in Ruby and/or R and output it in any of the available formats of _
|
|
|
108
109
|
allows ruby developers to do literate programming and reproducible research by allowing them to
|
|
109
110
|
have in a single document, text and code.
|
|
110
111
|
|
|
111
|
-
gKnit runs
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
with Ruby and R is quite natural.
|
|
112
|
+
gKnit runs with **JRuby**, **GNU R**, and **Galaaz** (the integration layer between Ruby and R—see below).
|
|
113
|
+
Knitr and **R Markdown** orchestrate the document; Galaaz’s engine keeps **Ruby state across chunks**
|
|
114
|
+
and talks to R through the **bridge**. Ruby chunks can read and update R variables (`~R[:name]`, `R.*`)
|
|
115
|
+
without GraalVM-style polyglot interop.
|
|
116
116
|
|
|
117
117
|
Galaaz has already been describe in the following posts:
|
|
118
118
|
|
|
119
|
-
* https://towardsdatascience.com/ruby-plotting-with-galaaz-an-example-of-tightly-coupling-ruby-and-r-in-graalvm-520b69e21021.
|
|
119
|
+
* https://towardsdatascience.com/ruby-plotting-with-galaaz-an-example-of-tightly-coupling-ruby-and-r-in-graalvm-520b69e21021 (older GraalVM-era article; plotting ideas still apply).
|
|
120
120
|
* https://medium.freecodecamp.org/how-to-make-beautiful-ruby-plots-with-galaaz-320848058857
|
|
121
121
|
|
|
122
122
|
This is not a blog post on __R markdown__, and the interested user is directed to the following links
|
|
@@ -131,7 +131,7 @@ gKnitting Ruby and R documents quickly.
|
|
|
131
131
|
## The Yaml header
|
|
132
132
|
|
|
133
133
|
An __R markdown__ document should start with a Yaml header and be stored in a file with
|
|
134
|
-
'.Rmd' extension. This document has the following header for
|
|
134
|
+
'.Rmd' extension. This document has the following header for gKnitting an HTML document.
|
|
135
135
|
|
|
136
136
|
```
|
|
137
137
|
---
|
|
@@ -139,7 +139,7 @@ title: "How to do reproducible research in Ruby with gKnit"
|
|
|
139
139
|
author:
|
|
140
140
|
- "Rodrigo Botafogo"
|
|
141
141
|
- "Daniel Mossé - University of Pittsburgh"
|
|
142
|
-
tags: [Tech, Data Science, Ruby, R,
|
|
142
|
+
tags: [Tech, Data Science, Ruby, R, JRuby, "GNU R", Galaaz]
|
|
143
143
|
date: "20/02/2019"
|
|
144
144
|
output:
|
|
145
145
|
html_document:
|
|
@@ -198,7 +198,7 @@ Running and executing Ruby and R code is actually what really interests us is th
|
|
|
198
198
|
Inserting a code chunk is done by adding code in a block delimited by three back ticks
|
|
199
199
|
followed by an open
|
|
200
200
|
curly brace ('{') followed with the engine name (r, ruby, rb, include, ...), an
|
|
201
|
-
any optional chunk_label and options, as shown
|
|
201
|
+
any optional chunk_label and options, as shown below:
|
|
202
202
|
|
|
203
203
|
````
|
|
204
204
|
```{engine_name [chunk_label], [chunk_options]}`r ''`
|
|
@@ -287,7 +287,7 @@ grammar of graphics" [@Wilkinson:grammar_of_graphics]. The idea of the grammar o
|
|
|
287
287
|
is to build a graphics by adding layers to the plot. More information can be found in
|
|
288
288
|
https://towardsdatascience.com/a-comprehensive-guide-to-the-grammar-of-graphics-for-effective-visualization-of-multi-dimensional-1f92b4ed4149.
|
|
289
289
|
|
|
290
|
-
In the plot
|
|
290
|
+
In the plot below the 'mpg' dataset from base R is used. "The data concerns city-cycle fuel
|
|
291
291
|
consumption in miles per gallon, to be predicted in terms of 3 multivalued discrete and 5
|
|
292
292
|
continuous attributes." (Quinlan, 1993)
|
|
293
293
|
|
|
@@ -368,21 +368,21 @@ where multiplication works as expected.
|
|
|
368
368
|
|
|
369
369
|
### Accessing R from Ruby
|
|
370
370
|
|
|
371
|
-
One of the nice aspects of Galaaz
|
|
371
|
+
One of the nice aspects of Galaaz 2.0 is that variables and functions defined in R can
|
|
372
372
|
be easily accessed from Ruby. This next chunk, reads data from R and uses the 'reduce_sum'
|
|
373
373
|
function defined previously. To access an R variable from Ruby the '~' function should be
|
|
374
374
|
applied to the Ruby symbol representing the R variable. Since the R variable is called 'r_vec',
|
|
375
|
-
in Ruby, the symbol to acess it is ':r_vec' and thus '
|
|
375
|
+
in Ruby, the symbol to acess it is ':r_vec' and thus '~R[:r_vec]' retrieves the value of the
|
|
376
376
|
variable.
|
|
377
377
|
|
|
378
378
|
```{ruby access_r}
|
|
379
|
-
puts
|
|
379
|
+
puts ~R[:r_vec]
|
|
380
380
|
```
|
|
381
381
|
|
|
382
382
|
In order to call an R function, the 'R.' module is used as follows
|
|
383
383
|
|
|
384
384
|
```{ruby call_r_func}
|
|
385
|
-
puts R.reduce_sum(
|
|
385
|
+
puts R.reduce_sum(~R[:r_vec])
|
|
386
386
|
```
|
|
387
387
|
|
|
388
388
|
### Ruby Plotting
|
|
@@ -409,7 +409,7 @@ ten aspects are:
|
|
|
409
409
|
|
|
410
410
|
```{ruby diverging_plot_pre}
|
|
411
411
|
# copy the R variable :mtcars to the Ruby mtcars variable
|
|
412
|
-
mtcars =
|
|
412
|
+
mtcars = ~R[:mtcars]
|
|
413
413
|
|
|
414
414
|
# create a new column 'car_name' to store the car names so that it can be
|
|
415
415
|
# used for plotting. The 'rownames' of the data frame cannot be used as
|
|
@@ -562,17 +562,17 @@ Here, for instance, is a table definition in HTML and its output in the document
|
|
|
562
562
|
</div>
|
|
563
563
|
|
|
564
564
|
But manually creating HTML output is not always easy or desirable, specially
|
|
565
|
-
if we intend the document to be rendered in other formats, for example, as
|
|
565
|
+
if we intend the document to be rendered in other formats, for example, as LaTeX.
|
|
566
566
|
Also, The above
|
|
567
567
|
table looks ugly. The 'kableExtra' library is a great library for
|
|
568
568
|
creating beautiful tables. Take a look at https://cran.r-project.org/web/packages/kableExtra/vignettes/awesome_table_in_html.html
|
|
569
569
|
|
|
570
570
|
In the next chunk, we output the 'mtcars' dataframe from R in a nicely formatted
|
|
571
|
-
table. Note that we retrieve the mtcars dataframe by using '
|
|
571
|
+
table. Note that we retrieve the mtcars dataframe by using '~R[:mtcars]'.
|
|
572
572
|
|
|
573
573
|
```{ruby nice_table}
|
|
574
574
|
R.install_and_loads('kableExtra')
|
|
575
|
-
outputs (
|
|
575
|
+
outputs (~R[:mtcars]).kable.kable_styling
|
|
576
576
|
```
|
|
577
577
|
|
|
578
578
|
### Including Ruby files in a chunk
|
|
@@ -600,7 +600,7 @@ true, ruby's 'require\_relative' semantics is used to load the file, when false,
|
|
|
600
600
|
```
|
|
601
601
|
````
|
|
602
602
|
|
|
603
|
-
|
|
603
|
+
Below we include file 'model.rb', which is in the same directory of this blog.
|
|
604
604
|
This code uses R 'caret' package to split a dataset in a train and test sets.
|
|
605
605
|
The 'caret' package is a very important a useful package for doing Data Analysis,
|
|
606
606
|
it has hundreds of functions for all steps of the Data Analysis workflow. To
|
|
@@ -621,7 +621,7 @@ will install the package if it is not already installed and can take a while.
|
|
|
621
621
|
```
|
|
622
622
|
|
|
623
623
|
```{ruby model_partition}
|
|
624
|
-
mtcars =
|
|
624
|
+
mtcars = ~R[:mtcars]
|
|
625
625
|
model = Model.new(mtcars, percent_train: 0.8)
|
|
626
626
|
model.partition(:mpg)
|
|
627
627
|
puts model.train.head
|
|
@@ -633,9 +633,9 @@ puts model.test.head
|
|
|
633
633
|
gKnit also allows developers to document and load files that are not in the same directory
|
|
634
634
|
of the '.Rmd' file.
|
|
635
635
|
|
|
636
|
-
Here is an example of loading the 'find.rb' file from
|
|
636
|
+
Here is an example of loading the 'find.rb' file from **JRuby** (via `$LOAD_PATH`). In this example, relative
|
|
637
637
|
is set to FALSE, so Ruby will look for the file in its $LOAD\_PATH, and the user does not
|
|
638
|
-
need to
|
|
638
|
+
need to know its directory.
|
|
639
639
|
|
|
640
640
|
````
|
|
641
641
|
```{include find, relative = FALSE}`r ''`
|
|
@@ -657,9 +657,9 @@ the Yaml header to generate this blog in PDF format instead of HTML:
|
|
|
657
657
|
|
|
658
658
|
```
|
|
659
659
|
---
|
|
660
|
-
title: "gKnit - Ruby and R Knitting with Galaaz
|
|
660
|
+
title: "gKnit - Ruby and R Knitting with Galaaz (JRuby + GNU R)"
|
|
661
661
|
author: "Rodrigo Botafogo"
|
|
662
|
-
tags: [Galaaz, Ruby, R,
|
|
662
|
+
tags: [Galaaz, Ruby, R, JRuby, "GNU R", knitr, gknit]
|
|
663
663
|
date: "29 October 2018"
|
|
664
664
|
output:
|
|
665
665
|
pdf\_document:
|
|
@@ -672,27 +672,23 @@ output:
|
|
|
672
672
|
|
|
673
673
|
# Conclusion
|
|
674
674
|
|
|
675
|
-
In order to do reproducible research, one of the main basic tools needed is a
|
|
675
|
+
In order to do reproducible research, one of the main basic tools needed is a system that
|
|
676
676
|
allows "literate programming" where text, code and possibly a set of files can be compiled
|
|
677
677
|
onto a report that can be easily distributed to peers. Peers should be able to use this
|
|
678
678
|
same set of files to rerun the compilation by their own obtaining the exact same original
|
|
679
679
|
report. gKnit is such a system for Ruby and R. It uses __R Markdown__ to integrate
|
|
680
|
-
text and code chunks, where code chunks can either be part of the __R
|
|
680
|
+
text and code chunks, where code chunks can either be part of the __R Markdown__ file or
|
|
681
681
|
be imported from files in the system. Ideally, in reproducible research, all the files
|
|
682
|
-
needed to rebuild a report should be
|
|
682
|
+
needed to rebuild a report should be easily packed together (in the same zipped directory)
|
|
683
683
|
and distributed to peers for reexecution.
|
|
684
684
|
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
same effort it is taking Python to implement NumPy, Pandas and all supporting libraries and it
|
|
693
|
-
is unlikely that this effort would ever be done. GraalVM has allowed Ruby to profit "almost
|
|
694
|
-
for free" from this huge set of libraries and tools that make R one of the most used
|
|
695
|
-
languages for data analysis and machine learning.
|
|
685
|
+
**Galaaz 2.0** pairs **JRuby** with **GNU R**: you keep the full CRAN/Bioconductor world in R while
|
|
686
|
+
writing orchestration, reuse, and application code in Ruby. The effort to wrap Ruby over R (Galaaz)
|
|
687
|
+
and to wrap Knitr as gKnit was tiny compared to reimplementing R’s ecosystem in Ruby—much like
|
|
688
|
+
Python’s investment in NumPy and Pandas, which no Ruby project is likely to duplicate.
|
|
689
|
+
|
|
690
|
+
An **earlier** prototype used Oracle’s **GraalVM** and Truffle interop; the **current** stack is
|
|
691
|
+
deliberately **standard GNU R** plus the Galaaz **bridge**, documented in the project manual.
|
|
696
692
|
|
|
697
693
|
More interesting than wrapping the R libraries with Ruby, is that Ruby adds
|
|
698
694
|
value to R, by allowing developers to use powerful and modern constructs for code reuse that
|
|
@@ -702,11 +698,10 @@ readability.
|
|
|
702
698
|
|
|
703
699
|
# Installing gKnit
|
|
704
700
|
|
|
705
|
-
## Prerequisites
|
|
701
|
+
## Prerequisites (Galaaz 2.0)
|
|
706
702
|
|
|
707
|
-
*
|
|
708
|
-
*
|
|
709
|
-
* FastR
|
|
703
|
+
* **JRuby** and a compatible **JDK**
|
|
704
|
+
* **GNU R** on your `PATH`
|
|
710
705
|
|
|
711
706
|
The following R packages will be automatically installed when necessary, but could be installed prior
|
|
712
707
|
to using gKnit if desired:
|
|
@@ -715,16 +710,18 @@ to using gKnit if desired:
|
|
|
715
710
|
* gridExtra
|
|
716
711
|
* knitr
|
|
717
712
|
|
|
718
|
-
Installation of R packages requires a development environment and can be time consuming.
|
|
719
|
-
the
|
|
713
|
+
Installation of R packages requires a development environment and can be time consuming. On Linux,
|
|
714
|
+
the usual build tools are typically enough. On macOS, Xcode command-line tools are commonly required.
|
|
720
715
|
|
|
721
716
|
## Preparation
|
|
722
717
|
|
|
723
|
-
* gem
|
|
718
|
+
* Install the **galaaz** gem (RubyGems or a local build / `path:`).
|
|
724
719
|
|
|
725
720
|
## Usage
|
|
726
721
|
|
|
727
|
-
* gknit \<filename\>
|
|
722
|
+
* **`bin/gknit`** \<filename\> (from the Galaaz repo or your install layout); use **`--output_format all`** for HTML and PDF together.
|
|
723
|
+
* Run Ruby with **`bin/galaaz-jruby`** when you need the same JVM flags as the project (see the manual).
|
|
724
|
+
|
|
728
725
|
|
|
729
726
|
# References
|
|
730
727
|
|