[Rd] invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.

2013-05-14 Thread Xiao He
Dear R-Developers, I just started learning how to use Rcpp. Earlier while using it, I encountered an error as shown below: file74d8254b96d4.cpp: In function ‘Rcpp::NumericVector foo(Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::NumericVector, Rcpp::Function, Rcpp::Function)’:

[Rd] Segmentation fault on Python+Rpy2+R

2013-05-14 Thread cuiyan
Hi, everyone I met a trouble, not only about R, but Python+RPy2+R When I run from rpy2 import robjects or other packages/codes, I receive Segmentation Fault inevitably like this: linux-yhwx:/ # python Python 2.7.2 (default, Aug 19 2011, 20:41:43) [GCC] on linux2 Type help, copyright, credits or

Re: [Rd] invalid operands of types ‘SEXPREC*’ and ‘R_len_t’ to binary ‘operator/’ with Rcpp.

2013-05-14 Thread Romain Francois
Please use the appropriate mailing list (Rcpp-devel) for Rcpp questions. Romain Le 14 mai 2013 à 06:42, Xiao He praguewaterme...@gmail.com a écrit : Dear R-Developers, I just started learning how to use Rcpp. Earlier while using it, I encountered an error as shown below:

Re: [Rd] invalid operands of types ‘SEXPREC*’ an d ‘R_len_t’ to binary ‘operator/’ wit h Rcpp.

2013-05-14 Thread Dirk Eddelbuettel
On 13 May 2013 at 21:42, Xiao He wrote: | Dear R-Developers, | | I just started learning how to use Rcpp. Earlier while using it, I | encountered an error as shown below: | | file74d8254b96d4.cpp: In function �Rcpp::NumericVector | foo(Rcpp::NumericVector, Rcpp::NumericVector,

Re: [Rd] call R function from C code

2013-05-14 Thread Dirk Eddelbuettel
If you are fine with another package doing the legwork for you, calling an R function from C++ is very easy: R library(Rcpp) R cppFunction('NumericVector fun(NumericMatrix X, NumericVector y, Function s) { return s(X, y); }') R set.seed(42); solve(matrix(rnorm(9),3,3), rep(1,3)) [1] -0.778649

Re: [Rd] invalid operands of types ‘SEXPREC*’ an d ‘R_len_t’ to binary ‘operator/’ wit h Rcpp.

2013-05-14 Thread Xiao He
Thank you! I will send my reply to Rcpp-devel from now on Re: my question -. Since I thought cppFunction() allows vectorized operations, I thought any R functions I call from R would also allow it. pbeta() within R can be specified as pbeta(runif(10), 1, 2) where the first argument is a vector.

Re: [Rd] invalid operands of types ‘SEXPREC*’ an d ‘R_len_t’ to binary ‘operator/’ wit h Rcpp.

2013-05-14 Thread Dirk Eddelbuettel
On 14 May 2013 at 06:47, Xiao He wrote: | Thank you! | | I will send my reply to Rcpp-devel from now on Re: my question -. Since I | thought cppFunction() allows vectorized operations, I thought any R functions I | call from R would also allow it. pbeta() within R can be specified as  pbeta |

[Rd] problem in add1's F statistic when data contains NAs?

2013-05-14 Thread William Dunlap
Shouldn't the F statistic (and p value) for the x2 term in the following calls to anova() and add1() be the same? I think anova() gets it right and add1() does not. d - data.frame(y=1:10, x1=log(1:10), x2=replace(1/(1:10), 2:3, NA)) anova(lm(y ~ x1 + x2, data=d)) Analysis of Variance Table

Re: [Rd] Documentation request Re: [R] recode categorial vars into binary data

2013-05-14 Thread Hervé Pagès
Hi Martin, On 05/14/2013 08:44 AM, Martin Maechler wrote: [...] PS: Are there other suggestions to help people *stop* using ifelse(A, B, C) in those many places where they should use if(A) B else C ? Or to help people stop using if (... ...) if (... | ...)