Next TRUG meetings!

I am very happy to finally (!) pronounce the next two TRUG meetings!

Next meeting, Stéphanie van den Berg will give a presentation on a pipeline for analysing data on twins, using the R library knitr. The pipeline automatically reads in the data, runs the analysis and creates a LateX file with the results of the analysis. The LateX file is then automatically converted into a pdf file.

Depending on how many of you are able to come, the meeting will take place on December 15th (monday) or December 18th (thursday). Please indicate your preference:

We will inform you by e-mail about the exact date and location as soon as there is a clear preference for one of the dates. As usual, the meeting will take place at Stephanie’s little farm in Boekelo (time to be announced).

The meeting after that will take place on February 12th (thursday). Presenter will be Sukaesi Marianti (topic to be announced).

There is of course still a lot of time left to make up your mind, but if you already know that you can (or cannot) attend, please let us know:

The dplyr package

In the June ’14 meeting of the Twente R User group, Martin Schmettow gave a presentation on the R package ‘dplyr’. Code of this package runs fast, can transparently deal with remote data and produces readable code. Furthermore, it interfaces well with the plyr and ggplot package. You can find the slides of the presentation here: Dplyr package.

Next meeting: The dplyr package

At the next meeting, Wednesday 25 2014, Martin Schmettow will give a presentation on the R library dplyr.  The dplyr package provides useful tools for efficiently manipulating datasets in R. For those who are familiar with the package plyr, dplyr is the ‘next iteration’ of plyr. It focuses on data frames and is faster and easier to use than plyr.

We are meeting at Stephanie’s little  farm in Boekelo at 17.30. A group of TRUG members is going by bicycle to Boekelo. In case you want to join us, we are meeting at the entrance of the Cubicus building at 17.00 o’clock.

 

Making plots using ggplot

In the February ’14 meeting of the Twente R User group, research master student Karel Kroeze gave us a quick run-through of the many possibilities with the ggplot family of functions and building blocks. Although a bit intimidating at first, the R code is immensely flexible once you get the hang of it. Have a go at his code (click here to get the code) from the presentation and see if you can accommodate his code for your own cool graphics! For the accompanying data files, mail Stephanie. Guus provided some extra helpful links, see Tim Churches, CEB institute and cookbook R.

Making plots in R

At the next meeting, February 6 2014, Karel Kroeze will give a presentation on plotting. Time: 12:00-13.30, venue will be Ravelijn 3334. 

Object oriented programming in R

In the January ’14 meeting of the Twente R User group, Janina Torbecke & Inga Schwabe gave an introduction into object oriented programming in R. Although object oriented programming may be more straight forward in other programming languages (e.g. Python, Java, C++), it can be useful in R to enable the use of generic functions (e.g. for your own library), to program efficiently (e.g. elimination of redundant code) or just to produce neat code.

The code that was used to explain the idea of object oriented programming is part of a battleship game made in R. You can find the slides of the presentation here: Object oriented programming in R and the R code here: Battleship game in R.

P.S.: I posted this blog post directly from R, using the simple markdown language and the RWordPress library. To do this, I used the following code:

## Install Rwordpress library
if (!require("RWordPress")) install.packages("RWordPress", repos = "http://www.omegahat.org/R", 
    type = "source")

## Load packages & log in on wordpress
library(knitr)
library(RWordPress)
library(XML)

# Upload post to blog
options(WordPressLogin = c(ingaschwabe = "*****"), WordPressURL = "https://twenterug.wordpress.com/xmlrpc.php")
knit2wp("OOP_in_R.Rmd", title = "Object oriented programming in R", publish = TRUE)

If you want to do try this on your own blog, these are helpful links: http://fredhasselman.com/?p=303 and http://yihui.name/knitr/demo/wordpress/.

Interactive R learning

For those who are still learning the basics of the R programming language, the following website might be interesting:

http://www.datamind.org/

Another thing that might be interesting is the recently released R-library Swirl. The swirl R package is designed to simultaneously teach users statistics and the R programming language. In a typical swirl session, the user is required to load a package from the R console and chose from a menu of options the course he would like to take. Then he works through 10-15 minutes interactive modules, each covering a particular topic.

To install it, this is all you have to do in R:

#Install libraries
install.packages(“devtools”)
library(“devtools”)
install_github(repo=”swirl”, username=”ncarchedi”)
library(“swirl”)

#Call swirl()
swirl()

Note however that the package is yet released and constantly fixed and updated. It is therefore recommended to update the version at least one ca month so you have full access to the latest features.

This is the official website of the package: http://swirlstats.com
You can find a blog post on the release of the new package on Simply Statistics:
http://simplystatistics.org/2013/09/27/announcing-statistics-with-interactive-r-learning-software-environment