diff --git a/.Rbuildignore b/.Rbuildignore index c21a41ab..c5347d25 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -20,4 +20,5 @@ ^naryndb/$ ^naryndb$ ^AGENTS\.md$ -^.claude$ \ No newline at end of file +^.claude$ +^\.Rd2pdf.*$ \ No newline at end of file diff --git a/CRAN-SUBMISSION b/CRAN-SUBMISSION index d37cf398..0f42f654 100644 --- a/CRAN-SUBMISSION +++ b/CRAN-SUBMISSION @@ -1,3 +1,3 @@ -Version: 2.6.32 -Date: 2026-01-18 17:42:41 UTC -SHA: 16c2625c7377a6838f2c28263e24519c86080763 +Version: 2.6.33 +Date: 2026-03-19 20:19:54 UTC +SHA: 453a10849252e5883574039ce1056a753a965dec diff --git a/DESCRIPTION b/DESCRIPTION index c2d79187..0c0439bf 100755 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: naryn Title: Native Access Medical Record Retriever for High Yield Analytics -Version: 2.6.32 +Version: 2.6.34 Authors@R: c( person("Misha", "Hoichman", , "misha@hoichman.com", role = "aut"), person("Aviezer", "Lifshitz", , "aviezer.lifshitz@weizmann.ac.il", role = c("aut", "cre")), @@ -55,4 +55,4 @@ Language: en-US LazyLoad: yes NeedsCompilation: yes OS_type: unix -RoxygenNote: 7.3.2 +RoxygenNote: 7.3.3 diff --git a/NEWS.md b/NEWS.md index 20d2153e..89205d58 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,11 @@ +# naryn 2.6.34 + +* Fixed CRAN pre-test warning about `pipe.Rd` documenting usage for re-exported `%>%`. + +# naryn 2.6.33 + +* Replaced non-API C entry point `Rf_findVar` with `R_getVar`/`R_getVarEx` for R 4.6.0 compatibility. + # naryn 2.6.32 * Fixed C++20 deprecation warnings: removed `std::rel_ops` usage and fixed enum arithmetic. diff --git a/R/utils-pipe.R b/R/utils-pipe.R index b5458cb4..8889ea37 100644 --- a/R/utils-pipe.R +++ b/R/utils-pipe.R @@ -7,10 +7,6 @@ #' @keywords internal #' @export #' @importFrom magrittr %>% -#' @usage lhs \%>\% rhs -#' @param lhs A value or the magrittr placeholder. -#' @param rhs A function call using the magrittr semantics. -#' @return The result of calling `rhs(lhs)`. NULL diff --git a/cran-comments.md b/cran-comments.md index 8affcafe..b2e9c1f5 100644 --- a/cran-comments.md +++ b/cran-comments.md @@ -2,5 +2,10 @@ 0 errors | 0 warnings | 0 notes -* Fixed C++20 deprecation warnings: removed `std::rel_ops` usage and fixed deprecated enum arithmetic. -* As was written in the previous submissions, the package implements a database that is based on shared memory files and therefore includes many unix-specific system calls. In addition, many parallel algorithms used in the package rely on the unix forking mechanism, therefore the package is not fully portable to Windows. +## Changes + +* Replaced non-API C entry point `Rf_findVar` with `R_getVar`/`R_getVarEx`. + +## Note on portability + +The package implements a database that is based on shared memory files and therefore includes many unix-specific system calls. In addition, many parallel algorithms used in the package rely on the unix forking mechanism, therefore the package is not fully portable to Windows. diff --git a/man/pipe.Rd b/man/pipe.Rd index 1f8f237b..9e29966a 100644 --- a/man/pipe.Rd +++ b/man/pipe.Rd @@ -3,17 +3,6 @@ \name{\%>\%} \alias{\%>\%} \title{Pipe operator} -\usage{ -lhs \%>\% rhs -} -\arguments{ -\item{lhs}{A value or the magrittr placeholder.} - -\item{rhs}{A function call using the magrittr semantics.} -} -\value{ -The result of calling `rhs(lhs)`. -} \description{ See \code{magrittr::\link[magrittr:pipe]{\%>\%}} for details. } diff --git a/src/NRIteratorFilter.cpp b/src/NRIteratorFilter.cpp index 29f8a823..d09b2e0b 100755 --- a/src/NRIteratorFilter.cpp +++ b/src/NRIteratorFilter.cpp @@ -18,7 +18,7 @@ void NRIteratorFilter::init(SEXP filter, unsigned stime, unsigned etime) vector filters; // retrieve filter names (named filters are at a variable called EMR_FILTERS inside the .naryn environment) - rprotect(emr_filters = Rf_findVar(Rf_install("EMR_FILTERS"), Rf_findVar(Rf_install(".naryn"), g_naryn->env()))); + rprotect(emr_filters = R_getVarEx(Rf_install("EMR_FILTERS"), R_getVar(Rf_install(".naryn"), g_naryn->env(), (Rboolean)TRUE), (Rboolean)TRUE, R_NilValue)); if (!Rf_isNull(emr_filters) && !Rf_isSymbol(emr_filters)) { @@ -183,7 +183,7 @@ EMRIteratorFilterItem *NRIteratorFilter::create_filter_item(vector &filter return filter; } - SEXP rval = Rf_findVar(Rf_install(str), g_naryn->env()); + SEXP rval = R_getVarEx(Rf_install(str), g_naryn->env(), (Rboolean)TRUE, R_NilValue); bool success = false; EMRPoints points; diff --git a/src/NRLogicalTrack.cpp b/src/NRLogicalTrack.cpp index c101fab3..fba03e8d 100644 --- a/src/NRLogicalTrack.cpp +++ b/src/NRLogicalTrack.cpp @@ -330,7 +330,7 @@ SEXP emr_expr_virtual_tracks(SEXP _expr, SEXP _envir) { vector vtracks; // retrieve virtual track names (virtual tracks are at a variable called EMR_VTRACKS in the .naryn environment) - rprotect(emr_vtracks = Rf_findVar(Rf_install("EMR_VTRACKS"), Rf_findVar(Rf_install(".naryn"), g_naryn->env()))); + rprotect(emr_vtracks = R_getVarEx(Rf_install("EMR_VTRACKS"), R_getVar(Rf_install(".naryn"), g_naryn->env(), (Rboolean)TRUE), (Rboolean)TRUE, R_NilValue)); if (!Rf_isNull(emr_vtracks) && !Rf_isSymbol(emr_vtracks)) { if (!Rf_isVector(emr_vtracks)){ diff --git a/src/NRTrackExpressionScanner.cpp b/src/NRTrackExpressionScanner.cpp index 4b3a1750..21de1e02 100755 --- a/src/NRTrackExpressionScanner.cpp +++ b/src/NRTrackExpressionScanner.cpp @@ -109,7 +109,7 @@ void NRTrackExprScanner::define_r_vars(unsigned eval_buf_limit) for (unsigned i = 0; i < eval_buf_limit; ++i){ m_itr_times[i] = 0; } - SEXP env = Rf_findVar(Rf_install(".GlobalEnv"), g_naryn->env()); + SEXP env = R_getVar(Rf_install(".GlobalEnv"), g_naryn->env(), (Rboolean)TRUE); Rf_defineVar(Rf_install("EMR_TIME"), m_ritr_times, env); for (unsigned iexpr = 0; iexpr < m_track_exprs.size(); ++iexpr) { diff --git a/src/NRTrackExpressionScanner.h b/src/NRTrackExpressionScanner.h index e20e61bc..abf8d784 100755 --- a/src/NRTrackExpressionScanner.h +++ b/src/NRTrackExpressionScanner.h @@ -240,7 +240,7 @@ inline bool NRTrackExprScanner::eval_next() m_track_exprs[iexpr].c_str(), Rf_length(m_eval_bufs[iexpr]), m_eval_buf_limit); if (Rf_isReal(m_eval_bufs[iexpr])) { if (m_valtype != REAL_T) { - SEXP env = Rf_findVar(Rf_install(".GlobalEnv"), g_naryn->env()); + SEXP env = R_getVar(Rf_install(".GlobalEnv"), g_naryn->env(), (Rboolean)TRUE); Rf_defineVar(Rf_install("EMR_ERROR_EXPR"), m_eval_bufs[iexpr], env); verror("Expression \"%s\" does not produce a numeric result.\n" "The result of the last expression evaluation was saved in EMR_ERROR_EXPR variable.", m_track_exprs[iexpr].c_str()); @@ -248,7 +248,7 @@ inline bool NRTrackExprScanner::eval_next() m_eval_doubles[iexpr] = REAL(m_eval_bufs[iexpr]); } else if (Rf_isLogical(m_eval_bufs[iexpr])) { if (m_valtype != LOGICAL_T) { - SEXP env = Rf_findVar(Rf_install(".GlobalEnv"), g_naryn->env()); + SEXP env = R_getVar(Rf_install(".GlobalEnv"), g_naryn->env(), (Rboolean)TRUE); Rf_defineVar(Rf_install("EMR_ERROR_EXPR"), m_eval_bufs[iexpr], env); verror("Expression \"%s\" does not produce a logical result.\n" "The result of the last expression evaluation was saved in EMR_ERROR_EXPR variable.", m_track_exprs[iexpr].c_str()); diff --git a/src/naryn.cpp b/src/naryn.cpp index f8b98af3..8f61f8ab 100755 --- a/src/naryn.cpp +++ b/src/naryn.cpp @@ -766,7 +766,7 @@ void runprotect_all() const char *get_groot(SEXP envir) { // no need to protect the returned value - SEXP groot = Rf_findVar(Rf_install("GROOT"), envir); + SEXP groot = R_getVar(Rf_install("GROOT"), envir, (Rboolean)TRUE); if (!Rf_isString(groot)) verror("GROOT variable does not exist"); @@ -777,7 +777,7 @@ const char *get_groot(SEXP envir) const char *get_glib_dir(SEXP envir) { // no need to protect the returned value - SEXP glibdir = Rf_findVar(Rf_install(".GLIBDIR"), envir); + SEXP glibdir = R_getVar(Rf_install(".GLIBDIR"), envir, (Rboolean)TRUE); if (!Rf_isString(glibdir)) verror(".GLIBDIR variable does not exist"); diff --git a/src/naryn.h b/src/naryn.h index c9bb34b8..9c92e934 100755 --- a/src/naryn.h +++ b/src/naryn.h @@ -21,6 +21,25 @@ #include #include +// Backward-compatible shim for R < 4.5.0 +#include +#if R_VERSION < R_Version(4, 5, 0) +static inline SEXP R_getVar(SEXP sym, SEXP rho, Rboolean inherits) { + SEXP val = inherits ? Rf_findVar(sym, rho) : Rf_findVarInFrame(sym, rho); + if (val == R_UnboundValue) + Rf_error("object '%s' not found", CHAR(PRINTNAME(sym))); + MARK_NOT_MUTABLE(val); + return val; +} +static inline SEXP R_getVarEx(SEXP sym, SEXP rho, Rboolean inherits, SEXP ifnotfound) { + SEXP val = inherits ? Rf_findVar(sym, rho) : Rf_findVarInFrame(sym, rho); + if (val == R_UnboundValue) + return ifnotfound; + MARK_NOT_MUTABLE(val); + return val; +} +#endif + #include "Thread.h" #ifdef length