Implement r2_exact function for R package#56
Conversation
- Add r2_exact.c to Makevars compilation - Add C wrapper r2_exact_C in Rmoocore.c - Register r2_exact_C in init.h - Create r/R/r2.R with roxygen2 documentation and doctest examples - Create r/man/r2_exact.Rd manual page - Update NAMESPACE to export r2_exact - Add r/tests/testthat/test_r2.R with tests from Python - Add r/tests/testthat/test-doctest-r2_exact.R with doctest examples Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #56 +/- ##
==========================================
+ Coverage 78.06% 78.15% +0.08%
==========================================
Files 63 64 +1
Lines 5949 5973 +24
Branches 913 913
==========================================
+ Hits 4644 4668 +24
- Misses 1102 1105 +3
+ Partials 203 200 -3
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
|
@copilot Use example1_dat instead of ALG_1 for the R doctest to implement the python doctest that uses input1.dat, and do not omit it. To keep the explanatory text within the Python examples you can use comments in R. |
|
@copilot Also, translate the documentation about "(Exact) R2 Indicator" found in https://github.com/multi-objective/moocore/blob/main/python/doc/source/reference/functions.metrics.rst to roxygen2 and include it in the details section of the documentation of the r2_exact function in R. |
Replace ALG_1_dat.xz with example1_dat (R equivalent of Python's input1.dat) and remove @omit so all examples are tested. Add explanatory comments matching the Python docstring text. Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
Done in 31f32bd. Replaced Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Translate the (Exact) R2 Indicator documentation from python/doc/source/reference/functions.metrics.rst to roxygen2 format in the @details section, including mathematical definition, properties, and citations (HanJas1998, SchKer2025r2v2). Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
Done in aadf696. Added the full R2 indicator documentation from the Python RST to the Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Co-authored-by: MLopez-Ibanez <2620021+MLopez-Ibanez@users.noreply.github.com>
r2_exact.ctoMOOCORE_SRC_FILESinr/src/Makevarsso it gets compiledr2_exact_Cinr/src/Rmoocore.cthat bridges R to the Cr2_exact()functionr/src/init.hr/R/r2.Rwith ther2_exact()R function, roxygen2 docs, and doctest examplesr/man/r2_exact.Rdmanual pager/NAMESPACEto exportr2_exactr/tests/testthat/test_r2.Rwith tests converted from Pythonr/tests/testthat/test-doctest-r2_exact.Rwith doctest examplesexample1_datinstead ofALG_1_dat.xzin doctest examples, with explanatory comments from Python docstring@detailsOriginal prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.