There is grandeur in this view of life

martins bioblogg

Slides and exercise from my second R intro seminar

with 2 comments

This week I held the second introductory seminar on R, and I think it went pretty well — though I guess you really should ask my colleagues if you want to know. The first seminar was a lecture, and this seminar was a tutorial where we made some plots and calculated a few of the usual statistics. Of course the only real way to learn R is to play with it, but I hope this couple of hours provided a decent opening to getting started with R.

I actually think RStudio made it quite a bit easier. One important thing that I certainly should’ve stressed more, though, is organising code into scripts. I mentioned it in the first seminar, but I should have included it into the exercise. Maybe the first section should be something like ”Start a new script file for your analysis: Select File > New > R script to open the editor area. Save the script as unicorn_analysis.R, and for the rest of the tutorial, write your code in that window.”

Files from the seminar:

Slides about common statistical functions in R (again, ugly walls of text meant more as notes for future reference than actual slides)

Exercises for the tutorial and the associated dataset

My suggested solutions to the exercises

About these ads

Written by mrtnj

28 april, 2013 at 15:00

Publicerat i data analysis, english

Tagged with , , ,

2 svar

Subscribe to comments with RSS.

  1. I find also that R Studio makes things a lot easier for learners. I would also like to get people using script files, but maybe the first section is too early. However, maybe after that is too late. What do you think, based on your experience?

    Ken Butler

    28 april, 2013 at 22:10

    • My experience on this is still pretty scant, but I hope to get to more opportunities to teach R and tweak my approach :)

      But I don’t think it’s ever to late. Most people I know who use R interactively already keep a ”cheat sheet” or a ”code file”, and it only takes a little more effort to turn that into a running script. Right now, I think we probably could’ve used a whole session on organising code in a non-scary way. Probably after introducing interactive R. I definitely think it should be mentioned at the outset though, since it’s actually one of the big perks of doing data analysis in a programming language.

      mrtnj

      28 april, 2013 at 22:39


Kommentera

Fyll i dina uppgifter nedan eller klicka på en ikon för att logga in:

WordPress.com Logo

Du kommenterar med ditt WordPress.com-konto. Logga ut / Ändra )

Twitter-bild

Du kommenterar med ditt Twitter-konto. Logga ut / Ändra )

Facebook-foto

Du kommenterar med ditt Facebook-konto. Logga ut / Ändra )

Google+ photo

Du kommenterar med ditt Google+-konto. Logga ut / Ändra )

Ansluter till %s

Följ

Få meddelanden om nya inlägg via e-post.

Gör sällskap med 1 168 andra följare

%d bloggare gillar detta: