MASS.h, and (3) making the main
script file call the MASS functions by doing include "MASS.h". But the same
errors were still present.
Thank you again for your help!
-Xiao
On Wed, Sep 3, 2014 at 9:52 PM, Dirk Eddelbuettel wrote:
>
> Xiao,
>
> On 3 September 2014 a
Hi Kevin,
Yes, those extra includes are there because some functions taken from the
MASS package need these them.
I rearranged the includes by placing #include before the
ones below, and was able to reduce the number of errors from 7 to 4.
#include
#include
#include
Is it possible for you t
Hi all,
I tried to compile a script using the code below:
Rscript compiler.R '/Users/xiaohe/WRScpp/src/test.cpp'
And I got 7 error messages in total as shown below. I am on a
at, Jul 6, 2013 at 9:28 PM, Dirk Eddelbuettel wrote:
>
> On 6 July 2013 at 18:56, Xiao He wrote:
> | Hi dear listers,
> |
> | Take the mock function below for an example. What would be the best way
> to
> | handle computational singularity?
>
> That is essent
Hi dear listers,
Take the mock function below for an example. What would be the best way to
handle computational singularity?
#include
#include
#include
// [[Rcpp::depends(RcppArmadillo)]]
using namespace Rcpp;
using namespace arma;
RcppExport SEXP foo(SEXP X, SEXP Y){
arma::mat x=Rcpp::as(
which
> the function qchisq is defined.
>
> Best
>
> Simon
>
>
> On Jul 5, 2013, at 6:22 PM, Xiao He wrote:
>
>> Hi,
>>
>> I tried to call qchisq() (see mock code below). But while compiling it, I
>> got an error message saying ` error: no
Hi,
I tried to call qchisq() (see mock code below). But while compiling it, I
got an error message saying ` error: no matching function for call to
‘qchisq(double, double, int, int)’`. I checked this file:
http://dirk.eddelbuettel.com/code/rcpp/html/Rmath_8h_source.html, and saw
this: " double
qc
en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods base
>
> other attached packages:
> [1] Rcpp_0.9.13
>
> On Thu, May 23, 2013 at 11:27 PM, Xiao He
> wrote:
> > If you com
If you compile it from within R using sourceCpp("cpp_file_name.cpp "). Or
if you use the package inline, you can do the following inside R.
cppFunction('
NumericVector callFunction(NumericVector x, Function f) {
NumericVector res = f(x);
return res;
}'
)
Both met
Dear listers,
To compile a C++ code that makes use of RcppArmadillo, one needs to have
Fortran installed on the computer. After compiling the code, if I would
like to use the compiled code on a computer that doesn't have Fortran, does
it mean I will also need to install it on that computer?
Than
llo-pass-user-defined-function
>
> http://gallery.rcpp.org/articles/passing-cpp-function-pointers/
>
> HTH,
>
> baptiste
>
> On 18 May 2013 19:00, Xiao He wrote:
>
>> Hi JJ,
>>
>> Thank you for the reply. I would actually like to pass C++ functions to
>>
this Rcpp Gallery article:
>
> http://gallery.rcpp.org/articles/r-function-from-c++/
>
> J.J.
>
> On Sat, May 18, 2013 at 1:31 PM, Xiao He wrote:
>
>> Hi everyone, I have two questions regarding passing a function name as an
>> argument.
>>
>> (1). Suppose that
Hi everyone, I have two questions regarding passing a function name as an
argument.
(1). Suppose that I have a function foo() shown below. The function takes a
NumericVector and a function pointer that points to a function that takes a
NumericVector and returns a double. Note that the function poi
Hi Dirk,
Does the code crash your R every time you run it or only occasionally? I
ran your sample code exactly the way it's written, and my R did not crash.
> myFun <- cppFunction('NumericMatrix myFun(NumericMatrix input, int n){
+ NumericMatrix A(n, n);
+ for(int Row = 0; Row < n; Row++) {
+
I tried it just now. Did not crash on my R. Mmm
myFun =cppFunction('NumericMatrix myFun(NumericMatrix input, int n){
+
+ NumericMatrix A(n, n);
+
+ for(int Row = 0; Row < n; Row++)
+ for(int Col = 0; Col < n; Col++)
+ {
+ A(Row, Col) = input(Row, Col);
+ }
+
+ return A;
+ }')
> n = 10
>
15 matches
Mail list logo