R tutorial 2: extracting subsets of data