On 29 July 2015 at 14:21, Nathan Kurz wrote:
| > On 29 July 2015 at 15:12, Dirk Eddelbuettel wrote:
| > All this is becoming a wee bit obscure. The focus of the list is to help
| > people use Rcpp, not to navigate constraints built into the R system.
|
|
| Yes, but for many users (well, at leas
> On 29 July 2015 at 15:12, Dirk Eddelbuettel wrote:
> All this is becoming a wee bit obscure. The focus of the list is to help
> people use Rcpp, not to navigate constraints built into the R system.
Yes, but for many users (well, at least RGuy and me) the impetus for
using Rcpp is to to improve
On 29 July 2015 at 15:12, Dirk Eddelbuettel wrote:
| All this is becoming a wee bit obscure. The focus of the list is to help
| people use R, not to navigate constraints built into the R system.
Sorry: "... is to help people use Rcpp, not to ..."
Dirk
--
http://dirk.eddelbuettel.com | @eddel
On 29 July 2015 at 13:05, Nathan Kurz wrote:
| I tried memory profiling both of your versions with a long vector, and
| found that the recommended Rcpp approach made an additional 8GB copy.
| Is there a way to avoid this extra copy without resorting to in place
| modification?
Look at Rcpp::XPtr
On Wed, Jul 29, 2015 at 10:37 AM, Dirk Eddelbuettel wrote:
> You misunderstand. We communicate by SEXP. Where the P stands for pointer.
> IE even with
>
> R> M <- as.data.frame(matrix(rnorm(1e6, 1e3)))
> R> object.size(M)
> 8000672 bytes
> R>
>
> we'd still only pass the same 56 bytes a
The data.table package might also be worth looking into.
Best,
--
Hao Ye
h...@ucsd.edu
> On Jul 29, 2015, at 10:37 AM, Dirk Eddelbuettel wrote:
>
>
> On 29 July 2015 at 17:28, Rguy wrote:
> | The reason I am interested in using call by reference is that I am accessing
> | data frames with over
On 29 July 2015 at 17:28, Rguy wrote:
| The reason I am interested in using call by reference is that I am accessing
| data frames with over a million rows and hundreds of columns. It is more
| efficient to operate on such a data frame directly, as opposed to copying it
| into and out of a functio
The reason I am interested in using call by reference is that I am
accessing data frames with over a million rows and hundreds of columns. It
is more efficient to operate on such a data frame directly, as opposed to
copying it into and out of a function. In other words, I want to be *not*
like R, w
On 29 July 2015 at 07:29, Rguy wrote:
| Thanks for the insight. For other readers possibly struggling with call by
| reference, the following code works as expected, i.e., x is changed to c(1,
2).
Nobody is struggling, but your example is still "unusual" (to avoid the
loaded term "wrong") as we
mericVector is
> expected; hence a copying takes place.
>
> Regards
> Søren
>
>
>
>
> |-Original Message-
> |From: rcpp-devel-boun...@lists.r-forge.r-project.org [mailto:rcpp-devel-
> |boun...@lists.r-forge.r-project.org] On Behalf Of Dirk Eddelbuettel
> |
t: 28. juli 2015 20:46
|To: Rguy
|Cc: rcpp-devel@lists.r-forge.r-project.org
|Subject: Re: [Rcpp-devel] Call by reference
|
|
|On 28 July 2015 at 17:53, Rguy wrote:
|| I attempted to implement the call by reference example on page 200 of
|| Seamless R and C++, as follows:
||
|| #include
|| usi
On 28 July 2015 at 17:53, Rguy wrote:
| I attempted to implement the call by reference example on page 200 of Seamless
| R and C++, as follows:
|
| #include
| using namespace Rcpp;
|
| // [[Rcpp::export]]
| void absC(double & x) {
| if (x < 0) x = -x;
| }
|
| /*** R
| x = -1
| absC(x)
| x
| */
I attempted to implement the call by reference example on page 200 of
Seamless R and C++, as follows:
#include
using namespace Rcpp;
// [[Rcpp::export]]
void absC(double & x) {
if (x < 0) x = -x;
}
/*** R
x = -1
absC(x)
x
*/
Unfortunately, x remains equal to -1.
Platforms: Windows 7, "R versi
13 matches
Mail list logo