galaaz 0.5.0 → 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 +1360 -636
- data/Rakefile +61 -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 +84 -13
- data/bin/gknit-draft.rb +0 -0
- data/bin/gstudio +5 -3
- data/bin/gstudio_irb.rb +0 -0
- data/bin/gstudio_pry.rb +0 -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 +115 -155
- 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 +47 -52
- data/blogs/gknit/gknit.md +1430 -0
- 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 +852 -239
- data/blogs/manual/manual.log +1786 -0
- data/blogs/manual/manual.md +1360 -636
- data/blogs/manual/manual.tex +1883 -1161
- 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 +1 -1
- data/blogs/nse_dplyr/nse_dplyr.Rmd +84 -111
- data/blogs/nse_dplyr/nse_dplyr.log +928 -0
- data/blogs/nse_dplyr/nse_dplyr.md +198 -229
- 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 +1663 -86
- 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 -102
- 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 +0 -0
- data/examples/Bibliography/stats.bib +0 -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/acm_proc_article-sp.cls +0 -0
- data/examples/latex_templates/Test-acm_article/sigproc.bib +0 -0
- data/examples/latex_templates/Test-acs_article/acs-Test-acs_article.bib +0 -0
- data/examples/latex_templates/Test-acs_article/acs-my_output.bib +0 -0
- data/examples/latex_templates/Test-aea_article/BibFile.bib +0 -0
- data/examples/latex_templates/Test-aea_article/Test-aea_article.Rmd +0 -0
- data/examples/latex_templates/Test-aea_article/references.bib +0 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.Rmd +0 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.pdfsync +0 -0
- data/examples/latex_templates/Test-ieee_article/IEEEtran.bst +0 -0
- data/examples/latex_templates/Test-ieee_article/mybibfile.bib +0 -0
- data/examples/latex_templates/Test-rjournal_article/RJournal.sty +0 -0
- data/examples/latex_templates/Test-rjournal_article/RJreferences.bib +0 -0
- data/examples/latex_templates/Test-rjournal_article/Test-rjournal_article.Rmd +0 -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 +0 -0
- data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.Rmd +0 -0
- data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.Rmd +0 -0
- data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.Rmd +0 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/attend-grade-relationships.csv +0 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.Rmd +0 -0
- data/examples/rmarkdown/svm-xaringan-example/svm-xaringan-example.Rmd +0 -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 +3 -3
- data/lib/R_interface/r_methods.rb +13 -126
- 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 +0 -0
- data/lib/R_interface/rsupport.rb +609 -328
- 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 +23 -17
- data/lib/gknit/include_engine.rb +15 -7
- data/lib/gknit/knitr_engine.rb +223 -74
- data/lib/gknit/rb_engine.rb +3 -3
- data/lib/gknit/ruby_engine.rb +0 -0
- data/lib/gknit.rb +1 -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 -20
- 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 +0 -0
- 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 +194 -64
- data/blogs/galaaz_ggplot/galaaz_ggplot.html +0 -520
- data/blogs/galaaz_ggplot/galaaz_ggplot.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/manual/manual.html +0 -4638
- 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 -878
- data/blogs/nse_dplyr/nse_dplyr.pdf +0 -0
- data/blogs/oh_my/oh_my.html +0 -568
- data/blogs/ruby_plot/ruby_plot.html +0 -544
- data/blogs/ruby_plot/ruby_plot.pdf +0 -0
- data/examples/latex_templates/Test-acs_article/Test-acs_article.pdf +0 -0
- data/examples/latex_templates/Test-aea_article/Test-aea_article.pdf +0 -0
- data/examples/latex_templates/Test-amq_article/Test-amq_article.pdf +0 -0
- data/examples/latex_templates/Test-amq_article/pics/Figure2.pdf +0 -0
- data/examples/latex_templates/Test-asa_article/Test-asa_article.pdf +0 -0
- data/examples/latex_templates/Test-ieee_article/Test-ieee_article.pdf +0 -0
- data/examples/latex_templates/Test-rjournal_article/RJwrapper.pdf +0 -0
- data/examples/latex_templates/Test-springer_article/Test-springer_article.pdf +0 -0
- data/examples/rmarkdown/svm-rmarkdown-anon-ms-example/svm-rmarkdown-anon-ms-example.pdf +0 -0
- data/examples/rmarkdown/svm-rmarkdown-article-example/svm-rmarkdown-article-example.pdf +0 -0
- data/examples/rmarkdown/svm-rmarkdown-beamer-example/svm-rmarkdown-beamer-example.pdf +0 -0
- data/examples/rmarkdown/svm-rmarkdown-cv/svm-rmarkdown-cv.pdf +0 -0
- data/examples/rmarkdown/svm-rmarkdown-syllabus-example/svm-rmarkdown-syllabus-example.pdf +0 -0
- 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 -316
|
@@ -30,7 +30,8 @@ module R
|
|
|
30
30
|
dataframe = args[0]
|
|
31
31
|
|
|
32
32
|
args.each_with_index do |arg, index|
|
|
33
|
-
|
|
33
|
+
# Galaaz 2.0: Unbox names into a Ruby array to avoid method_missing recursion
|
|
34
|
+
(arg.names.unboxed_get).each { |n| attrs << n.to_sym }
|
|
34
35
|
end
|
|
35
36
|
|
|
36
37
|
Class.new do
|
data/lib/R_interface/rsymbol.rb
CHANGED
|
@@ -31,8 +31,58 @@ module R
|
|
|
31
31
|
include BinaryOperators
|
|
32
32
|
include ExecBinOp
|
|
33
33
|
include LogicalOperators
|
|
34
|
+
|
|
35
|
+
def class
|
|
36
|
+
::R::RSymbol
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def rclass
|
|
40
|
+
res = ::R::Support.exec_function("class", ::R::Support.exec_function("eval", self))
|
|
41
|
+
val = res.respond_to?(:>>) ? (res >> nil) : res
|
|
42
|
+
val.is_a?(::Array) ? val[0] : val
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def typeof
|
|
46
|
+
res = ::R::Support.exec_function("typeof", ::R::Support.exec_function("eval", self))
|
|
47
|
+
val = res.respond_to?(:>>) ? (res >> nil) : res
|
|
48
|
+
val.is_a?(::Array) ? val[0] : val
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
# Symbol name as string (e.g. "read.table") for call[[1]].to_s.
|
|
52
|
+
def to_s
|
|
53
|
+
return super unless ::R.bridge.ready?
|
|
54
|
+
raw = ::R.bridge.eval_r("as.character(#{@r_interop})").to_s
|
|
55
|
+
m = raw.match(/\[1\]\s*"([^"]*)"/)
|
|
56
|
+
m ? m[1] : raw.strip
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
def exec_bin_oper(operator, other_object)
|
|
60
|
+
# Use infix notation: lhs operator rhs, but evaluate self
|
|
61
|
+
op = operator.delete("`")
|
|
62
|
+
|
|
63
|
+
var_name = ::R::Support.generate_var_name
|
|
64
|
+
lhs = "eval(#{@r_interop})"
|
|
65
|
+
|
|
66
|
+
# If other object is a symbol, evaluate it too
|
|
67
|
+
rhs = if other_object.is_a?(::R::RSymbol)
|
|
68
|
+
"eval(#{other_object.r_interop})"
|
|
69
|
+
else
|
|
70
|
+
::R::Support.parse_arg(other_object)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
::R.bridge.eval_r("#{var_name} <- #{lhs} #{op} #{rhs}")
|
|
74
|
+
::R::Object.build(var_name)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def exec_uni_oper(operator)
|
|
78
|
+
op = operator.delete("`").strip
|
|
79
|
+
var_name = ::R::Support.generate_var_name
|
|
80
|
+
::R.bridge.eval_r("#{var_name} <- #{op}(eval(#{@r_interop}))")
|
|
81
|
+
::R::Object.build(var_name)
|
|
82
|
+
end
|
|
34
83
|
|
|
35
84
|
=begin
|
|
85
|
+
#--------------------------------------------------------------------------------------
|
|
36
86
|
#--------------------------------------------------------------------------------------
|
|
37
87
|
#
|
|
38
88
|
#--------------------------------------------------------------------------------------
|
|
@@ -48,9 +48,8 @@ module R
|
|
|
48
48
|
def initialize(object)
|
|
49
49
|
@object = object
|
|
50
50
|
|
|
51
|
-
#
|
|
52
|
-
|
|
53
|
-
@r_function = R::Support.ruby_callback_method.call(method(:callback))
|
|
51
|
+
# Use parse_arg to generate the R function that calls back this object's callback method
|
|
52
|
+
@r_function = R::Support.parse_arg(method(:callback))
|
|
54
53
|
end
|
|
55
54
|
|
|
56
55
|
#--------------------------------------------------------------------------------------
|
|
@@ -1,206 +1,256 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
##########################################################################################
|
|
4
|
-
# @author Rodrigo Botafogo
|
|
5
|
-
#
|
|
6
|
-
# Copyright © 2018 Rodrigo Botafogo. All Rights Reserved. Permission to use, copy, modify,
|
|
7
|
-
# and distribute this software and its documentation, without fee and without a signed
|
|
8
|
-
# licensing agreement, is hereby granted, provided that the above copyright notice, this
|
|
9
|
-
# paragraph and the following two paragraphs appear in all copies, modifications, and
|
|
10
|
-
# distributions.
|
|
11
|
-
#
|
|
12
|
-
# IN NO EVENT SHALL RODRIGO BOTAFOGO BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL,
|
|
13
|
-
# INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, ARISING OUT OF THE USE OF
|
|
14
|
-
# THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF RODRIGO BOTAFOGO HAS BEEN ADVISED OF THE
|
|
15
|
-
# POSSIBILITY OF SUCH DAMAGE.
|
|
16
|
-
#
|
|
17
|
-
# RODRIGO BOTAFOGO SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
18
|
-
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE
|
|
19
|
-
# SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY, PROVIDED HEREUNDER IS PROVIDED "AS IS".
|
|
20
|
-
# RODRIGO BOTAFOGO HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS,
|
|
21
|
-
# OR MODIFICATIONS.
|
|
22
|
-
##########################################################################################
|
|
23
|
-
|
|
24
|
-
#==========================================================================================
|
|
25
|
-
#
|
|
26
|
-
#==========================================================================================
|
|
1
|
+
# ruby_extensions.rb
|
|
27
2
|
|
|
28
|
-
|
|
3
|
+
# Ruby-only expression string builder: :a + :b => "a + b", chaining :a + :b + :c => "a + b + c".
|
|
4
|
+
# No R calls; used so R.expr(:e1 + :e2 + :e3) receives a string after Ruby evaluation.
|
|
5
|
+
class SymbolExprString
|
|
6
|
+
def initialize(part)
|
|
7
|
+
@str = part.to_s.gsub(/__/, ".")
|
|
8
|
+
end
|
|
29
9
|
|
|
30
|
-
|
|
10
|
+
def +(other)
|
|
11
|
+
other_str = other.respond_to?(:to_expr_str) ? other.to_expr_str : other.to_s.gsub(/__/, ".")
|
|
12
|
+
SymbolExprString.new("#{@str} + #{other_str}")
|
|
13
|
+
end
|
|
31
14
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
def to_s
|
|
16
|
+
@str
|
|
17
|
+
end
|
|
18
|
+
alias to_expr_str to_s
|
|
19
|
+
end
|
|
35
20
|
|
|
21
|
+
module R
|
|
22
|
+
module ExpBinOp
|
|
36
23
|
def exec_bin_oper(operator, other_object)
|
|
37
|
-
R::
|
|
38
|
-
other_object)
|
|
24
|
+
R::Language.build(operator, self, other_object)
|
|
39
25
|
end
|
|
40
|
-
|
|
41
|
-
#--------------------------------------------------------------------------------------
|
|
42
|
-
#
|
|
43
|
-
#--------------------------------------------------------------------------------------
|
|
44
|
-
|
|
45
26
|
def coerce(numeric)
|
|
46
|
-
[R::
|
|
27
|
+
[R::Language.new(numeric.to_s), self]
|
|
28
|
+
end
|
|
29
|
+
def inter(other_object)
|
|
30
|
+
exec_bin_oper("`:`", other_object)
|
|
31
|
+
end
|
|
32
|
+
def assign(other_object)
|
|
33
|
+
exec_bin_oper("`<-`", other_object)
|
|
47
34
|
end
|
|
48
|
-
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
#==========================================================================================
|
|
54
|
-
#
|
|
55
|
-
#==========================================================================================
|
|
56
|
-
|
|
57
|
-
module E
|
|
58
|
-
|
|
59
|
-
#----------------------------------------------------------------------------------------
|
|
60
|
-
# @param symbol [Symbol]
|
|
61
|
-
# @param args [Array] arguments to the missing method
|
|
62
|
-
#----------------------------------------------------------------------------------------
|
|
63
|
-
|
|
64
|
-
def self.method_missing(symbol, *args)
|
|
65
|
-
name = R::Support.convert_symbol2r(symbol)
|
|
66
|
-
rargs = R.exprs(name.to_sym, *args)
|
|
67
|
-
R.as__call(rargs)
|
|
68
|
-
end
|
|
69
|
-
|
|
70
|
-
end
|
|
71
|
-
|
|
72
|
-
#==========================================================================================
|
|
73
|
-
#
|
|
74
|
-
#==========================================================================================
|
|
75
|
-
|
|
76
|
-
class Range
|
|
77
|
-
|
|
78
|
-
#----------------------------------------------------------------------------------------
|
|
79
|
-
# Defines unary minus operation for ranges
|
|
80
|
-
#----------------------------------------------------------------------------------------
|
|
81
|
-
|
|
82
|
-
def -@
|
|
83
|
-
final_value = (exclude_end?)?
|
|
84
|
-
(first > last)?
|
|
85
|
-
(last + 1) : (last - 1)
|
|
86
|
-
: last
|
|
87
|
-
NegRange.new(self.begin, final_value)
|
|
88
35
|
end
|
|
89
|
-
|
|
90
36
|
end
|
|
91
37
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
38
|
+
module R
|
|
39
|
+
class SymbolRef
|
|
40
|
+
include R::BinaryOperators
|
|
41
|
+
include R::ExpBinOp
|
|
42
|
+
include R::LogicalOperators
|
|
97
43
|
|
|
98
|
-
|
|
44
|
+
REF_RUBY_RESERVED = %i[
|
|
45
|
+
to_str to_path to_ary to_int to_f to_r to_proc to_hash to_h to_a call
|
|
46
|
+
].freeze
|
|
99
47
|
|
|
100
|
-
|
|
48
|
+
def initialize(name)
|
|
49
|
+
@name = name
|
|
50
|
+
end
|
|
101
51
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
class Symbol
|
|
107
|
-
include R::BinaryOperators
|
|
108
|
-
include R::ExpBinOp
|
|
109
|
-
include R::LogicalOperators
|
|
110
|
-
|
|
111
|
-
#--------------------------------------------------------------------------------------
|
|
112
|
-
# Unary '+' converts a Ruby Symbol into an R Symbol
|
|
113
|
-
#--------------------------------------------------------------------------------------
|
|
114
|
-
|
|
115
|
-
def +@
|
|
116
|
-
R.expr(self)
|
|
117
|
-
end
|
|
52
|
+
def to_r_symbol
|
|
53
|
+
@name.to_s.gsub(/__/, ".")
|
|
54
|
+
end
|
|
118
55
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
56
|
+
def +@
|
|
57
|
+
var_name = R::Support.generate_var_name
|
|
58
|
+
R.bridge.eval_r("#{var_name} <- as.name('#{to_r_symbol}')")
|
|
59
|
+
R::Object.build(var_name)
|
|
60
|
+
end
|
|
122
61
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
62
|
+
def ~@
|
|
63
|
+
expr = to_r_symbol
|
|
64
|
+
var_name = R::Support.generate_var_name
|
|
65
|
+
R.bridge.eval_r("#{var_name} <- #{expr}")
|
|
66
|
+
R::Object.build(var_name)
|
|
67
|
+
end
|
|
126
68
|
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
69
|
+
def up_to(other_object)
|
|
70
|
+
R::Language.build("`:`", self, other_object)
|
|
71
|
+
end
|
|
130
72
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
def _(*args)
|
|
143
|
-
name = "%#{args.shift.to_s}%"
|
|
144
|
-
args.unshift(self)
|
|
145
|
-
rargs = R.exprs(name, *args)
|
|
146
|
-
R.as__call(rargs)
|
|
147
|
-
end
|
|
148
|
-
|
|
149
|
-
#--------------------------------------------------------------------------------------
|
|
150
|
-
#
|
|
151
|
-
#--------------------------------------------------------------------------------------
|
|
73
|
+
def method_missing(method_name, *args)
|
|
74
|
+
super if REF_RUBY_RESERVED.include?(method_name)
|
|
75
|
+
name = R::Support.convert_symbol2r(method_name)
|
|
76
|
+
r_args = [self, *args].map { |arg| R::Support.parse_arg(arg) }
|
|
77
|
+
expr = "#{name}(#{r_args.join(", ")})"
|
|
78
|
+
res = R::Language.allocate
|
|
79
|
+
res.instance_variable_set(:@r_interop, expr)
|
|
80
|
+
res.expression = expr
|
|
81
|
+
res
|
|
82
|
+
end
|
|
152
83
|
|
|
153
|
-
|
|
154
|
-
|
|
84
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
85
|
+
return false if method_name == :r_interop || method_name == :expression
|
|
86
|
+
return false if REF_RUBY_RESERVED.include?(method_name)
|
|
87
|
+
true
|
|
88
|
+
end
|
|
155
89
|
end
|
|
90
|
+
end
|
|
156
91
|
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
92
|
+
module E
|
|
93
|
+
def self.method_missing(symbol, *args)
|
|
94
|
+
name = R::Support.convert_symbol2r(symbol)
|
|
95
|
+
r_args = args.map { |arg| R::Support.parse_arg(arg) }
|
|
96
|
+
expr = "#{name}(#{r_args.join(", ")})"
|
|
97
|
+
|
|
98
|
+
res = R::Language.allocate
|
|
99
|
+
res.instance_variable_set(:@r_interop, expr)
|
|
100
|
+
res.expression = expr
|
|
101
|
+
res
|
|
163
102
|
end
|
|
164
|
-
|
|
165
|
-
#--------------------------------------------------------------------------------------
|
|
166
|
-
#
|
|
167
|
-
#--------------------------------------------------------------------------------------
|
|
103
|
+
end
|
|
168
104
|
|
|
169
|
-
|
|
105
|
+
module Galaaz
|
|
106
|
+
module SymbolDSL
|
|
107
|
+
SYMBOL_RUBY_RESERVED = %i[
|
|
108
|
+
to_str to_path to_ary to_int to_f to_r to_proc to_hash to_h to_a call
|
|
109
|
+
].freeze
|
|
170
110
|
|
|
171
|
-
|
|
172
|
-
|
|
111
|
+
refine Symbol do
|
|
112
|
+
def __galaaz_ref
|
|
113
|
+
R::SymbolRef.new(self)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
def +(other_object)
|
|
117
|
+
__galaaz_ref + other_object
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
def -(other_object)
|
|
121
|
+
__galaaz_ref - other_object
|
|
122
|
+
end
|
|
123
|
+
|
|
124
|
+
def *(other_object)
|
|
125
|
+
__galaaz_ref * other_object
|
|
126
|
+
end
|
|
127
|
+
|
|
128
|
+
def /(other_object)
|
|
129
|
+
__galaaz_ref / other_object
|
|
130
|
+
end
|
|
131
|
+
|
|
132
|
+
def **(other_object)
|
|
133
|
+
__galaaz_ref ** other_object
|
|
134
|
+
end
|
|
135
|
+
|
|
136
|
+
def %(other_object)
|
|
137
|
+
__galaaz_ref % other_object
|
|
138
|
+
end
|
|
139
|
+
|
|
140
|
+
def int_div(other_object)
|
|
141
|
+
__galaaz_ref.int_div(other_object)
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
def eq(other_object)
|
|
145
|
+
__galaaz_ref.eq(other_object)
|
|
146
|
+
end
|
|
147
|
+
|
|
148
|
+
def eql(other_object)
|
|
149
|
+
__galaaz_ref.eql(other_object)
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
def <(other_object)
|
|
153
|
+
__galaaz_ref < other_object
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def <=(other_object)
|
|
157
|
+
__galaaz_ref <= other_object
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
def >(other_object)
|
|
161
|
+
__galaaz_ref > other_object
|
|
162
|
+
end
|
|
163
|
+
|
|
164
|
+
def >=(other_object)
|
|
165
|
+
__galaaz_ref >= other_object
|
|
166
|
+
end
|
|
167
|
+
|
|
168
|
+
def !=(other_object)
|
|
169
|
+
__galaaz_ref != other_object
|
|
170
|
+
end
|
|
171
|
+
|
|
172
|
+
def ne(other_object)
|
|
173
|
+
__galaaz_ref.ne(other_object)
|
|
174
|
+
end
|
|
175
|
+
|
|
176
|
+
def til(other_object)
|
|
177
|
+
__galaaz_ref.til(other_object)
|
|
178
|
+
end
|
|
179
|
+
|
|
180
|
+
def inter(other_object)
|
|
181
|
+
__galaaz_ref.inter(other_object)
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
def assign(other_object)
|
|
185
|
+
__galaaz_ref.assign(other_object)
|
|
186
|
+
end
|
|
187
|
+
|
|
188
|
+
def _(op, other_object)
|
|
189
|
+
__galaaz_ref._(op, other_object)
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
def &(other_object)
|
|
193
|
+
__galaaz_ref.&(other_object)
|
|
194
|
+
end
|
|
195
|
+
|
|
196
|
+
def |(other_object)
|
|
197
|
+
__galaaz_ref.|(other_object)
|
|
198
|
+
end
|
|
199
|
+
|
|
200
|
+
def +@
|
|
201
|
+
__galaaz_ref.+@
|
|
202
|
+
end
|
|
203
|
+
|
|
204
|
+
def ~@
|
|
205
|
+
__galaaz_ref.~@
|
|
206
|
+
end
|
|
207
|
+
|
|
208
|
+
def up_to(other_object)
|
|
209
|
+
__galaaz_ref.up_to(other_object)
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
def method_missing(method_name, *args)
|
|
213
|
+
return super if Galaaz::SymbolDSL::SYMBOL_RUBY_RESERVED.include?(method_name)
|
|
214
|
+
__galaaz_ref.public_send(method_name, *args)
|
|
215
|
+
end
|
|
216
|
+
|
|
217
|
+
def respond_to_missing?(method_name, include_private = false)
|
|
218
|
+
return false if Galaaz::SymbolDSL::SYMBOL_RUBY_RESERVED.include?(method_name)
|
|
219
|
+
__galaaz_ref.respond_to?(method_name, include_private) || super
|
|
220
|
+
end
|
|
221
|
+
end
|
|
173
222
|
end
|
|
223
|
+
end
|
|
174
224
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
225
|
+
#--------------------------------------------------------------------------------------
|
|
226
|
+
# NilClass: R NULL is converted to Ruby nil. So nil must respond to is__null / isTRUE
|
|
227
|
+
# so that code like obj.is__null.unboxed_get(0) does not raise when obj is nil.
|
|
228
|
+
#--------------------------------------------------------------------------------------
|
|
229
|
+
module R
|
|
230
|
+
# Result object for nil.is__null so that nil.is__null.unboxed_get(0) => true.
|
|
231
|
+
class NullCheckResult
|
|
232
|
+
def initialize(bool)
|
|
233
|
+
@bool = bool
|
|
234
|
+
end
|
|
235
|
+
def unboxed_get(_index = nil)
|
|
236
|
+
@bool
|
|
237
|
+
end
|
|
238
|
+
# For (nil.is__null | x).unboxed_get(0): true | x => true; false | x => x
|
|
239
|
+
def |(other)
|
|
240
|
+
@bool ? self : other
|
|
241
|
+
end
|
|
182
242
|
end
|
|
243
|
+
NULL_IS_NULL = NullCheckResult.new(true).freeze
|
|
244
|
+
NULL_IS_FALSE = NullCheckResult.new(false).freeze
|
|
245
|
+
end
|
|
183
246
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
def inter(var2)
|
|
190
|
-
R::Support.exec_function(R::Support.range, self, var2)
|
|
247
|
+
class NilClass
|
|
248
|
+
# R NULL becomes Ruby nil; treat nil as null so .is__null.unboxed_get(0) works.
|
|
249
|
+
def is__null
|
|
250
|
+
R::NULL_IS_NULL
|
|
191
251
|
end
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
# This is because starting from ruby 1.9 the code for Array#flatten has changed,
|
|
196
|
-
# calling 'to_ary' blindly (even if the method is not implemented). This causes
|
|
197
|
-
# the method to be caught by 'method_missing' and here sending a 'to_ary' no found
|
|
198
|
-
# error. If we create to_ary, then no error is issued.
|
|
199
|
-
# @TODO: make sure that implementing 'to_ary' as bellow will not create problems
|
|
200
|
-
#--------------------------------------------------------------------------------------
|
|
201
|
-
|
|
202
|
-
def to_ary
|
|
203
|
-
# [self.to_s]
|
|
252
|
+
# R's isTRUE(NULL) is FALSE; so nil.isTRUE.unboxed_get(0) => false.
|
|
253
|
+
def isTRUE
|
|
254
|
+
R::NULL_IS_FALSE
|
|
204
255
|
end
|
|
205
|
-
|
|
206
256
|
end
|
|
File without changes
|