Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@
^naryndb/$
^naryndb$
^AGENTS\.md$
^.claude$
^.claude$
^\.Rd2pdf.*$
6 changes: 3 additions & 3 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -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
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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")),
Expand Down Expand Up @@ -55,4 +55,4 @@ Language: en-US
LazyLoad: yes
NeedsCompilation: yes
OS_type: unix
RoxygenNote: 7.3.2
RoxygenNote: 7.3.3
8 changes: 8 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
4 changes: 0 additions & 4 deletions R/utils-pipe.R
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
9 changes: 7 additions & 2 deletions cran-comments.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
11 changes: 0 additions & 11 deletions man/pipe.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/NRIteratorFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void NRIteratorFilter::init(SEXP filter, unsigned stime, unsigned etime)
vector<SEXP> 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)) {

Expand Down Expand Up @@ -183,7 +183,7 @@ EMRIteratorFilterItem *NRIteratorFilter::create_filter_item(vector<SEXP> &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;
Expand Down
2 changes: 1 addition & 1 deletion src/NRLogicalTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ SEXP emr_expr_virtual_tracks(SEXP _expr, SEXP _envir) {
vector<SEXP> 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)){
Expand Down
2 changes: 1 addition & 1 deletion src/NRTrackExpressionScanner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions src/NRTrackExpressionScanner.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,15 @@ 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());
}
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());
Expand Down
4 changes: 2 additions & 2 deletions src/naryn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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");
Expand Down
19 changes: 19 additions & 0 deletions src/naryn.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@
#include <Rinternals.h>
#include <Rinterface.h>

// Backward-compatible shim for R < 4.5.0
#include <Rversion.h>
#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
Expand Down
Loading