From a (set.)seed grows a mighty dataset

Can you predict the output from this code? [code language="r"] printStr <- function(str) paste(str, collapse="") set.seed(12173423); x <- sample(LETTERS, 5, replace=TRUE) set.seed(7723132); y <- sample(LETTERS, 5, replace=TRUE) paste(printStr(x), printStr(y)) [/code] Okay, the first bit is straightforward; it’s a function that puts two string together into one. The next two lines appear to provide a random integer to the set.seed function then sample the pool of LETTERS 5 times with replacement. [Read More]
rstats 

Solving Inequality (the math kind)

This neat approach showed up recently as an answer to a FiveThirtyEight puzzle and of course I couldn’t help but throw it at dplyr as soon as I could. Turns out that’s not a terrible idea. The question posed is optimise 200a + 100b + 50c + 25d under the constraints 400a + 400b + 150c + 50d ≤ 1000, b ≤ a, a ≤ 1, c ≤ 8, d ≤ 4, and (a,b,c,d) all non-negative integers. [Read More]
rstats 

#auunconf slack users' timezone locations

I had never used slack before, but had read a heap of tech articles extolling its virtues. Apparently this is what our current Prime Minister advocates within Cabinet. The upcoming #auunconf organising team set up a channel and invited the participants, so I checked it out. Slack is pretty awesome as far as a unified workspace/messaging protocol can go. What makes it even more awesome, is that someone (@hrbrmstr, no surprise) has made an R package that talks to it.

[Read More]
rstats 

52vis Week 2 Challenge -- Australian Version

I mapped out the USA homelessness rate in my last post as a challenge and noted at the end that it would be interesting to do the same for Australia. That was the first comment I received in person, too. “Let’s do it!” I said. What I found may shock you (click-bait title; check).

[Read More]
rstats 

52vis Week 2 Challenge

From Bob Rudis’ blog comes a weekly data/coding challenge. I didn’t quite get the time to tackle last week’s but I thought this one offered up a pretty good opportunity.

[Read More]
rstats 

Bring on the ROpenSci #auunconf 2016!

I’ll be heading to the 2016 ROpenSci un-conference (hackathon) in Brisbane later this month to smash out a heap of open-science R code. Ideas are already flowing quite nicely, and I’m confident that any ideas we don’t end up officially working on will get their chance in the very near future.

[Read More]
rstats