Home

The testy toad

The best way to get started with R is to simply play around with some code and get a feeling for some of the cool things you can do with it. The first time I got introduced to R, was through Conway’s game of life. This is simple population model which can create some pretty animations. I’m going to show you how to get one of these animations using R based on some code on the blog Are you cereal? that I’ve altered. This is what it should look like at the end:

conway

Installing R

You can install R here:

http://cran.r-project.org/bin/windows/base/ for windows

http://cran.r-project.org/bin/macosx/ for mac

Once installed, you will need to open R and create a new script and paste the code (at the bottom of page). Here’s how you create a new script:

Gnewscript

Now that you have your script, you can paste the code (below in blue)  in…

Voir l’article original 899 mots de plus

Laisser un commentaire