Tag Archives: udacity

How to get started with R

1 Feb

Rlogo

I often get asked how to get started with learning R if there is not currently a class offered. Here is what I recommend:

1. Start with a free online Code School tutorial

First of all, check out this (free) online course: https://www.codeschool.com/courses/try-r
No need to install anything, no need to pay. Students in my bioinformatics class liked this online Code School course a lot. It will not make you a master of R, but it’s a nice starting point.

2. Install R, Rstudio and swirl on your computer

Next, it is time to install R and Rstudio on your computer. Once you have that, install the swirl package. Instructions for installing R, Rstudio and swirl can be found here: http://swirlstats.com/students.html
swirl is an R package that helps you learn R while you are in the Rstudio environment. I highly recommend using the Rstudio environment! The swirl tutorials teach you the basics of vectors, matrices, logical expressions, base graphics, apply functions and many other topics. Kind words included (“Almost! Try again. Or, type info() for more options.”)

3. Dive in with great Udacity class …

If you are ready to really dive in (and have some time to invest), try out this great Udacity class: https://www.udacity.com/course/data-analysis-with-r–ud651 (no need to pay for it, you can do the free version). This class is taught by people from the Facebook data science team. They do a great job guiding you through a lot of R coding. Importantly, they always take the time to explain why you’d want to do something before they let you do it. A large part of the course is focused on using the ggplot2 package.

… or start reading The R Book

The R Book is a book by biologist and R hero Michael Crawley. The pdf of the book is available from many websites (for example: ftp://ftp.tuebingen.mpg.de/pub/kyb/bresciani/Crawley%20-%20The%20R%20Book.pdf). Make sure you also download the example data that come with the book (http://www.bio.ic.ac.uk/research/mjcraw/therbook/).

The R Book is a great resource and very clearly written. The students in my lab enjoy reading from it and trying out the code. If you are a biologist, it’ll be fun to work with the biology examples in the R book.

4. Find others who are using R or learning R.

Learning R is hard. You will get frustrated sometimes. If you know someone who is learning with you or who could help you when you are stuck, things will be easier! If there is no one near you, try to find R minded people on Twitter or elsewhere online. Also, check out the R forum on Stack Overflow (http://stackoverflow.com/questions/tagged/r) for many questions and answers on R.

Good luck!

 

Being a better programmer: learning Python with Udacity.

16 Oct

When I started my “Being a better scientist” project, after reading Gretchen Rubin’s Happiness project, I decided to start with a one month focus on “Being a better programmer”. I made three resolutions.

1. Learn python by finishing Udacity‘s python course.
2. Look it up, write it down.
3. Annotate, annotate, annotate.

Like many biologists, I am a self-taught programmer. I use C++ and R, but for a long time I have wanted to learn a new language. One that is easier than C++ and faster & more suited to my needs than R. I love using R, so I think the new language will not replace R, but I think it could be useful for some of my projects. Plus, I think that by doing a programming course, I will learn stuff that could be useful for working in any language.

A few months ago I already started a python class at the online university Udacity. Even though I enjoyed the course a lot, I got stuck after 3 units (out of 7). This month, I will finish this course. Today, I just finished unit 4. In the next three weeks I will do units 5, 6 and 7.

What I like about the Udacity CS101 course:
1. The course is entirely web based and is VERY interactive. There are tons of little quizzes and programming exercises.
2. In the programming exercises, you can check the answers by executing the code and running some tests, and then have it checked by Udacity. If my code is almost correct, the response may be something like: “Try again, your code didn’t pass the following test …” – which is very useful and motivates me to, indeed, try again.
3. The lecture parts are short (2-7 minutes) which is good. The lectures are also interesting and teach some computer science theory.
4. It is free. I know I should be willing to pay for a useful course, but honestly, I don’t think I would have started it if it wasn’t for free.

What I don’t like about the Udacity CS101 course:
1. Before I started, I had no idea how long it would take to do the course. It is split in 7 units, but I didn’t know if a unit corresponds to an hour of work, a week of work or a semester of work. Turns out it is about 10 hours for me (rough guess).
2. The course lets you build a web crawler and by doing that, you learn all the python you need for the task. Although I think it is good that they focus on a specific task, I am not interested in web crawlers, and I would prefer to build something related to biology. How about some alignment software?
3. The time it takes to execute code (on the Udacity servers) is somewhat long which is slightly annoying.
4. Very few of the Udacity teachers are women. Maybe that’s why the fun examples are about cars and superheroes.