My R year

End-of-year posts are corny but, what the heck, I think I can let myself delve in to corniness once a year. The following code gives a snapshot of what and how was R for me in 2012.

outside.packages.2012 <- list(used.the.most = c('asreml', 'ggplot2'),
                              largest.use.decline = c('MASS', 'lattice'),
                              same.use = c('MCMCglmm', 'lme4'),
                              would.like.use.more = 'JAGS')
 
skill.level <- list(improved = 'fewer loops (plyr and do.call())',
                    unimproved = c('variable.naming (Still an InConsistent mess)', 
                                   'versioning (still hit and miss)'))
 
interfaces <- list(most.used = c('RStudio', 'plain vanilla R', 'text editor (Textmate and VIM)'),
                   didnt.use.at.all = 'Emacs')
 
languages <- list(for.inquisition = c('R', 'Python', 'Javascript'),
                  revisiting = 'J',
                  discarded = 'Julia (note to self: revisit in a year)')
 
(R.2012 <- list(outside.packages.2012, 
                skill.level, 
                interfaces, 
                languages))
 
# [[1]]
# [[1]]$used.the.most
# [1] "asreml"  "ggplot2"
 
# [[1]]$largest.use.decline
# [1] "MASS"    "lattice"
 
# [[1]]$same.use
# [1] "MCMCglmm" "lme4"    
 
# [[1]]$would.like.use.more
# [1] "JAGS"
 
 
# [[2]]
# [[2]]$improved
# [1] "fewer loops (plyr and do.call())"
 
# [[2]]$unimproved
# [1] "variable.naming (Still an InConsistent mess)"
# [2] "versioning (still hit and miss)"             
 
 
# [[3]]
# [[3]]$most.used
# [1] "RStudio"                        "plain vanilla R"               
# [3] "text editor (Textmate and VIM)"
 
# [[3]]$didnt.use.at.all
# [1] "Emacs"
 
 
# [[4]]
# [[4]]$for.inquisition
# [1] "R"          "Python"     "Javascript"
 
# [[4]]$revisiting
# [1] "J"
 
# [[4]]$discarded
# [1] "Julia (note to self: revisit in a year)"

So one can query this over-the-top structure with code like R.2012[[3]]$didnt.use.at.all to learn [1] "Emacs", but you already new that, didn’t you?

Despite all my complaints, monologuing about other languages and overall frustration, R has served me well. It’s just that I’d be disappointed if I were still using it a lot in ten-years time.

Gratuitous picture: building blocks for research (Photo: Luis, click to enlarge).

Gratuitous picture: building blocks for research (Photo: Luis, click to enlarge).

Of course there was a lot more than R and stats this year. For example, the blogs I read most often have nothing to do with either topic: Isomorphismes (can’t define it), The music of sound (sound design), Offsetting behaviour (economics/politics in NZ). In fact, I need reading about a broad range of topics to feel human.

P.S. Incidentally, my favorite R function this year was subset(); I’ve been subsetting like there is no tomorrow. By the way, you are welcome to browse around the blog and subset whatever you like.

5 thoughts on “My R year

  • 2012/12/25 at 12:32 am
    Permalink

    you really should stop using dots.

    Happy christmas time though ;)

    Reply
    • 2012/12/25 at 8:46 am
      Permalink

      Dots are funky! In S/S+ underscores were a shorthand for assign, so it was not a good idea to use them in names. In fact, ESS mode in Emacs still makes the substitution by default.

      Reply
      • 2012/12/26 at 12:48 am
        Permalink

        I know I had to change that behavior in ESS.

        But you can use camelBack if you don’t like underscores (using subword-mode).

        I’m not inclined to annoy people with their coding schemes except when it comes to dots. If you are used to other programming languages, dots mean object inheritance. And it hurts the eyes to see them for other purposes.

        R has dots in variable and function names due to the historical reason you mention, but now even the core developers tend to not using them when possible.

        Merry christmas to you.

        Reply
  • 2012/12/28 at 9:42 am
    Permalink

    It’s always interesting to see what packages others are using & that’s a fun way to show it. I’m intrigued by your combination of plyr and do.call, both increasing. After years of planning to move to plyr, I finally did. I find myself needing less of do.call as a result. I used it mainly with rbind to convert a list of vectors into a data frame & plyr lets me go straight to the data frame, making that irrelevant. What’s your main use of do.call?

    Reply
    • 2012/12/28 at 12:09 pm
      Permalink

      I’ve mostly been using plyr this year. However, during the last two months I’ve written some functions that (to my eye) are a tad more elegant and reusable with do.call(). In addition, I’m accessing a server where I can’t easily install new packages (it’s for some simulation work) so staying as close as possible to the default R installation is a bonus.

      Reply

Leave a Reply