Posted on Categories Administrativia, Coding, ProgrammingTags , 1 Comment on wrapr 1.5.0 available on CRAN

wrapr 1.5.0 available on CRAN

The R package wrapr 1.5.0 is now available on CRAN.

wrapr includes a lot of tools for writing better R code:

I’ll be writing articles on a number of the new capabilities. For now I just leave you with the nifty operator coalesce notation.

Continue reading wrapr 1.5.0 available on CRAN

Posted on Categories Programming, TutorialsTags , , Leave a comment on R Tip: use isTRUE()

R Tip: use isTRUE()

R Tip: use isTRUE().

A lot of R functions are type unstable, which means they return different types or classes depending on details of their values.

For example consider all.equal(), it returns the logical value TRUE when the items being compared are equal:

all.equal(1:3, c(1, 2, 3))
# [1] TRUE

However, when the items being compared are not equal all.equal() instead returns a message:

all.equal(1:3, c(1, 2.5, 3))
# [1] "Mean relative difference: 0.25"

This can be inconvenient in using functions similar to all.equal() as tests in if()-statements and other program control structures.

The saving functions is isTRUE(). isTRUE() returns TRUE if its argument value is equivalent to TRUE, and returns FALSE otherwise. isTRUE() makes R programming much easier.

Continue reading R Tip: use isTRUE()

Posted on Categories data science, Opinion, Programming, Statistics, TutorialsTags , , 2 Comments on WVPlots now at version 1.0.0 on CRAN!

WVPlots now at version 1.0.0 on CRAN!

Nina Zumel and I have been working on packaging our favorite graphing techniques in a more reusable way that emphasizes the analysis task at hand over the steps needed to produce a good visualization. We are excited to announce the WVPlots is now at version 1.0.0 on CRAN!

Continue reading WVPlots now at version 1.0.0 on CRAN!

Posted on Categories Opinion, Programming, TutorialsTags , , , Leave a comment on wrapr 1.4.1 now up on CRAN

wrapr 1.4.1 now up on CRAN

wrapr 1.4.1 is now available on CRAN. wrapr is a really neat R package both organizing, meta-programming, and debugging R code. This update generalizes the dot-pipe feature’s dot S3 features.

Please give it a try!

Continue reading wrapr 1.4.1 now up on CRAN

Posted on Categories Administrativia, Opinion, Programming, StatisticsTags , , , , , 2 Comments on rquery: SQL from R

rquery: SQL from R

My BARUG rquery talk went very well, thank you very much to the attendees for being an attentive and generous audience.


IMG 5152

(John teaching rquery at BARUG, photo credit: Timothy Liu)

I am now looking for invitations to give a streamlined version of this talk privately to groups using R who want to work with SQL (with databases such as PostgreSQL or big data systems such as Apache Spark). rquery has a number of features that greatly improve team productivity in this environment (strong separation of concerns, strong error checking, high usability, specific debugging features, and high performance queries).

If your group is in the San Francisco Bay Area and using R to work with a SQL accessible data source, please reach out to me at jmount@win-vector.com, I would be honored to show your team how to speed up their project and lower development costs with rquery. If you are a big data vendor and some of your clients use R, I am especially interested in getting in touch: our system can help R users start working with your installation.

Posted on Categories Coding, Opinion, Programming, Statistics, TutorialsTags , , , Leave a comment on R Tip: Use Slices

R Tip: Use Slices

R tip: use slices.

SliceOMatic

R has a very powerful array slicing ability that allows for some very slick data processing.

Continue reading R Tip: Use Slices

Posted on Categories Opinion, Programming, StatisticsTags , , , 14 Comments on Neglected R Super Functions

Neglected R Super Functions

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.

Continue reading Neglected R Super Functions

Posted on Categories Coding, Programming, TutorialsTags , , , 8 Comments on R Tip: Use drop = FALSE with data.frames

R Tip: Use drop = FALSE with data.frames

Another R tip. Get in the habit of using drop = FALSE when indexing (using [ , ] on) data.frames.

NewImage

Prince Rupert’s drops (img: Wikimedia Commons)

Continue reading R Tip: Use drop = FALSE with data.frames

Posted on Categories Coding, data science, Exciting Techniques, Programming, Statistics, TutorialsTags , , ,

Wanted: cdata Test Pilots

I need a few volunteers to please “test pilot” the development version of the R package cdata, please.

Jackie Cochran at 1938 Bendix Race
Jacqueline Cochran: at the time of her death, no other pilot held more speed, distance, or altitude records in aviation history than Cochran.

Continue reading Wanted: cdata Test Pilots

Posted on Categories Coding, Opinion, Programming, Statistics, TutorialsTags , , , , , , 6 Comments on Is R base::subset() really that bad?

Is R base::subset() really that bad?

Is R base::subset() really that bad?

The Hitchhiker s Guide to the Galaxy svg

Continue reading Is R base::subset() really that bad?