Neglected R Super Functions

April 11, 2018

(This article was originally published at Statistics – Win-Vector Blog, and syndicated at StatsBlogs.)

R has a lot of under-appreciated super powerful functions. I list a few of our favorites below.

6095431665 88664494f0 b

Atlas, carrying the sky. Royal Palace (Paleis op de Dam), Amsterdam.

Photo: Dominik Bartsch, CC some rights reserved.

  • stats::approx(): approximate a curve/function.
  • base::cumsum(): cumulative ordered sum.
  • stats::ecdf(): estimate the cumulative distribution function.
  • base::findInterval(): assign values to bins.
  • base::match(): bulk computation of first match. Can lookup and sort data and even find non-duplicate data.
  • base::Reduce(): nifty functional method to combine multiple function evaluations.
  • base::tapply(): grouped summary function.
  • base::unlist(): build arrays of atomic values from more complicated nested structures.
  • base::Vectorize(): Convert scalar functions into functions ready to operate on arrays.

We would love to hear about some of your favorites.

Please comment on the article here: Statistics – Win-Vector Blog

Tags: , , , , , ,