Le 22 nov. 2014 ? 11:48, S?ren H?jsgaard <sorenh at math.aau.dk> a ?crit :
Dear all,
Came across this:
#include <Rcpp.h>
using namespace Rcpp;
//[[Rcpp::export]]
List sumxy(NumericVector x, NumericVector y){
NumericVector xy = x+y;
NumericVector yx = y+x;
return List::create(xy, yx);
}
/*** R
x <- c(1,3,5,7)
y <- c(NA,2,4,6,8)
x+y
y+x
sumxy(x, y)
*/
x <- c(1,3,5,7)
y <- c(NA,2,4,6,8)
x+y
[[1]]
[1] NA 5 9 13
[[2]]
[1] NA 5 9 13 8
Is this intentional? Apologies if this has been documented anywhere; was unable to find it.
Regards
S?ren