From de7474b98d2aa05a0644e6b0dbe9052fff121172 Mon Sep 17 00:00:00 2001 From: Michael Kane Date: Fri, 16 Oct 2015 15:31:26 -0400 Subject: [PATCH] The new version of bigmemory has a private function (getCType) that needs to be called instead of calling the C function directly. These changes use the new interface that will soon be on CRAN. --- R/grow.R | 2 +- R/predict.R | 2 +- R/varimp.R | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/R/grow.R b/R/grow.R index 3d3fdff..99622fb 100644 --- a/R/grow.R +++ b/R/grow.R @@ -219,7 +219,7 @@ setMethod("grow", signature(forest="bigcforest"), function( if (trace >= 2L) message("Tree ", treenum, ": Growing tree.") - xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory")) + xtype <- as.integer(bigmemory:::getCType(x)) tree <- .Call("growtreeC", x@address, xtype, a@address, a.out@address, forest, insamp, inweight, treenum, trace) diff --git a/R/predict.R b/R/predict.R index e36e28c..36bb948 100644 --- a/R/predict.R +++ b/R/predict.R @@ -93,7 +93,7 @@ setMethod("predict", signature(object="bigcforest"), function( } ntest <- as.integer(nrow(x)) - xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory")) + xtype <- as.integer(bigmemory:::getCType(x)) ynclass <- length(levels(forest@y)) # fast fix on the test data diff --git a/R/varimp.R b/R/varimp.R index 8c45a13..4e1e930 100644 --- a/R/varimp.R +++ b/R/varimp.R @@ -95,7 +95,7 @@ setMethod("varimp", signature(forest="bigcforest"), function( nvar <- length(forest@varselect) ntest <- as.integer(nrow(x)); - xtype <- as.integer(.Call("CGetType", x@address, PACKAGE="bigmemory")) + xtype <- as.integer(bigmemory:::getCType(x)) importance <- numeric(nvar) importance.sq <- numeric(nvar) @@ -187,4 +187,4 @@ setMethod("varimp", signature(forest="bigcforest"), function( return(list(importance=importance, importance.ex=importance.ex, zscore=zscore, significance=significance)) }) - \ No newline at end of file +