Maëlle's R blog

Not a fish

Lintr Bot, lintr's Hester egg

Remember my blog post about automatic tools for improving R packages? One of these tools is Jim Hester’s lintr, a package that performs static code analysis. In my experience it mostly helps identifying too long code lines and missing space, although it’s a bit more involved than that. In any case, lintr helps you maintain good code style, and as mentioned in that now old post of mine, you can add a lintr unit test to your package which will ensure you don’t get lazy over time.

Now say your package has a lintr unit test and lives on GitHub. What happens if someone makes a pull request and writes looong code lines? Continuous integration builds will fail but not only that… The contributor will get to know Lintr Bot, lintr’s Hester (Easter) egg!

Storrrify #satRdayCapeTown 2018

One week ago I was in Cape Town for the local satRday conference, where I had the honor to be one of the two keynote speakers, the other one being sports analytics extraordinaire Stephanie Kovalchik (You can read Stephanie Kovalchik’s account of the conference in this blog post). It was a fantastic experience! The event was very well organized, and 100% corresponds to its description as a “one day conference packed with R goodness”. You can watch all talks on Youtube. In my talk, I presented rOpenSci onboarding system of packages and… wore a hard hat!

It’d be a bit hard for me to really write a good recap of satRday that’d do it justice! Instead, I’ll use rtweet and a bit of html hacking to storrrify it (like Storify, but in R) using my live tweets!

hrbrpkgs: list Bob Rudis' packages

Recently I needed to count lines of code for a project at work work (this is an expression of the person honored in this post), and happened to discover that Bob Rudis had started an R package wrapping the Perl CLOC script. Of course! He has packages for a lot of things! And he’s always ready to help: after I asked him a question about the package, and made a pull request to renew its wrapped CLOC script, he made it all pretty and ready-to-go!

He himself defined his Stack Overflow Driven-Development (SODD) workflow in a blog post: someone will ask him a question on Stack Overflow, and he’ll write a long answer eventually becoming a package, that will or will not make it to CRAN… Which is the motivation of this blog post. How can I output a list of all packages Bob has on GitHub?

Combine your hex stickers with magic(k)

Hex stickers remind me of Pogs, except they’re cooler because you can combine them together! Some people do that very smartly.

I’ve got a pretty random hex stickers combination on my laptop, but after all it could be worse…

Now since I’m a magick/collage fan, you can bet I’ve wondered how to use R in order to combine stickers automatically! Say I have a bunch of sticker PNGs, how could I produce a map to design my laptop style? Read to find out more…

Galentine's day cards

Remember the nascent series of blog posts about Parks and recreation? Well, we’re still at one post, but don’t worry, here is a new one, and I’m sure the series will eventually be a real one. I’m looking at you, my R-Ladies friends. That said, today is not a day for passive agressive hints, because I’ve decided it’s Galentine’s day and I’ll show you how to craft cards for your R-Ladies friends from your R prompt!

Rainbowing a set of pictures

I’ve now done a few collages from R using magick: the faces of #rstats Twitter, We R-Ladies with Lucy D’Agostino McGowan, and a holiday card for R-Ladies. The faces of #rstats Twitter and holiday card collages were arranged at random, while the We R-Ladies one was a mosaic forming the R-Ladies logo. I got the idea to up my collage skills by trying to learn how to arrange pics by their main colour, like a rainbow. The verb rainbow doesn’t exist, and “rainbowing” doesn’t mean ordering by colour, but I didn’t let this stop me.

It was the occasion to grab some useful knowledge about colours, not useless for someone who did not even know about Pantone’s Colors of the Year a few weeks ago…

This post has nothing to do with Kesha’s new album. However, you can listen to it while reading since it’s so good, but maybe switch to something older from her when I use “$”.

Cheer up, Black Metal Cats! Bubblegum Puppies

Do you know the Black Metal Cats Twitter account? As explained in this great introduction, it “combines kitties with heavy metal lyrics”. I know the account because I follow Scott Chamberlain who retweets them a lot, which I enjoy as far as one can enjoy such a dark mood. Speaking of which, I decided to try and transform Black Metal Cat tweets into something more positive… The Bubblegum Puppies were born!

Are #python users more likely to get into Slytherin?

This post requires some familiarity with the Harry Potter books but I’m committed to making this blog friendly to everyone, even Muggles/Nomajes.

Have you seen Mark Sellors’ blog post series about writing command line utilities in R? It’s a great one but I was a bit puzzled by his using randomness to assign houses in his sorting hat example (he added a new method based on name digest-ing in the meantime).

This prompted a reply by David Hood who later came up with R code to assign you to a Hogwarts house based on your Twitter activity!

I was thrilled to see David Hood’s sorting hat Github repo and thought it’d be the perfect occasion to answer that fascinating question: are #python users more likely to get into Slytherin than #rstats users?

Another note: I do not care about any Python vs. R fights except for Quidditch games, so go away trolls.