Articles by romain francois

Vectorized vs Devectorized

May 24, 2014 | romain francois

This gist from @hadley has been on my mind for some time. This was already a follow up of this post from @johnmyleswhite. The problem was that sugar vectorised code suffered a performance penalty compared to devectorised code. This is particularly troubling me because the whole point of sugar is ... [Read more...]

Reduce in Rcpp11

May 23, 2014 | romain francois

And now for something completely difference, the reduce function, doing something similar to what the Reduce function does in R: #include using namespace Rcpp ; // [[Rcpp::export]] double reduce_example(NumericVector x ){ auto ad... [Read more...]

A taste of functional programmming in Rcpp11

May 23, 2014 | romain francois

@kevinushey requested some functional programming in Rcpp11 and provided initial versions of map and filter. map is actually doing exactly the same thing as mapply so I added map as a synonym to mapply so that we can do (see this previous post for details):
// [[Rcpp::export]]
NumericVector mapply_example(NumericVector x, NumericVector y, double z){

    auto fun = [](double a, double b, double c){ return a + b + c ;} ;
    return map( fun, x, y, z ) ;

}
filter takes a sugar ... [Read more...]

Using mapply in Rcpp11

May 22, 2014 | romain francois

mapply is a well known (or perhaps not) function in R. mapply applies a function to extracts from one or more vectors. For example in R: __ mapply( function(x,y, z) x + y + z, 1:4, 4:1, 2) # [1] 7 7 7 7 Notice how the last argument is recycled as... [Read more...]

Compile times Rcpp11 vs Rcpp

May 22, 2014 | romain francois

So I've been curious about a different kind of performance comparison between Rcpp11 and Rcpp, i.e. I've benchmarked the time it takes to compile the following code (the example you get from RStudio when you do new C++ file) with Rcpp and Rcpp11. #... [Read more...]

Extending wrap with Rcpp11

May 22, 2014 | romain francois

Context Extending wrap to custom classes has always been a struggle in Rcpp, and led to the split between RcppCommon.h and Rcpp.h, the idea being that you load a "minimal" subset of Rcpp, declare your class, declare that you are going to provide a s... [Read more...]

Moving

March 24, 2013 | romain francois

This blog is moving to blog.r-enthusiasts.com. The new one is powered by wordpress and gets a subdomain of r-enthusiasts.com. See you there [Read more...]

Improving the graph gallery

February 18, 2013 | romain francois

I'm trying to make improvements to the R Graph Gallery, I'm looking for suggestions from users of the website. I've started a question on the website's facebook page. Please take a few seconds to vote to existing improvements possibilities... [Read more...]

OOP with Rcpp modules

November 5, 2012 | romain francois

The purpose of Rcpp modules has always been to make it easy to expose C++ functions and classes to R. Up to now, Rcpp modules did not have a way to declare inheritance between C++ classes. This is now fixed in the development version, and t... [Read more...]

Rcpp modules more flexible

October 25, 2012 | romain francois

Rcpp modules just got more flexible (as of revision 3838 of Rcpp, to become 0.9.16 in the future). modules have allowed exposing C++ classes for some time now, but developpers had to declare custom wrap and as specializations if they wanted their classes to be used as return type or argument type ... [Read more...]

Crawling facebook with R

January 15, 2012 | romain francois

So, let's crawl some data out of facebook using R. Don't get too excited though, this is just a weekend whatif project. Anyway, so for example, I want to download some photos where I'm tagged. First, we need an access token from facebook. I don't know how to get this ... [Read more...]

int64: 64 bit integer vectors for R

November 26, 2011 | romain francois

The Google Open Source Programs Office sponsored me to create the new int64 package that has been released to CRAN a few days ago. The package has been mentionned in an article in the open source blog from Google. The package defines classes i... [Read more...]

Code optimization, an Rcpp solution

November 10, 2011 | romain francois

Tony Breyal woke up an old code optimization problem in this blog post, so I figured it was time for an Rcpp based solution This solutions moves down Henrik Bengtsson's idea (which was at the basis of attempt 10) down to C++. The idea was to call sprintf less than the ... [Read more...]

Rcpp reverse dependency graph

October 30, 2011 | romain francois

I played around with reverse dependencies of Rcpp. At the moment, 44 packages depend on Rcpp and the number goes up to 53 when counting recusive reverse dependencies. I've used graphviz for the representation of the directed graph Here is the c... [Read more...]

R Bloggers widget in R Graph Gallery

October 11, 2011 | romain francois

Following last post about partnership with R Bloggers, Tal and I have added a small widget to the gallery main page to present links to recent posts on R Bloggers It uses the wordpress api to grab information about the rss feed generated by R Bl... [Read more...]

R Graph Gallery widget in R Bloggers

October 8, 2011 | romain francois

The R Bloggers website, maintained by Tal Galili, aggregates blogs (including mine) from many people of the R community. Tal and I have been wondering about how to tight R Bloggers with the gallery, supporting each other's website. To that extent... [Read more...]

Facebook page about the Graph Gallery

September 22, 2011 | romain francois

I've just created a facebook page about the R Graph Gallery I hope this will improve the experience of the website by making it more social, for example, I anticipate that people will share their own graphs by sending a picture on the facebook ... [Read more...]
1 2 3 4 6

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)