Category: SAS

How many days until?

A simple little macro I whipped up that’ll count down the number of days until an important event. %macro daysUntil(event, date); data _null_; diff = datdif(today(), input(“&date.”, anydtdte10.), ‘act/act’); call symput(‘days_until’, strip(diff)); run; %put There are &days_until days until &event; %mend; Macro call is straight forward: %daysUntil(Christmas, 12/25/2011); %daysUntil(Columbia_Marathon, 03/10/2012); I could have used various […]

Too many pies can be hard to digest

On his SAS and R blog, Ken K. recently posted an example of a visualization technique called “small multiples”. In this exercise, Ken shows the programming technique for replicating a particular series of pie charts in R as well as in SAS. It’s a useful exercise to learn from, but […]

10 toughest interview questions for R developers (1)

I recently discovered 10 questions most daunting in R development, and I am trying to find the answers below.

1. Data structure — How many data structures R has? How do you build a binary search tree in R?
2. Sorting — How many sorting algorithms…

Those most productive R developers

The number of R packages on CRAN is 3,483 on 2011-12-12. The growth of R package in the past years can be fitted by a quadratic regression perfectly.

I am always interested in who are maintaining those packages. Then I wrote an R script to extract …

Building custom measures for OLAP cubes

In one minute (and 10 seconds, but are you measuring that?) you can add a custom measure (also known as calculated members) to your OLAP cube. Watch this video to create a simple calculation multiplying units * price. Remember that this mechanism is no…

NOTE: Hash Tables, An Introduction

In my recent series of articles on testing I used the hash table to provide a means to write/update a table from within a DATA step without demanding changes to the DATA statement, etc. I’ve had some very kind feedback on the series, plus some reques…

Mmm… Dr. G and the M&Ms

“Do you really serve M&Ms every Wednesday?  Tell us the story!” clamored a wide-eyed class after sampling the M&Ms lighting up the breakout area. Seeing how hard they worked on their exercises, it seemed ok to have a slight diversion from …