-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
The problem is with loading and saving the data. Am I doing it correctly or are there some changes that I am supposed to make. Kindly advise.
The code I am using is mentioned below.
library("inline")
library("RcppMLPACK")
write.table(iris[,1:4] , "iris.csv" , col.names = FALSE , row.names = FALSE)
code <- '
std::string inputFile = Rcpp::as<std::string>(input);
std::string outputFile = Rcpp::as<std::string>(output);
arma::mat data;
mlpack::data::Load(inputFile ,data ,true);
arma::mat cov = data * trans(data) / data.n_cols;
mlpack::data::Save(outputFile, cov)
'
mlCov_2 <- cxxfunction(signature(input="iris.csv" , output = "cov.csv") , code, plugin="RcppMLPACK")
The error is mentioned below:
Error in compileCode(f, code, language = language, verbose = verbose) :
Compilation ERROR, function(s)/method(s) not created! file27c07f10c076.cpp: In function ‘SEXPREC* file27c07f10c076(SEXP, SEXP)’:
file27c07f10c076.cpp:34:3: error: ‘Load’ is not a member of ‘mlpack::data’
mlpack::data::Load(inputFile ,data ,true);
^
file27c07f10c076.cpp:36:3: error: ‘Save’ is not a member of ‘mlpack::data’
mlpack::data::Save(outputFile, cov)
^
In file included from /home/nikhil/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/Rcpp/r/headers.h:50:0,
from /home/nikhil/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include/RcppCommon.h:29,
from /home/nikhil/R/x86_64-pc-linux-gnu-library/3.3/RcppArmadillo/include/RcppArmadilloForward.h:26,
from /home/nikhil/R/x86_64-pc-linux-gnu-library/3.3/RcppArmadillo/include/RcppArmadillo.h:31,
from /home/nikhil/R/x86_64-pc-linux-gnu-library/3.3/RcppMLPACK/include/mlpack/core/arma_extend/arma_extend.hpp:19,
from /home/nik
In addition: Warning message:
running command '/usr/lib/R/bin/R CMD SHLIB file27c07f10c076.cpp 2> file27c07f10c076.cpp.err.txt' had status 1
Version of
RcppMLPACK_1.0.10-6
inline_0.3.14
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels