From whizvast at gmail.com  Sat Apr 18 10:12:50 2009
From: whizvast at gmail.com (whizvast)
Date: Sat, 18 Apr 2009 01:12:50 -0700 (PDT)
Subject: [Rd]  export C++ array to R
Message-ID: <23110405.post@talk.nabble.com>


Hi, I am a newbie on C++

Right now I have an array of doubles in C++.

Is there a way to "export" that array into R? Of course, I can allocate 
the memory block first using "allocVector" and copying the array contents 
one by one.

But, what if that array is fairly large? Copying doesn't look that
efficient.
I was thinking of setting the data pointer(DATAPTR) point to that array,
and adjust the LENGTH of SEXP. But I don't know how to do that.

Any comment/answer would be much appreciated. Thank you.
-- 
View this message in context: http://www.nabble.com/export-C%2B%2B-array-to-R-tp23110405p23110405.html
Sent from the R devel mailing list archive at Nabble.com.



[Rd] export C++ array to R
whizvast