This is one of the fastest papers I ever wrote. It was a great collaboration with Tomás Lejarraga from the Universitat de les Illes Balears. Why was it great? Because it is one of the rare cases (at least in my academic life) where all people involved in a project contribute equally and quickly. Often, the weight of a contribution lies with one person which slows down things – with Tomás this was different – we were often sitting in front of a computer writing together (have never done this before, thought it would not work). Surprisingly this collaborative writing worked out very well and we had the skeleton of the paper within an afternoon. This was followed by many hours of tuning and tacking turns – but in principle we wrote the most important parts together – which was pretty cool.
Even cooler – you can do eye-tracking in groups, using our code.
Here is the [PDF] and abstract:
The recent introduction of inexpensive eye-trackers has opened up a wealth of opportunities for researchers to study attention in interactive tasks. No software package was previously available to help researchers exploit those opportunities. We created “the pyeTribe”, a software package that offers, among others, the following features: First, a communication platform between many eye-trackers to allow simultaneous recording of multiple participants. Second, the simultaneous calibration of multiple eye-trackers without the experimenter’s supervision. Third, data collection restricted to periods of interest, thus reducing the volume of data and easing analysis. We used a standard economic game (the public goods game) to examine data quality and demonstrate the potential of our software package. Moreover, we conducted a modeling analysis, which illustrates how combining process and behavioral data can improve models of human decision making behavior in social situations. Our software is open source and can thus be used and improved by others.
Before there was R, there was S. R was modeled on a language developed at AT&T Bell Labs starting in 1976 by Rick Becker and John Chambers (and, later, Alan Wilks) along with Doug Dunn, Jean McRae, and Judy Schilling.
Here is a talk by Rick Becker telling the story of R. Good Stuff!
I gave the R package exams a shot for my decision making lecture. Here is what it does:
“Automatic generation of exams based on exercises in Sweave (R/LaTeX) or R/Markdown format, including multiple-choice questions and arithmetic problems. Exams can be produced in various formats, including PDF, HTML, Moodle XML, QTI 1.2 (for OLAT/OpenOLAT), QTI 2.1, ARSnova, and TCExam. In addition to fully customizable PDF exams, a standardized PDF format is provided that can be printed, scanned, and automatically evaluated.”
After some fiddling and help from one of the authors (the incredible nice Achim Zeileis, Uni Innsbruck) I got the following setup going:
- pool of ~ 100 questions in .Rmd format (all multiple choice, 3-6 answer options) grouped into lectures
- sampling out of the pool (e.g., 5 questions out of each lecture)
- random order of questions in each version of the exam (while keeping the lecture order, which I think is useful to give student more structure to work from)
- random order of the answers for each question
- exam with the correct answers
There are three parts:
- questions defining the answers to a question
- solutions defining the correct answers
- in LaTeX the actual question
All of this information goes into an .Rmd file.
Once this is done one has to define the questions to be included (the pool) and set the details for the selection process:
sol <- exams2pdf(myexam,
n = 2,
nsamp = 5,
dir = odir,
template = c("my_exam", "solution"),
encoding = 'UTF-8',
header = list(Date = "10.06.2016")
This code would give me 2 exams with a sample of 5 questions out of each block of questions.
Pretty awesome (after some setup work).
Thanks Achim et al. !!
The friendly people from RStudio recently started a webinar series with talks on the following topics (among others):
Data wrangling with R and RStudio
The Grammar and Graphics of Data Science (both dplyr happiness)
RStudio and Shiny
… and many more.
Our friend Dr. Nathaniel D. Philipps also started a cool R course with videos, shiny apps and many other new goodies.
dplyr is the new plyr – and it is awesome!
fast, consistent and easy to read … check out a set of instructional pages, presentation and videos here
Thanks Hadley Wickham
Here is an excellent stackoverflow post on how *apply in all its variations can be used.
One of the followups points at plyr (from demi-R-god Hadley Wickham) which provides a consistent naming convention for all the *apply variations. I like plyr a lot, because like ggplot, it is easy to grasp and relatively intuitive to find an answer to even tricky problems.
Here is the translation from *apply to plyr …
Base function Input Output plyr function
aggregate d d ddply + colwise
apply a a/l aaply / alply
by d l dlply
lapply l l llply
mapply a a/l maply / mlply
replicate r a/l raply / rlply
sapply l a laply
This is mainly a note to self:
There are several style guides for R out there. I particularly like the one from Google and the somewhat lighter version of Hadley (ggplot god).
All of that style guide thinking started after a question on stackoverflow.com about R workflow … How do we organize large R projects. Hadley (again) is favoring an Load-Clean-Func-Do approach which looks somewhat like that:
- load.R # load data
- clean.R # clean up crap
- func.R # add functions
- do.R # do the work
I kind of started doing something along these lines, with splitting files into load/clean (still together, could go separate …), cleaning, graphing (which does not make a lot of sense in an extra file) and large junks of analysis … got to redo some directories now …
Other cool links from today’s follow-this-link trip: http://www.getskeleton.com/ and http://subtlepatterns.com/
I had a discussion the other day on the re-appearing topic why one should learn R …
I took the list below from the R-Bloggers which argues why grad students should learn R:
- R is free, and lets grad students escape the burdens of commercial license costs.
- R has really good online documentation; and the community is unparalleled.
- The command-line interface is perfect for learning by doing.
- R is on the cutting edge, and expanding rapidly.
- The R programming language is intuitive.
- R creates stunning visuals.
- R and LaTeX work together — seamlessly.
- R is used by practitioners in a plethora of academic disciplines.
- R makes you think.
- There’s always more than one way to accomplish something.
This is a great list – I would add that from the perspective of an university it makes sense to save a lot of money in not having to buy licenses. And reproducability is great with R because the code is always written in a text-file and not bound by software versions (as in other three or four letter (feel free to combine from: [A, P, S]) packages).
http://cran.r-project.org/web/packages/googleVis/ enables chart generation similar to the ones instroduced by Hans Roesling in his TED talk on poverty – extremly cool 🙂
The new version 2.13.0 of R has just been released and with the update comes the pain of re-installing all the packages from the old installation on the new one.
Stackoverflow to the rescue! This posting provides a simple two step process of first writing a list of packages into a file on the disk in the old version, installing the new version and then comparing the exported list to the currently installed packages in the new version with setdiff. I just went through the process and have to say that it is deadeasy! Below the code …
#--run in the old version of R
packages <- installed.packages()[,"Package"]
INSTALL NEW R VERSION
#--run in the new version
for (p in setdiff(packages, installed.packages()[,"Package"]))