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.
Files changed (391) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +26 -0
  3. data/LICENSE +0 -0
  4. data/README.md +3123 -882
  5. data/Rakefile +62 -41
  6. data/bin/galaaz-bootstrap +137 -0
  7. data/bin/galaaz-jruby +14 -0
  8. data/bin/galaaz_jruby_env.inc.sh +6 -0
  9. data/bin/gbookdown +64 -0
  10. data/bin/gknit +223 -6
  11. data/bin/gknit-draft +105 -0
  12. data/bin/gknit-draft.rb +28 -0
  13. data/bin/gknit_Rscript +127 -0
  14. data/bin/grun +27 -1
  15. data/bin/gstudio +49 -4
  16. data/bin/{gstudio.rb → gstudio_irb.rb} +0 -0
  17. data/bin/gstudio_pry.rb +7 -0
  18. data/bin/install-tinytex +6 -0
  19. data/bin/run_all_rspec +43 -0
  20. data/bin/run_example +14 -0
  21. data/bin/run_old_rspec +19 -0
  22. data/bin/run_rspec +23 -0
  23. data/bin/run_rspec_subset +38 -0
  24. data/bin/run_slow_rspec +19 -0
  25. data/blogs/R-on-Rails-Planning-Document.md +940 -0
  26. data/blogs/README.md +100 -0
  27. data/blogs/galaaz_ggplot/galaaz_ggplot.Rmd +38 -66
  28. data/blogs/galaaz_ggplot/galaaz_ggplot.log +754 -0
  29. data/blogs/galaaz_ggplot/galaaz_ggplot.md +364 -0
  30. data/blogs/galaaz_ggplot/galaaz_ggplot.tex +607 -0
  31. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/midwest_rb.png +0 -0
  32. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-html/scatter_plot_rb.png +0 -0
  33. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/midwest_rb.png +0 -0
  34. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-markdown_github/scatter_plot_rb.png +0 -0
  35. data/blogs/galaaz_ggplot/midwest.Rmd +3 -3
  36. data/blogs/galaaz_ggplot/midwest_external_png +0 -0
  37. data/blogs/gknit/gknit.Rmd +52 -55
  38. data/blogs/gknit/gknit.md +94 -94
  39. data/blogs/gknit/gknit_files/figure-html/bubble-1.png +0 -0
  40. data/blogs/gknit/gknit_files/figure-html/diverging_bar.png +0 -0
  41. data/blogs/gknit/lst.rds +0 -0
  42. data/blogs/gknit/model.rb +1 -1
  43. data/blogs/gknit/stats.bib +0 -0
  44. data/blogs/manual/include_model_local_repro.Rmd +14 -0
  45. data/blogs/manual/include_model_local_repro.md +75 -0
  46. data/blogs/manual/lst.rds +0 -0
  47. data/blogs/manual/manual.Rmd +1582 -196
  48. data/blogs/manual/manual.log +1786 -0
  49. data/blogs/manual/manual.md +3107 -890
  50. data/blogs/manual/manual.tex +3018 -1086
  51. data/blogs/manual/manual_files/figure-html/bubble-1.png +0 -0
  52. data/blogs/manual/manual_files/figure-html/diverging_bar.png +0 -0
  53. data/blogs/manual/manual_files/figure-latex/bubble-1.png +0 -0
  54. data/blogs/manual/model.rb +41 -0
  55. data/blogs/nse_dplyr/nse_dplyr.Rmd +277 -151
  56. data/blogs/nse_dplyr/nse_dplyr.log +928 -0
  57. data/blogs/nse_dplyr/nse_dplyr.md +457 -293
  58. data/blogs/oh_my/not_so.rb +0 -0
  59. data/blogs/oh_my/oh_my.Rmd +1234 -25
  60. data/blogs/oh_my/oh_my.log +804 -0
  61. data/blogs/oh_my/oh_my.md +1808 -228
  62. data/blogs/oh_my/oh_my.tex +821 -0
  63. data/blogs/oh_my/old.Rmd +15 -14
  64. data/blogs/ruby_plot/ruby_plot.Rmd +58 -82
  65. data/blogs/ruby_plot/ruby_plot.log +885 -0
  66. data/blogs/ruby_plot/ruby_plot.md +71 -103
  67. data/blogs/ruby_plot/ruby_plot.tex +940 -0
  68. data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png +0 -0
  69. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png +0 -0
  70. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png +0 -0
  71. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png +0 -0
  72. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png +0 -0
  73. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png +0 -0
  74. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png +0 -0
  75. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png +0 -0
  76. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png +0 -0
  77. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png +0 -0
  78. data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png +0 -0
  79. data/blogs/ruby_plot/ruby_plot_files/figure-latex/dose_len.png +0 -0
  80. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_delivery.png +0 -0
  81. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facet_by_dose.png +0 -0
  82. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color.png +0 -0
  83. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_by_delivery_color2.png +0 -0
  84. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_decorations.png +0 -0
  85. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_jitter.png +0 -0
  86. data/blogs/ruby_plot/ruby_plot_files/figure-latex/facets_with_points.png +0 -0
  87. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_box_plot.png +0 -0
  88. data/blogs/ruby_plot/ruby_plot_files/figure-latex/final_violin_plot.png +0 -0
  89. data/blogs/ruby_plot/ruby_plot_files/figure-latex/violin_with_jitter.png +0 -0
  90. data/blogs/test/test.Rmd +14 -0
  91. data/examples/50Plots_MasterList/Images/midwest-scatterplot.PNG +0 -0
  92. data/examples/50Plots_MasterList/ScatterPlot.rb +0 -0
  93. data/examples/50Plots_MasterList/scatter_plot.rb +0 -0
  94. data/examples/Bibliography/master.bib +50 -0
  95. data/examples/Bibliography/stats.bib +72 -0
  96. data/examples/R/calc.R +0 -0
  97. data/examples/R/java_interop.R +0 -0
  98. data/examples/bioconductor_deseq2_airway/Documentation/DESeq2-airway-walkthrough.md +56 -0
  99. data/examples/bioconductor_deseq2_airway/bench_galaaz_three_same_process.rb +53 -0
  100. data/examples/bioconductor_deseq2_airway/bench_r_three_same_process.R +34 -0
  101. data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz.rb +33 -0
  102. data/examples/bioconductor_deseq2_airway/deseq2_airway_galaaz_optimized.rb +34 -0
  103. data/examples/bioconductor_deseq2_airway/deseq2_airway_minimal.R +30 -0
  104. data/examples/bioconductor_deseq2_airway/deseq2_airway_pipeline_for_bench.R +36 -0
  105. data/examples/islr/all.rb +13 -0
  106. data/examples/islr/ch2.spec.rb +37 -7
  107. data/examples/islr/ch3.spec.rb +11 -2
  108. data/examples/islr/ch3_boston.rb +27 -0
  109. data/examples/islr/ch3_multiple_regression.rb +0 -0
  110. data/examples/islr/ch6.spec.rb +24 -1
  111. data/examples/islr/x_y_rnorm.jpg +0 -0
  112. data/examples/latex_templates/Test-acm_article/Makefile +16 -0
  113. data/examples/latex_templates/Test-acm_article/Test-acm_article.Rmd +65 -0
  114. data/examples/latex_templates/Test-acm_article/acm_proc_article-sp.cls +1670 -0
  115. data/examples/latex_templates/Test-acm_article/sensys-abstract.cls +703 -0
  116. data/examples/latex_templates/Test-acm_article/sigproc.bib +59 -0
  117. data/examples/latex_templates/Test-acs_article/Test-acs_article.Rmd +260 -0
  118. data/examples/latex_templates/Test-acs_article/acs-Test-acs_article.bib +11 -0
  119. data/examples/latex_templates/Test-acs_article/acs-my_output.bib +11 -0
  120. data/examples/latex_templates/Test-acs_article/acstest.bib +17 -0
  121. data/examples/latex_templates/Test-aea_article/AEA.cls +1414 -0
  122. data/{blogs/gknit/marshal.dump → examples/latex_templates/Test-aea_article/BibFile.bib} +0 -0
  123. data/examples/latex_templates/Test-aea_article/Test-aea_article.Rmd +108 -0
  124. data/examples/latex_templates/Test-aea_article/aea.bst +1269 -0
  125. data/examples/latex_templates/Test-aea_article/multicol.sty +853 -0
  126. data/examples/latex_templates/Test-aea_article/references.bib +0 -0
  127. data/examples/latex_templates/Test-aea_article/setspace.sty +546 -0
  128. data/examples/latex_templates/Test-amq_article/Test-amq_article.Rmd +256 -0
  129. data/examples/latex_templates/Test-amq_article/Test-amq_article.pdfsync +3397 -0
  130. data/examples/latex_templates/Test-ams_article/Test-ams_article.Rmd +215 -0
  131. data/examples/latex_templates/Test-ams_article/amstest.bib +436 -0
  132. data/examples/latex_templates/Test-asa_article/Test-asa_article.Rmd +153 -0
  133. data/examples/latex_templates/Test-asa_article/agsm.bst +1353 -0
  134. data/examples/latex_templates/Test-asa_article/bibliography.bib +233 -0
  135. data/examples/latex_templates/Test-ieee_article/IEEEtran.bst +2409 -0
  136. data/examples/latex_templates/Test-ieee_article/IEEEtran.cls +6346 -0
  137. data/examples/latex_templates/Test-ieee_article/Test-ieee_article.Rmd +175 -0
  138. data/examples/latex_templates/Test-ieee_article/mybibfile.bib +20 -0
  139. data/examples/latex_templates/Test-rjournal_article/RJournal.sty +335 -0
  140. data/examples/latex_templates/Test-rjournal_article/RJreferences.bib +18 -0
  141. data/examples/latex_templates/Test-rjournal_article/Test-rjournal_article.Rmd +52 -0
  142. data/examples/latex_templates/Test-springer_article/Test-springer_article.Rmd +65 -0
  143. data/examples/latex_templates/Test-springer_article/bibliography.bib +26 -0
  144. data/examples/latex_templates/Test-springer_article/spbasic.bst +1658 -0
  145. data/examples/latex_templates/Test-springer_article/spmpsci.bst +1512 -0
  146. data/examples/latex_templates/Test-springer_article/spphys.bst +1443 -0
  147. data/examples/latex_templates/Test-springer_article/svglov3.clo +113 -0
  148. data/examples/latex_templates/Test-springer_article/svjour3.cls +1431 -0
  149. data/examples/misc/baseball.csv +0 -0
  150. data/examples/misc/ggplot.rb +3 -2
  151. data/examples/misc/moneyball.rb +0 -0
  152. data/examples/misc/subsetting.rb +0 -0
  153. data/examples/multithread_shards_to_r/shards_to_r.rb +67 -0
  154. data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.Rmd +73 -0
  155. data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.Rmd +382 -0
  156. data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.Rmd +164 -0
  157. data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.Rmd +92 -0
  158. data/examples/rmarkdown/svm-rmarkdown-syllabus-example/attend-grade-relationships.csv +482 -0
  159. data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.Rmd +280 -0
  160. data/examples/rmarkdown/svm-xaringan-example/svm-xaringan-example.Rmd +386 -0
  161. data/examples/sthda_ggplot/README.md +0 -0
  162. data/examples/sthda_ggplot/RUN.md +41 -0
  163. data/examples/sthda_ggplot/all.rb +0 -0
  164. data/examples/sthda_ggplot/one_variable_continuous/density_gg.rb +0 -0
  165. data/examples/sthda_ggplot/one_variable_continuous/geom_area.rb +0 -0
  166. data/examples/sthda_ggplot/one_variable_continuous/geom_density.rb +2 -0
  167. data/examples/sthda_ggplot/one_variable_continuous/geom_dotplot.rb +0 -0
  168. data/examples/sthda_ggplot/one_variable_continuous/geom_freqpoly.rb +0 -0
  169. data/examples/sthda_ggplot/one_variable_continuous/geom_histogram.rb +0 -0
  170. data/examples/sthda_ggplot/one_variable_continuous/histogram_density.rb +0 -0
  171. data/examples/sthda_ggplot/one_variable_continuous/stat.rb +0 -0
  172. data/examples/sthda_ggplot/one_variable_discrete/bar.rb +0 -0
  173. data/examples/sthda_ggplot/qplots/box_violin_dot.rb +0 -0
  174. data/examples/sthda_ggplot/qplots/scatter_plots.rb +0 -0
  175. data/examples/sthda_ggplot/scatter_gg.rb +0 -0
  176. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_bin2d.rb +0 -0
  177. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_density2d.rb +0 -0
  178. data/examples/sthda_ggplot/two_variables_cont_bivariate/geom_hex.rb +0 -0
  179. data/examples/sthda_ggplot/two_variables_cont_cont/geom_point.rb +0 -0
  180. data/examples/sthda_ggplot/two_variables_cont_cont/geom_smooth.rb +0 -0
  181. data/examples/sthda_ggplot/two_variables_cont_cont/misc.rb +0 -0
  182. data/examples/sthda_ggplot/two_variables_cont_function/geom_area.rb +4 -3
  183. data/examples/sthda_ggplot/two_variables_disc_cont/geom_bar.rb +0 -0
  184. data/examples/sthda_ggplot/two_variables_disc_cont/geom_boxplot.rb +0 -0
  185. data/examples/sthda_ggplot/two_variables_disc_cont/geom_dotplot.rb +0 -0
  186. data/examples/sthda_ggplot/two_variables_disc_cont/geom_jitter.rb +0 -0
  187. data/examples/sthda_ggplot/two_variables_disc_cont/geom_line.rb +0 -0
  188. data/examples/sthda_ggplot/two_variables_disc_cont/geom_violin.rb +0 -0
  189. data/examples/sthda_ggplot/two_variables_disc_disc/geom_jitter.rb +0 -0
  190. data/examples/sthda_ggplot/two_variables_error/geom_crossbar.rb +0 -0
  191. data/ext/new_bridge/Makefile +46 -0
  192. data/ext/new_bridge/galaaz_gatekeeper_phase0.cpp +12 -0
  193. data/ext/new_bridge/galaaz_gatekeeper_phase1.cpp +1639 -0
  194. data/lib/R_interface/galaaz_device.R +20 -0
  195. data/lib/R_interface/include_engine.R +109 -0
  196. data/lib/R_interface/new_bridge_adapter.rb +824 -0
  197. data/lib/R_interface/r.rb +177 -25
  198. data/lib/R_interface/r_arrow.rb +113 -0
  199. data/lib/R_interface/r_libs.R +4 -4
  200. data/lib/R_interface/r_methods.rb +13 -116
  201. data/lib/R_interface/r_module_s.rb +0 -0
  202. data/lib/R_interface/rbinary_operators.rb +20 -2
  203. data/lib/R_interface/rclosure.rb +5 -1
  204. data/lib/R_interface/rdata_frame.rb +34 -70
  205. data/lib/R_interface/rdevice.rb +125 -0
  206. data/lib/R_interface/rdevices.R +0 -0
  207. data/lib/R_interface/renvironment.rb +10 -4
  208. data/lib/R_interface/rexpression.rb +5 -1
  209. data/lib/R_interface/rindexed_object.rb +41 -13
  210. data/lib/R_interface/rlanguage.rb +20 -62
  211. data/lib/R_interface/rlist.rb +115 -25
  212. data/lib/R_interface/rlogical_operators.rb +0 -0
  213. data/lib/R_interface/rmatrix.rb +2 -11
  214. data/lib/R_interface/rmd_indexed_object.rb +5 -1
  215. data/lib/R_interface/robject.rb +348 -290
  216. data/lib/R_interface/rpkg.rb +1 -0
  217. data/lib/R_interface/rsupport.rb +610 -331
  218. data/lib/R_interface/rsupport_scope.rb +2 -1
  219. data/lib/R_interface/rsymbol.rb +50 -0
  220. data/lib/R_interface/ruby_callback.rb +2 -3
  221. data/lib/R_interface/ruby_extensions.rb +225 -175
  222. data/lib/R_interface/runary_operators.rb +0 -0
  223. data/lib/R_interface/rvector.rb +147 -31
  224. data/lib/galaaz.rb +0 -0
  225. data/lib/galaaz_jruby.rb +22 -0
  226. data/lib/gknit/diagnostics.rb +50 -0
  227. data/lib/gknit/draft.rb +111 -0
  228. data/lib/gknit/include_engine.rb +15 -7
  229. data/lib/gknit/knitr_engine.rb +223 -107
  230. data/lib/gknit/rb_engine.rb +3 -3
  231. data/lib/gknit/ruby_engine.rb +0 -0
  232. data/lib/gknit.rb +3 -0
  233. data/lib/new_bridge/bootstrap/windows_bootstrap.rb +285 -0
  234. data/lib/new_bridge/envelope.rb +51 -0
  235. data/lib/new_bridge/eval_result.rb +26 -0
  236. data/lib/new_bridge/framing.rb +39 -0
  237. data/lib/new_bridge/instance_pool_client.rb +38 -0
  238. data/lib/new_bridge/r_instance_manager.rb +404 -0
  239. data/lib/new_bridge/session_client.rb +530 -0
  240. data/lib/new_bridge/tcp_framed.rb +44 -0
  241. data/lib/new_bridge.rb +9 -0
  242. data/lib/util/exec_ruby.rb +95 -46
  243. data/lib/util/inline_file.rb +35 -30
  244. data/new_bridge_specs/benchmark_phase5_5_unboxing_spec.rb +96 -0
  245. data/new_bridge_specs/eval_r_async_spec.rb +113 -0
  246. data/new_bridge_specs/integration_phase5_1_concurrent_spec.rb +50 -0
  247. data/new_bridge_specs/integration_phase5_1_eval_spec.rb +16 -0
  248. data/new_bridge_specs/integration_phase5_1_r_api_spec.rb +25 -0
  249. data/new_bridge_specs/integration_phase5_1_smoke_spec.rb +31 -0
  250. data/new_bridge_specs/integration_phase5_2_dataframe_unboxing_spec.rb +19 -0
  251. data/new_bridge_specs/integration_phase5_2_handle_eval_unboxing_spec.rb +25 -0
  252. data/new_bridge_specs/integration_phase5_3_callback_args_spec.rb +28 -0
  253. data/new_bridge_specs/integration_phase5_3_callback_error_spec.rb +22 -0
  254. data/new_bridge_specs/integration_phase5_3_callback_timeout_spec.rb +28 -0
  255. data/new_bridge_specs/integration_phase5_3_callbacks_smoke_spec.rb +22 -0
  256. data/new_bridge_specs/integration_phase5_3_edge_cases_spec.rb +52 -0
  257. data/new_bridge_specs/integration_phase5_3_nested_spec.rb +30 -0
  258. data/new_bridge_specs/integration_phase5_4_concurrent_sessions_spec.rb +53 -0
  259. data/new_bridge_specs/integration_phase5_4_nested_session_callbacks_spec.rb +49 -0
  260. data/new_bridge_specs/integration_phase5_4_session_routing_spec.rb +38 -0
  261. data/new_bridge_specs/integration_phase5_5_stress_concurrency_spec.rb +52 -0
  262. data/new_bridge_specs/integration_phase5_5_unbox_walk_spec.rb +46 -0
  263. data/new_bridge_specs/phase0_protocol_spec.rb +96 -0
  264. data/new_bridge_specs/phase1_req_ret_spec.rb +66 -0
  265. data/new_bridge_specs/phase2_multi_instance_spec.rb +67 -0
  266. data/new_bridge_specs/phase3_callbacks_spec.rb +71 -0
  267. data/new_bridge_specs/phase4_2_hardening_spec.rb +252 -0
  268. data/new_bridge_specs/phase4_3_r_instance_manager_spec.rb +85 -0
  269. data/new_bridge_specs/phase4_nested_callbacks_spec.rb +123 -0
  270. data/r_requires/ggplot.rb +0 -0
  271. data/r_requires/knitr.rb +0 -0
  272. data/specs/all.rb +15 -11
  273. data/specs/arrow_from_ruby_batches_spec.rb +50 -0
  274. data/specs/arrow_semantics_spec.rb +64 -0
  275. data/specs/bridge_concurrent_spec.rb +46 -0
  276. data/specs/bridge_nested_spec.rb +25 -0
  277. data/specs/dataframe_semantics_spec.rb +122 -0
  278. data/specs/dataframe_single_index_logical_filter_spec.rb +21 -0
  279. data/specs/dispatch_probe_cache_spec.rb +38 -0
  280. data/specs/dispatch_probe_error_class_fallback_spec.rb +20 -0
  281. data/specs/dispatch_probe_fallback_spec.rb +18 -0
  282. data/specs/environment_semantics_spec.rb +89 -0
  283. data/specs/field_access_spec.rb +31 -0
  284. data/specs/figures/bg.jpeg +0 -0
  285. data/specs/figures/bg.png +0 -0
  286. data/specs/figures/bg.svg +168 -57
  287. data/specs/figures/dose_len.png +0 -0
  288. data/specs/figures/no_args.jpeg +0 -0
  289. data/specs/figures/no_args.png +0 -0
  290. data/specs/figures/no_args.svg +168 -57
  291. data/specs/figures/width_height.jpeg +0 -0
  292. data/specs/figures/width_height.png +0 -0
  293. data/specs/figures/width_height_units1.jpeg +0 -0
  294. data/specs/figures/width_height_units1.png +0 -0
  295. data/specs/figures/width_height_units2.jpeg +0 -0
  296. data/specs/figures/width_height_units2.png +0 -0
  297. data/specs/formula_semantics_spec.rb +81 -0
  298. data/specs/galaaz_util_exec_ruby_spec.rb +85 -0
  299. data/specs/galaaz_util_inline_file_spec.rb +54 -0
  300. data/specs/gknit_cli_option_permutation_spec.rb +24 -0
  301. data/specs/gknit_include_engine_spec.rb +72 -0
  302. data/specs/gknit_install_timeout_report_spec.rb +69 -0
  303. data/specs/gknit_internal_error_report_spec.rb +57 -0
  304. data/specs/gknit_vector_map_output_spec.rb +59 -0
  305. data/specs/globalenv_guardrail_spec.rb +52 -0
  306. data/specs/language_expression_semantics_spec.rb +145 -0
  307. data/specs/list_semantics_spec.rb +111 -0
  308. data/specs/new_bridge_bulk_dataframe_transfer_spec.rb +44 -0
  309. data/specs/new_bridge_bulk_vector_transfer_spec.rb +73 -0
  310. data/specs/new_bridge_callback_timeout_spec.rb +69 -0
  311. data/specs/new_bridge_eval_r_fallback_spec.rb +55 -0
  312. data/specs/nil_null_spec.rb +42 -0
  313. data/specs/object_build_phase2_spec.rb +53 -0
  314. data/specs/phase1_callback_bridge_spec.rb +84 -0
  315. data/specs/phase2_gknit_generic_rendering_guardrail_spec.rb +46 -0
  316. data/specs/phase2_gknit_no_raw_code_leakage_spec.rb +43 -0
  317. data/specs/phase3_gknit_generic_graphics_capture_spec.rb +71 -0
  318. data/specs/plot_device_semantics_spec.rb +28 -0
  319. data/specs/plot_snapshot_semantics_spec.rb +58 -0
  320. data/specs/protocol_result_spec.rb +236 -0
  321. data/specs/r_batch_fail_fast_spec.rb +47 -0
  322. data/specs/r_bridge_bootstrap_spec.rb +11 -0
  323. data/specs/r_devices.spec.rb +1 -1
  324. data/specs/r_eval.spec.rb +16 -18
  325. data/specs/r_function.spec.rb +1 -1
  326. data/specs/r_instance_manager_spec.rb +285 -0
  327. data/specs/r_list_apply.spec.rb +15 -15
  328. data/specs/r_matrix.spec.rb +0 -0
  329. data/specs/r_nse.spec.rb +5 -5
  330. data/specs/r_object_send_dispatch_spec.rb +13 -0
  331. data/specs/r_vector_comparator_spec.rb +8 -0
  332. data/specs/r_vector_creation.spec.rb +0 -0
  333. data/specs/r_vector_functions.spec.rb +0 -0
  334. data/specs/r_vector_object.spec.rb +0 -0
  335. data/specs/r_vector_operators.spec.rb +0 -0
  336. data/specs/r_vector_structured_scalar_reads_spec.rb +35 -0
  337. data/specs/r_vector_subsetting.spec.rb +0 -0
  338. data/specs/range_helper_spec.rb +21 -0
  339. data/specs/rsupport_scope_spec.rb +28 -0
  340. data/specs/rsupport_var_name_thread_safety_spec.rb +24 -0
  341. data/specs/scalar_character_spec.rb +44 -0
  342. data/specs/scoped_symbol_dsl_refinement_spec.rb +40 -0
  343. data/specs/session_env_bridge_spec.rb +25 -0
  344. data/specs/simplecov_bootstrap_spec.rb +10 -0
  345. data/specs/spec_helper.rb +10 -0
  346. data/specs/tmp.rb +41 -20
  347. data/specs/unboxing_recursion_regression_spec.rb +30 -0
  348. data/specs/unboxing_spec.rb +49 -0
  349. data/specs/verify_callbacks.rb +42 -0
  350. data/sty/galaaz.sty +0 -0
  351. data/version.rb +1 -1
  352. metadata +239 -71
  353. data/blogs/galaaz_ggplot/galaaz_ggplot.aux +0 -41
  354. data/blogs/galaaz_ggplot/galaaz_ggplot.html +0 -705
  355. data/blogs/galaaz_ggplot/galaaz_ggplot.out +0 -10
  356. data/blogs/galaaz_ggplot/galaaz_ggplot.pdf +0 -0
  357. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/midwest_rb.pdf +0 -0
  358. data/blogs/galaaz_ggplot/galaaz_ggplot_files/figure-latex/scatter_plot_rb.pdf +0 -0
  359. data/blogs/galaaz_ggplot/midwest.html +0 -188
  360. data/blogs/gknit/gknit.html +0 -2266
  361. data/blogs/gknit/gknit.pdf +0 -0
  362. data/blogs/gknit/gknit.tex +0 -1358
  363. data/blogs/manual/graph.rb +0 -29
  364. data/blogs/manual/manual.html +0 -2995
  365. data/blogs/manual/manual.pdf +0 -0
  366. data/blogs/manual/manual_files/figure-latex/diverging_bar.pdf +0 -0
  367. data/blogs/nse_dplyr/nse_dplyr.html +0 -960
  368. data/blogs/nse_dplyr/nse_dplyr.pdf +0 -0
  369. data/blogs/nse_dplyr/nse_dplyr.tex +0 -1373
  370. data/blogs/oh_my/oh_my.html +0 -680
  371. data/blogs/ruby_plot/ruby_plot.Rmd_external_figs +0 -662
  372. data/blogs/ruby_plot/ruby_plot.html +0 -729
  373. data/blogs/ruby_plot/ruby_plot.pdf +0 -0
  374. data/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.svg +0 -57
  375. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.svg +0 -106
  376. data/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.svg +0 -110
  377. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.svg +0 -174
  378. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.svg +0 -236
  379. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.svg +0 -296
  380. data/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.svg +0 -236
  381. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.svg +0 -218
  382. data/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.svg +0 -128
  383. data/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.svg +0 -150
  384. data/examples/paper/paper.rb +0 -36
  385. data/specs/r_dataframe.spec.rb +0 -379
  386. data/specs/r_environment.spec.rb +0 -140
  387. data/specs/r_formula.spec.rb +0 -232
  388. data/specs/r_language.spec.rb +0 -112
  389. data/specs/r_list.spec.rb +0 -293
  390. data/specs/r_plots.spec.rb +0 -72
  391. data/specs/ruby_expression.spec.rb +0 -315
@@ -3,8 +3,8 @@ title: "How to make Beautiful Ruby Plots with Galaaz"
3
3
  author:
4
4
  - "Rodrigo Botafogo"
5
5
  - "Daniel Mossé - University of Pittsburgh"
6
- tags: [Tech, Data Science, Ruby, R, GraalVM]
7
- date: "November 19th, 2018"
6
+ tags: [Tech, Data Science, Ruby, R, JRuby, "GNU R", Galaaz]
7
+ date: "November 19th, 2018 (narrative updated for Galaaz 2.0, 2026)"
8
8
  output:
9
9
  html_document:
10
10
  self_contained: true
@@ -41,42 +41,17 @@ of libraries for data analysis.
41
41
 
42
42
  Until recently, there was no real perspective for Ruby to bridge this gap.
43
43
  Implementing a complete scientific computing infrastructure would take too long.
44
- Enters [Oracle's GraalVM](https://www.graalvm.org/):
45
-
46
- > GraalVM is a universal virtual machine for running applications written in
47
- > JavaScript, Python 3, Ruby, R, JVM-based languages like Java, Scala, Kotlin,
48
- > and LLVM-based languages such as C and C++.
49
- >
50
- > GraalVM removes the isolation between programming languages and enables
51
- > interoperability in a shared runtime. It can run either standalone or in the
52
- > context of OpenJDK, Node.js, Oracle Database, or MySQL.
53
- >
54
- > GraalVM allows you to write polyglot applications with a seamless way to pass
55
- > values from one language to another. With GraalVM there is no copying or
56
- > marshaling necessary as it is with other polyglot systems. This lets you
57
- > achieve high performance when language boundaries are crossed. Most of the time
58
- > there is no additional cost for crossing a language boundary at all.
59
- >
60
- > Often developers have to make uncomfortable compromises that require them
61
- > to rewrite their software in other languages. For example:
62
- >
63
- > * That library is not available in my language. I need to rewrite it.
64
- > * That language would be the perfect fit for my problem, but we cannot
65
- > run it in our environment.
66
- > * That problem is already solved in my language, but the language is
67
- > too slow.
68
- >
69
- > With GraalVM we aim to allow developers to freely choose the right language for
70
- > the task at hand without making compromises.
71
-
72
- As stated above, GraalVM is a _universal_ virtual machine that allows Ruby and R (and other
73
- languages) to run on the same environment. GraalVM allows polyglot applications to
74
- _seamlessly_ interact with one another and pass values from one language to the other.
75
- Although a great idea, GraalVM still requires application writers to know several languages.
76
- To eliminate that requirement, we built Galaaz, a gem for Ruby, to tightly couple
77
- Ruby and R and allow those languages to interact in a way that the user will be unaware
78
- of such interaction. In other words, a Ruby programmer will be able to use all
79
- the capabilities of R without knowing the R syntax.
44
+
45
+ **Galaaz 2.0** couples **[JRuby](https://www.jruby.org/)** (Ruby on the JVM) with **GNU R**—the
46
+ same R distribution used for data science everywhere. A **bridge** evaluates R from Ruby and
47
+ exchanges data between the two processes so that, from Ruby, you call R functions and work
48
+ with R objects using familiar Ruby syntax. In other words, a Ruby programmer can use the
49
+ capabilities of R without memorizing all of R’s syntax for day-to-day tasks.
50
+
51
+ An **earlier line of work** used Oracle’s **GraalVM** with **TruffleRuby** and **FastR** so that
52
+ Ruby and R could share one JVM runtime. That stack is **no longer** what Galaaz targets;
53
+ today’s Galaaz is developed and tested with **JRuby + GNU R** (see the project manual for setup
54
+ and command-line tools).
80
55
 
81
56
  Library wrapping is a usual way of bringing features from one language into another.
82
57
  To improve performance, Python often wraps more efficient C libraries. For the
@@ -105,7 +80,7 @@ ggplot themes that will work the same as the Ruby module. Yet, writing a new th
105
80
  requires specific knowledge on theme writing. Ruby modules are standard to the
106
81
  language and don't need special knowledge.
107
82
 
108
- [Here](https://towardsdatascience.com/ruby-plotting-with-galaaz-an-example-of-tightly-coupling-ruby-and-r-in-graalvm-520b69e21021) we show a scatter plot in Ruby also with Galaaz.
83
+ [Here](https://towardsdatascience.com/ruby-plotting-with-galaaz-an-example-of-tightly-coupling-ruby-and-r-in-graalvm-520b69e21021) is an older article (GraalVM-era Galaaz) with a scatter plot in Ruby; the **ideas** still apply under Galaaz 2.0 with JRuby and GNU R.
109
84
 
110
85
  # gKnit
111
86
 
@@ -137,14 +112,14 @@ The ToothGrowth dataset contains three columns: 'len', 'supp' and 'dose'. Let's
137
112
  take a look at a few rows of this dataset. In Galaaz, R variables are accessed
138
113
  by using the corresponding Ruby symbol preceeded by the tilda ('~') function. Note in the
139
114
  following chunk that 'ToothGrowth' is the R variable and Ruby's 'tooth_growth' is
140
- assigned the value of '~:ToothGrowth'.
115
+ assigned the value of '~R[:ToothGrowth]'.
141
116
 
142
117
 
143
- ```ruby
118
+ ``` ruby
144
119
  # Read the R ToothGrowth variable and assign it to the
145
120
  # Ruby instance variable tooth_growth that will be
146
121
  # available to all Ruby chunks in this document.
147
- tooth_growth = ~:ToothGrowth
122
+ tooth_growth = ~R[:ToothGrowth]
148
123
  # print the first few elements of the dataset
149
124
  puts tooth_growth.head
150
125
  ```
@@ -165,7 +140,7 @@ with a dot ('.') and the name of the column. Also use dot notation to chain meth
165
140
  in usual Ruby style.
166
141
 
167
142
 
168
- ```ruby
143
+ ``` ruby
169
144
  # Access the tooth_growth 'len' column and print the first few
170
145
  # elements of this column with the 'head' method.
171
146
  puts tooth_growth.len.head
@@ -183,7 +158,7 @@ function from Galaaz the dot ('.') in the function name is substituted by '__' (
183
158
  The function 'as.factor' becomes 'R.as__factor' or just 'as__factor' when chaining.
184
159
 
185
160
 
186
- ```ruby
161
+ ``` ruby
187
162
  # convert the dose to a factor
188
163
  tooth_growth.dose = tooth_growth.dose.as__factor
189
164
  ```
@@ -192,7 +167,7 @@ Let's explore some more details of this dataset. In particular, let's look at i
192
167
  structure and summary statistics.
193
168
 
194
169
 
195
- ```ruby
170
+ ``` ruby
196
171
  puts tooth_growth.dim
197
172
  ```
198
173
 
@@ -207,23 +182,16 @@ functions does not return anything and prints the structure of the dataset
207
182
  as a side effect.
208
183
 
209
184
 
210
- ```ruby
185
+ ``` ruby
211
186
  tooth_growth.str
212
187
  ```
213
-
214
- ```
215
- ## 'data.frame': 60 obs. of 3 variables:
216
- ## $ len : num 4.2 11.5 7.3 5.8 6.4 10 11.2 11.2 5.2 7 ...
217
- ## $ supp: Factor w/ 2 levels "OJ","VC": 2 2 2 2 2 2 2 2 2 2 ...
218
- ## $ dose: Factor w/ 3 levels "0.5","1","2": 1 1 1 1 1 1 1 1 1 1 ...
219
- ```
220
188
  Observe that both variables 'supp' and 'dose' are factors. The system made variable 'supp'
221
189
  a factor automatically, since it contais two strings OJ and VC.
222
190
 
223
191
  Finally, using the summary method, we get the statistical summary for the dataset
224
192
 
225
193
 
226
- ```ruby
194
+ ``` ruby
227
195
  puts tooth_growth.summary
228
196
  ```
229
197
 
@@ -264,14 +232,14 @@ the $y$ axis: 'E.aes(x: :dose, y: :len)'. To specify the type of plot add a geo
264
232
  the plot. For a boxplot, the geom is R.geom_boxplot.
265
233
 
266
234
 
267
- ```ruby
235
+ ``` ruby
268
236
  require 'ggplot'
269
237
 
270
238
  e = tooth_growth.ggplot(E.aes(x: :dose, y: :len))
271
239
  print e + R.geom_boxplot
272
240
  ```
273
241
 
274
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/dose_len.png)<!-- -->
242
+ ![](ruby_plot_files/figure-html/dose_len.png)
275
243
 
276
244
  Great! We've just managed to create and save our first plot in Ruby with only
277
245
  four lines of code. We can now easily see with this plot a clear trend: as the
@@ -293,31 +261,30 @@ the 'facet_grid' method is a [_formula_](https://thomasleeper.com/Rcourse/Tutori
293
261
 
294
262
  In Galaaz we give programmers the flexibility to use two different ways to write formulas.
295
263
  In the first way, we use Ruby expressions and the '.til' function. The formula 'x ~ y', becomes
296
- ':x.til :y'. More information on expressions can be found in [Galaaz Manual](https://www.rubydoc.info/gems/galaaz/).
264
+ 'R[:x].til :y'. More information on expressions can be found in [Galaaz Manual](https://www.rubydoc.info/gems/galaaz/).
297
265
 
298
266
 
299
267
  Another way of writing a formula is to use the 'formula' function with the actual formula as
300
268
  a string. The formula ```x ~ y``` in R can be written as ```R.formula("x ~ y")```. For more
301
269
  complex formulas, the use of the 'formula' function is preferred.
302
270
 
303
- The formula ```:all.til :supp``` indicates to the 'facet_grid' function that it needs to
271
+ The formula ```R[:all].til :supp``` indicates to the 'facet_grid' function that it needs to
304
272
  facet the plot based on the ```supp``` variable and split the plot vertically. Changing
305
- the formula to ```:supp.til :all``` would split the plot horizontally.
306
-
273
+ the formula to ```R[:supp].til :all``` would split the plot horizontally.
307
274
 
308
- ```ruby
309
275
 
276
+ ``` ruby
310
277
  base_tooth = tooth_growth.ggplot(E.aes(x: :dose, y: :len, group: :dose))
311
278
 
312
279
  bp = base_tooth + R.geom_boxplot +
313
280
  # Split in vertical direction
314
- R.facet_grid(:all.til :supp)
315
-
281
+ R.facet_grid(R[:all].til :supp)
282
+
316
283
  puts bp
317
284
  ```
318
285
 
319
286
 
320
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_delivery.png)<!-- -->
287
+ ![](ruby_plot_files/figure-html/facet_by_delivery.png)
321
288
 
322
289
  It now becomes clear that although both methods of delivery have a direct
323
290
  impact on tooth growth, method (OJ) is non-linear having a higher impact with smaller
@@ -334,13 +301,13 @@ enough to add ```fill: :dose``` to the aesthetic of boxplot. With this command
334
301
  factor gets its own color.
335
302
 
336
303
 
337
- ```ruby
304
+ ``` ruby
338
305
  bp = bp + R.geom_boxplot(E.aes(fill: :dose))
339
306
  puts bp
340
307
  ```
341
308
 
342
309
 
343
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color.png)<!-- -->
310
+ ![](ruby_plot_files/figure-html/facets_by_delivery_color.png)
344
311
 
345
312
  Facetting helps us compare the general trends for each delivery method.
346
313
  Adding color allow us to compare specifically how each dosage impacts the tooth growth.
@@ -372,7 +339,7 @@ each of the 60 pigs in the experiment. For that, add the function 'R.geom_point
372
339
  plot.
373
340
 
374
341
 
375
- ```ruby
342
+ ``` ruby
376
343
  # Split in vertical direction
377
344
  bp = bp + R.geom_point
378
345
 
@@ -380,7 +347,7 @@ puts bp
380
347
  ```
381
348
 
382
349
 
383
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_points.png)<!-- -->
350
+ ![](ruby_plot_files/figure-html/facets_with_points.png)
384
351
 
385
352
  Now we can see the actual distribution of all the 60 subjects. Actually, this is not
386
353
  totally true. We have a hard time seing all 60 subjects. It seems that some points
@@ -394,13 +361,13 @@ prevents data hiding. We also add
394
361
  color and change the shape of the points, making them even easier to see.
395
362
 
396
363
 
397
- ```ruby
364
+ ``` ruby
398
365
  # Split in vertical direction
399
366
  puts bp + R.geom_jitter(shape: 23, color: "cyan3", size: 1)
400
367
  ```
401
368
 
402
369
 
403
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_jitter.png)<!-- -->
370
+ ![](ruby_plot_files/figure-html/facets_with_jitter.png)
404
371
 
405
372
  Now we can see all 60 points in the graph. We have here a much higher information density
406
373
  and we can see outliers and subjects distribution.
@@ -436,7 +403,7 @@ This ordering seems more natural and
436
403
  matches with the actual order of the colors in the plot.
437
404
 
438
405
 
439
- ```ruby
406
+ ``` ruby
440
407
  bp = bp +
441
408
  R.scale_fill_manual(values: R.c("cyan", "deepskyblue", "deepskyblue4"),
442
409
  breaks: R.c("2","1","0.5"))
@@ -445,7 +412,7 @@ puts bp
445
412
  ```
446
413
 
447
414
 
448
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facets_by_delivery_color2.png)<!-- -->
415
+ ![](ruby_plot_files/figure-html/facets_by_delivery_color2.png)
449
416
 
450
417
  ## Violin Plot and Jitter
451
418
 
@@ -465,9 +432,9 @@ a boxplot known as a _violin plot_ with jittered data.
465
432
  > The central dot represents the median average value.
466
433
 
467
434
 
468
- ```ruby
435
+ ``` ruby
469
436
  violin = base_tooth + R.geom_violin(E.aes(fill: :dose)) +
470
- R.facet_grid(:all.til :supp) +
437
+ R.facet_grid(R[:all].til :supp) +
471
438
  R.geom_jitter(shape: 23, color: "cyan3", size: 1) +
472
439
  R.scale_fill_manual(values: R.c("cyan", "deepskyblue", "deepskyblue4"),
473
440
  breaks: R.c("2","1","0.5"))
@@ -476,7 +443,7 @@ puts violin
476
443
  ```
477
444
 
478
445
 
479
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/violin_with_jitter.png)<!-- -->
446
+ ![](ruby_plot_files/figure-html/violin_with_jitter.png)
480
447
 
481
448
  This plot is an alternative to the original boxplot. For the final presentation, it is
482
449
  important to think which graphics will be best understood by our audience. A violin plot
@@ -497,7 +464,7 @@ for information about the plot (for clarity, we defined a caption variable using
497
464
  Here Doc style).
498
465
 
499
466
 
500
- ```ruby
467
+ ``` ruby
501
468
  caption = <<-EOT
502
469
  Length of odontoblasts in 60 guinea pigs.
503
470
  Each animal received one of three dose levels of vitamin C.
@@ -513,7 +480,7 @@ puts bp + decorations
513
480
  ```
514
481
 
515
482
 
516
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facets_with_decorations.png)<!-- -->
483
+ ![](ruby_plot_files/figure-html/facets_with_decorations.png)
517
484
 
518
485
  ## The Corp Theme
519
486
 
@@ -531,7 +498,7 @@ a shade o blue (color: '#00080'). Axis labels are moved near the end of the axi
531
498
  written in 'bold'.
532
499
 
533
500
 
534
- ```ruby
501
+ ``` ruby
535
502
  module CorpTheme
536
503
 
537
504
  R.install_and_loads 'RColorBrewer'
@@ -595,23 +562,23 @@ the decorations ('decorations'), plus the corporate theme.
595
562
  Here is our final boxplot, without jitter.
596
563
 
597
564
 
598
- ```ruby
565
+ ``` ruby
599
566
  puts bp + decorations + CorpTheme.global_theme(faceted: true)
600
567
  ```
601
568
 
602
569
 
603
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/final_box_plot.png)<!-- -->
570
+ ![](ruby_plot_files/figure-html/final_box_plot.png)
604
571
 
605
572
  And here is the final violin plot, with jitter and the same look and feel of the corporate
606
573
  boxplot.
607
574
 
608
575
 
609
- ```ruby
576
+ ``` ruby
610
577
  puts violin + decorations + CorpTheme.global_theme(faceted: true)
611
578
  ```
612
579
 
613
580
 
614
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/final_violin_plot.png)<!-- -->
581
+ ![](ruby_plot_files/figure-html/final_violin_plot.png)
615
582
 
616
583
  ## Another View
617
584
 
@@ -620,14 +587,14 @@ dose and not by supplement. This shows how easy it is to create new plots by ju
620
587
  changing small statement on the _grammar of graphics_.
621
588
 
622
589
 
623
- ```ruby
590
+ ``` ruby
624
591
  caption = <<-EOT
625
592
  Length of odontoblasts in 60 guinea pigs.
626
593
  Each animal received one of three dose levels of vitamin C.
627
594
  EOT
628
595
 
629
596
  bp = tooth_growth.ggplot(E.aes(x: :supp, y: :len, group: :supp)) +
630
- R.geom_boxplot(E.aes(fill: :supp)) + R.facet_grid(:all.til :dose) +
597
+ R.geom_boxplot(E.aes(fill: :supp)) + R.facet_grid(R[:all].til :dose) +
631
598
  R.scale_fill_manual(values: R.c("cyan", "deepskyblue4")) +
632
599
  R.labs(title: "Tooth Growth: Length by Dose",
633
600
  subtitle: "Faceted by dose",
@@ -639,7 +606,7 @@ puts bp
639
606
  ```
640
607
 
641
608
 
642
- ![](/home/rbotafogo/desenv/galaaz/blogs/ruby_plot/ruby_plot_files/figure-html/facet_by_dose.png)<!-- -->
609
+ ![](ruby_plot_files/figure-html/facet_by_dose.png)
643
610
 
644
611
  # Conclusion
645
612
 
@@ -651,18 +618,17 @@ developer, migration to Ruby is a matter of small syntactic changes with a very
651
618
  learning curve. As the R developer becomes more proficient in Ruby, he can start using
652
619
  'classes', 'modules', 'procs', 'lambdas'.
653
620
 
654
- Trying to bring to Ruby the power of R starting from scratch is an enourmous endeavour
621
+ Trying to bring to Ruby the power of R starting from scratch is an enormous endeavour
655
622
  and would probably never be accomplished. Today's data scientists would certainly
656
623
  stick with either Python or R. Now, both the Ruby and R communities can benefit
657
- from this marriage, provided by Galaaz on top of GraalVM and Truffle's
658
- polyglot environment. We presented
659
- the process to couple Ruby and R, but this process can also be done to couple Ruby
660
- and JavaScript or Ruby and Python. In a polyglot world a *uniglot* language might
661
- be extremely relevant.
624
+ from this marriage: **Galaaz 2.0** uses **standard GNU R** for statistics and graphics
625
+ and **JRuby** for application code, threading, and the JVM ecosystem. We presented
626
+ the process to couple Ruby and R; the coupling is implemented by the Galaaz bridge and
627
+ **gKnit** for literate documents, not by a single GraalVM polyglot runtime.
662
628
 
663
- From the perspective of performance, GraalVM and Truffle promises improvements that could
664
- reach over 10 times, both for [FastR](https://medium.com/graalvm/faster-r-with-fastr-4b8db0e0dceb)
665
- and for [TruffleRuby](https://rubykaigi.org/2018/presentations/eregontp.html).
629
+ For performance, expect **ordinary GNU R** behaviour for model fitting and plotting, while
630
+ **JRuby** gives **real parallel threads** on the Ruby side and access to Java libraries when
631
+ you need them.
666
632
 
667
633
  This article has shown how to improve a plot step-by-step. Starting from a very simple
668
634
  boxplot with all default configurations, we moved slowly to our final plot. The important
@@ -676,11 +642,11 @@ be of great help for any Rubyist trying to write articles, blogs or documentatio
676
642
 
677
643
  # Installing Galaaz
678
644
 
679
- ## Prerequisites
645
+ ## Prerequisites (Galaaz 2.0)
680
646
 
681
- * GraalVM (>= rc8): https://github.com/oracle/graal/releases
682
- * TruffleRuby
683
- * FastR
647
+ * **JRuby** — Ruby on the JVM ([jruby.org](https://www.jruby.org/))
648
+ * A **JDK** compatible with your JRuby version
649
+ * **GNU R** — `R` on your `PATH`, with compilers/tools available if packages must be built from source
684
650
 
685
651
  The following R packages will be automatically installed when necessary, but could be installed prior
686
652
  to using gKnit if desired:
@@ -689,14 +655,16 @@ to using gKnit if desired:
689
655
  * gridExtra
690
656
  * knitr
691
657
 
692
- Installation of R packages requires a development environment and can be time consuming. In Linux,
693
- the gnu compiler and tools should be enough. I am not sure what is needed on the Mac.
658
+ Installation of R packages requires a development environment and can be time consuming. On Linux,
659
+ the usual build tools (e.g. a C/C++ compiler) are typically enough. On macOS, Xcode command-line tools
660
+ are commonly required.
694
661
 
695
662
  ## Preparation
696
663
 
697
- * gem install galaaz
664
+ * Install the **galaaz** gem (from RubyGems when published, or `gem build` / `path:` from a checkout).
698
665
 
699
666
  ## Usage
700
667
 
701
- * gknit <filename>
702
- * In a scrip add: require 'galaaz'
668
+ * From the Galaaz repository (or your installed layout), render documents with **`bin/gknit`** (see the project manual for flags such as `--output_format all`).
669
+ * In Ruby code: `require 'galaaz'`
670
+ * For running scripts with the correct JRuby and JVM options, use **`bin/galaaz-jruby`** as described in the manual.