Re: [Rcpp-devel] R.e. loadRcppModules

2011-04-12 Thread Romain Francois
Le 13/04/11 07:29, Christian Gunning a écrit : On Tue, Apr 12, 2011 at 7:06 AM, Douglas Bates wrote: The documented behavior is that an external pointer is replaced by a null pointer when an object is serialized. Thanks. Got it. I was planning to experiment with an object that has enough

Re: [Rcpp-devel] R.e. loadRcppModules

2011-04-12 Thread Christian Gunning
On Tue, Apr 12, 2011 at 7:06 AM, Douglas Bates wrote: > > The documented behavior is that an external pointer is replaced by a > null pointer when an object is serialized. Thanks. Got it. > I was planning to > experiment with an object that has enough information saved as R > objects to be able

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Dirk Eddelbuettel
On 12 April 2011 at 15:04, deqiang sun wrote: | Thanks, the stringsAsFactors=FALSE option works. And Rcpp 0.9.4 is now on CRAN which contains a fix Romain but that no longer requires it. Dirk | Dsun | On Apr 12, 2011, at 6:36 AM, Dirk Eddelbuettel wrote: | | > | > On 12 April 2011 at 05:38,

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread deqiang sun
Thanks, the stringsAsFactors=FALSE option works. Dsun On Apr 12, 2011, at 6:36 AM, Dirk Eddelbuettel wrote: > > On 12 April 2011 at 05:38, deqiang sun wrote: > | How should I read the txt in the following context? > | c3 3a > | c1 1b > | c2 2c > | > | The code I have is > | RIns

Re: [Rcpp-devel] Conflit with sys/vnode.h on Solaris (gcc 4.4.3)

2011-04-12 Thread Douglas Bates
On Tue, Apr 12, 2011 at 11:11 AM, Giuseppe Milicia wrote: > Dirk, > > I steer away from the Solaris compiler, too many headaches there... > > I'm currently using gcc 4.4.3 > > I tried rearranging the headers (in my code) but I got nowhere :( I suspect > this is the case because sys/vnode.h is use

Re: [Rcpp-devel] Conflit with sys/vnode.h on Solaris (gcc 4.4.3)

2011-04-12 Thread Giuseppe Milicia
Dirk, I steer away from the Solaris compiler, too many headaches there... I'm currently using gcc 4.4.3 I tried rearranging the headers (in my code) but I got nowhere :( I suspect this is the case because sys/vnode.h is used by the standard libraries and those are included in RcppCommon before

Re: [Rcpp-devel] Conflit with sys/vnode.h on Solaris (gcc 4.4.3)

2011-04-12 Thread Dirk Eddelbuettel
On 12 April 2011 at 16:43, Giuseppe Milicia wrote: | Guys, | | | | I was wondering if anyone has seen a conflict between Rcpp and sys/vnode.h on | Solaris (gcc 4.4.3, R-2.12.2). We do not have access to Solaris. We do however get scolded by Prof Ripley if it doesn't pass 'R CMD check' (or ev

[Rcpp-devel] Conflit with sys/vnode.h on Solaris (gcc 4.4.3)

2011-04-12 Thread Giuseppe Milicia
Guys, I was wondering if anyone has seen a conflict between Rcpp and sys/vnode.h on Solaris (gcc 4.4.3, R-2.12.2). This could be my fault entirely but before I spend a few hours on this I thought I might just ask... This is the error and indeed at like 565 of sys/vnode.h we have "struct as;"

Re: [Rcpp-devel] R.e. loadRcppModules

2011-04-12 Thread Douglas Bates
On Tue, Apr 12, 2011 at 1:11 AM, Romain Francois wrote: > Le 12/04/11 04:15, Christian Gunning a écrit : >> >> On Mon, Apr 11, 2011 at 3:00 AM, >>  wrote: >>> >>> >>> This will load the declared modules, and populate them into your >>> package's namespace. >>> >>> I will update the Rcpp-modules v

Re: [Rcpp-devel] passing zoo series between c++ and R

2011-04-12 Thread Dirk Eddelbuettel
On 12 April 2011 at 14:10, Giuseppe Milicia wrote: | I can see no built-in support for zoo objects in Rcpp (I seem to recall there | was support on the old version), is that right? I have always split this into a vector of times (trivially using as.numeric() first on the POSIXct data to use doubl

Re: [Rcpp-devel] passing zoo series between c++ and R

2011-04-12 Thread Romain Francois
Le 12/04/11 15:10, Giuseppe Milicia a écrit : Guys, I can see no built-in support for zoo objects in Rcpp (I seem to recall there was support on the old version), is that right? If it is has anyone written an extension supporting zoo and is willing to share? Cheers! //Giuseppe Maybe you ref

[Rcpp-devel] passing zoo series between c++ and R

2011-04-12 Thread Giuseppe Milicia
Guys, I can see no built-in support for zoo objects in Rcpp (I seem to recall there was support on the old version), is that right? If it is has anyone written an extension supporting zoo and is willing to share? Cheers! //Giuseppe MAKO This email an

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Romain Francois
Should work as expected with the next version of Rcpp (svn version >= 3000). require( Rcpp ) require( inline ) df <- data.frame( V1 = c("c3", "c1", "c2" ), V2 = c("3a", "1b", "2c" ) ) fx <- cxxfunction( signature( x = "data.frame" ), ' DataFrame DF(x); StringVector v1 = DF["V

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Dirk Eddelbuettel
On 12 April 2011 at 05:38, deqiang sun wrote: | How should I read the txt in the following context? | c33a | c11b | c22c | | The code I have is | RInside R(argc, argv); | SEXP ans; | | std::string txt = "a=read.csv('xxx.xls',sep='\t',head=F)

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Romain Francois
Le 12/04/11 13:30, Romain Francois a écrit : Hmmm. I have a bad feeling about this. I sense a disturbance in the force. It goes down to coerceVector not doing its job on factors: require( Rcpp ) require( inline ) v1 <- as.factor( c("c3", "c1", "c2" ) ) fx <- cfunction( signature( x = "factor" )

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Romain Francois
Hmmm. I have a bad feeling about this. I sense a disturbance in the force. It goes down to coerceVector not doing its job on factors: require( Rcpp ) require( inline ) v1 <- as.factor( c("c3", "c1", "c2" ) ) fx <- cfunction( signature( x = "factor" ), ' SEXP s = PROTECT( coerceVector( x, STR

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread deqiang sun
How should I read the txt in the following context? c3 3a c1 1b c2 2c The code I have is RInside R(argc, argv); SEXP ans; std::string txt = "a=read.csv('xxx.xls',sep='\t',head=F)"; ans = R.parseEval(txt);

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread deqiang sun
I agree I realized the row is usually mixed of numbers and texts. On Apr 12, 2011, at 4:14 AM, Romain Francois wrote: > Le 12/04/11 10:57, deqiang sun a écrit : >> Hi Dirk, >> >> Thanks very much for your example. From this example I learned how to >> passing data back and forth between R and C+

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread Romain Francois
Le 12/04/11 10:57, deqiang sun a écrit : Hi Dirk, Thanks very much for your example. From this example I learned how to passing data back and forth between R and C++. The example is R code and uses piece of C++ code in side R program. Well, it's better if you put this example(by only making sli

Re: [Rcpp-devel] data.frame from R to C++?

2011-04-12 Thread deqiang sun
Hi Dirk, Thanks very much for your example. From this example I learned how to passing data back and forth between R and C++. The example is R code and uses piece of C++ code in side R program. Well, it's better if you put this example(by only making slight changes to make R embeded in C++) in