Skip to content

Commit

Permalink
moved dimnames access to use cpp methods instead of c macros
Browse files Browse the repository at this point in the history
  • Loading branch information
mlilback committed Nov 15, 2017
1 parent 09e257d commit 7ab8464
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/EnvironmentWatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,10 @@ RC2::EnvironmentWatcher::setDimNames ( RObject& robj, json& jobj )
jobj["dims"] = rvectorToJsonArray(robj);
}
if (robj.hasAttribute("dimnames")) {
RObject mlist(robj.attr("dimnames"));
Rcpp::List mlist(robj.attr("dimnames"));
json dnames;
for (int i=0; i < LENGTH(mlist); i++) {
RObject cl(VECTOR_ELT(mlist, i));
for (int i=0; i < mlist.length(); i++) {
RObject cl(mlist[i]);
dnames.push_back(rvectorToJsonArray(cl));
}
jobj["dimnames"] = dnames;
Expand Down

0 comments on commit 7ab8464

Please sign in to comment.