Displaying 6 results from an estimated 6 matches for "doublethis".
Did you mean:
doublethink
2015 Mar 02
3
R-devel does not update the C++ returned variables
...t the interface. It has its own learning curve, but I think
| it is easier than using the low-level code that you need to work with .Call.
Thanks for that vote, and I second that.
And these days the learning is a lot flatter than it was a decade ago:
R> Rcpp::cppFunction("NumericVector doubleThis(NumericVector x) { return(2*x); }")
R> doubleThis(c(1,2,3,21,-4))
[1] 2 4 6 42 -8
R>
That defined, compiled, loaded and run/illustrated a simple function.
Dirk
--
http://dirk.eddelbuettel.com | @eddelbuettel | edd at debian.org
2015 Mar 02
1
R-devel does not update the C++ returned variables
...earning curve, but I think
| > | it is easier than using the low-level code that you need to work with .Call.
|
| > Thanks for that vote, and I second that.
|
| > And these days the learning is a lot flatter than it was a decade ago:
|
| > R> Rcpp::cppFunction("NumericVector doubleThis(NumericVector x) { return(2*x); }")
| > R> doubleThis(c(1,2,3,21,-4))
| > [1] 2 4 6 42 -8
| > R>
|
| > That defined, compiled, loaded and run/illustrated a simple function.
|
| > Dirk
|
| Indeed impressive, ... and it also works with integer vectors
| something als...
2015 Mar 02
3
R-devel does not update the C++ returned variables
..., but I think
>> | it is easier than using the low-level code that you need to work with .Call.
>
>> Thanks for that vote, and I second that.
>
>> And these days the learning is a lot flatter than it was a decade ago:
>
>> R> Rcpp::cppFunction("NumericVector doubleThis(NumericVector x) { return(2*x); }")
>> R> doubleThis(c(1,2,3,21,-4))
>> [1] 2 4 6 42 -8
>> R>
>
>> That defined, compiled, loaded and run/illustrated a simple function.
>
>> Dirk
>
> Indeed impressive, ... and it also works with integer vecto...
2015 Mar 02
0
R-devel does not update the C++ returned variables
...has its own learning curve, but I think
> | it is easier than using the low-level code that you need to work with .Call.
> Thanks for that vote, and I second that.
> And these days the learning is a lot flatter than it was a decade ago:
> R> Rcpp::cppFunction("NumericVector doubleThis(NumericVector x) { return(2*x); }")
> R> doubleThis(c(1,2,3,21,-4))
> [1] 2 4 6 42 -8
> R>
> That defined, compiled, loaded and run/illustrated a simple function.
> Dirk
Indeed impressive, ... and it also works with integer vectors
something also not 100% trivial w...
2015 Mar 02
0
R-devel does not update the C++ returned variables
...than using the low-level code that you need to work
>>> with .Call.
>>
>>> Thanks for that vote, and I second that.
>>
>>> And these days the learning is a lot flatter than it was a decade ago:
>>
>>> R> Rcpp::cppFunction("NumericVector doubleThis(NumericVector x) {
>>> return(2*x); }")
>>> R> doubleThis(c(1,2,3,21,-4))
>>> [1] 2 4 6 42 -8
>>> R>
>>
>>> That defined, compiled, loaded and run/illustrated a simple function.
>>
>>> Dirk
>>
>> Indeed impr...
2015 Mar 02
2
R-devel does not update the C++ returned variables
Thanks! I went through the online posts which supports the power of .Call
over .C. But my probably naive question is why does this work for my code
with R but not R-devel?
And another question is related to using .Call. Based on the manual page, I
do not need to change the function parameters when using .Call. So I can
run like this:
.Call("sppedUp", D, S, pD, pS, nrow(D), as.integer(N),