07/03/2020

Overview: Goals & exercises

  • Learn the basics of the R programming language

📝 1. Create new R project

📝 2-3. Create & edit helper.R

  • Learn the basics of Markdown writing

  • Learn how to combine R code and markdown text to create RMarkdown documents

📝 4-6. Create, edit, and compile .Rmd file

Don’t worry

Recap: Console and script panes in RStudio


  • Console: Run code, see print outs, see warnings, messages, and errors


  • Source: Run code from a script. Multiple scripts can be open at once.

What is “Markdown?”

What is R Markdown?

https://rmarkdown.rstudio.com/
  • Integrate R code directly into your writing using basic Markdown syntax
  • Reference management integration
  • Reproducibility
  • Accessible learning curve


✏️ Very useful for writing summary reports, articles, etc.

R Markdown

We’re going to make this today!

Intro to

R Packages & Libraries

Packages are bundles of code written to do (typically) specific sets of functions

  • Some packages are automatically downloaded and loaded into your workspace when you install R (base, utils, etc…) or R Studio (rmarkdown)
  • Others you have to explicitly download
  • Many packages are hosted on CRAN - this is the official “home” of peer-approved packages
    • These can be installed using the function install.packages().
install.packages("tidyverse")

R Packages & Libraries

Non-CRAN packages

  • Other packages are not hosted on CRAN - many of these are excellent, but some may be less reliable.
    • Many of these are hosted on GitHub.com
    • These usually have to be installed using a function install_github() which is part of the remotes package.
# install.packages("remotes")
# This installs the "emo" package for easy emoji use
remotes::install_github("hadley/emo")

Libraries

  • “Library”: where your R packages live after install (automatic location)
  • “Load packages” with library() function to use a package.
# load the tidyverse package
# expect a bunch of output messages (this is normal)
library(tidyverse) 
## ── Attaching packages ──────────────────────────────────────────────── tidyverse 1.2.1 ──
## ✓ ggplot2 3.2.1     ✓ purrr   0.3.3
## ✓ tibble  2.1.3     ✓ dplyr   0.8.3
## ✓ tidyr   0.8.3     ✓ stringr 1.4.0
## ✓ readr   1.3.1     ✓ forcats 0.4.0
## ── Conflicts ─────────────────────────────────────────────────── tidyverse_conflicts() ──
## x dplyr::filter() masks stats::filter()
## x dplyr::lag()    masks stats::lag()

What can you do with R code?

Use it like a calculator

3 + 2
## [1] 5
10^4
## [1] 10000
4*100
## [1] 400

What can you do with R code?

Print information to the console

print("Hello!")
## [1] "Hello!"
print(3*5)
## [1] 15

What can you do with R code?

Create new objects

Read the following as “x is equal to 5”

x <- 5

And we can now type x in the console to see its value

x
## [1] 5

x is now a variable that is set to the value of the number 5.

Variables

Variable: a symbol that stores/represents some other value or set of values.

Think of variables as containers.

Variable assignment

Variables get assigned their value in R with a left arrow <-

Numeric variables represent numbers

x <- 5

This means the value of the variable we have named x is equal to 5.

String variables represent “strings” of text. Text has to be enclosed in quotes ""

my_var <- "hello"

This means the value of the variable my_var is equal to the text “hello”.

Variable assignment

Variables don’t just hold numbers and text - they can hold sets of numbers/text, lists of various kinds of information, and whole data sets!

When you create a new variable in R, you will see it in your Environment pane.

What do I name my variables?

Best practices in naming your variables

In R, it’s pretty flexible. Not as flexible in other languages (*cough* Praat *cough*)

Some suggestions

Try your best to…

  • Be descriptive
  • Be consistent in your content
  • Be consistent in your case (camel/snake/etc)

i_like_snake_case but some people likeCamelCase and others may like-kabob-case,

Variable names: Choose your case

Variable names: Not okay

General rules:

Not allowed Why
1abc Starts with a number
intelligibility% Contains a special character like !@#$%^&*, etc.
.1my_var Starts with a period followed by a number (.1
_my_var Starts with an underscore (_)
special characters Some words have special meaning to R and you shouldn’t overwrite them (e.g., “mean”)

Variable names: Better

Allowed Good because Bad because
x short, lowercase Not meaningful
intelligibility_scores meaningful, easy to remember Takes a long time to type
int_mean meaningful, short 🤷
int_mean_pd, int_mean_hc meaningful, shortish, descriptive A bit long

Beware of typos!

my_var <- 5

My_var
## Error in eval(expr, envir, enclos): object 'My_var' not found
myVar
## Error in eval(expr, envir, enclos): object 'myVar' not found
my_var
## [1] 5

Getting started: R Projects

R Projects make project management really simple. For every new project you embark on, creating a new .RProj file. Open that .RProj file whenver you’re ready to work on that project, and it will:

  • Provide easy access to the directory
  • Restore your last RStudio session from that project
  • Provide access to your R history from your last session


📝 Exercise 1

  1. Create a new R Project for this group
  2. Create a new R script: helper.R
  3. Include the following lines:
# Load libraries ----
# install.packages("tidyverse")
library(tidyverse)

x <- 5
y <- x*10
my_var <- "hello"

y
## [1] 50

📝 Exercise 2

Try running some code…

  • From the script (Cmd or Ctrl + Enter to run the line your cursor’s on)
  • From the console (type code + hit enter)

Create some new variables

  • Run them in the script
  • Call them in the console

Types of objects in R

  1. Numeric
1, 198758, 10^6, pi, abs(-6)
  1. Strings: collection of characters, e.g…
"abc", "the rainbow is a division of white light", "12345", "$%^&"
  1. Factors: categorical variables. Make up a finite set.
"Blue" "Green" "Red"
  1. Logicals: special kind of factor that only has two values
TRUE vs FALSE, 0 vs 1

Types of data structures

Good explanation here

  1. Vectors: collection of similar elements (numbers, characters, factors, etc..). 1 dimensional
# This vector contains 3 numeric components
c(1, 100, 1000)
  1. Matrices: 2D arrangement of vectors
  2. Lists: Can hold lots of different element types
  3. Arrays: Vectors with 1 or more dimensions
  4. Data frames: collections of vectors

We will mostly use data frames. More on those in a minute…

Comments

  • In R scripts, any line of code preceded by a hashmark (#) is not evaluated (i.e., it’s ignored)
  • You can write notes to your future self this way
  • To comment out a block of code, select it and type Cmd (or Ctrl) + Shift + C
# This line is a comment to myself.
# Set x equal to 0
x <- 0
# Now add 1 to the value of x
y <- x+1

Functions

Functions: A certain named format of code that outlines a procedure. Often this allows several lines of code to be executed with a single line of code (by using the name of the function)

  • In other words, functions are actions.
  • Most functions take arguments
    • What do you want to act on?

Calling functions

function_name(argument1, argument2, …)

  • In R Studio, if you start typing the name of a function and hit tab, you will get a pop up with possible options.
  • Within the () of the function, pressing tab will help you add the arguments.

Looking at data: A spreadsheet perspective

Most of us are used to looking at data in the form of a spreadsheet.

  • Named columns with many rows
  • Each row usually represents one observation

See simulated_vot_data.csv

Looking at data: A spreadsheet perspective

My usual workflow:

  • Collect data in spreadsheet.
  • Load spreadsheet data into R as a data frame.
  • Do all other data manipulation and analyses in R.
  • Never touch the raw data again.

Looking at data

Looking at data

To access individual columns, use the $ operator

my_data$Participant

To peak at the first 6 rows of the data, use the head() function

head(my_data)
##        VOT Participant  Item Condition
## 1 43.37020       subj1 item1      Slow
## 2 39.11875       subj1 item2      Fast
## 3 34.18235       subj1 item3      Slow
## 4 30.46931       subj1 item4      Fast
## 5 19.98014       subj1 item5      Slow
## 6 37.17107       subj1 item6      Fast

Looking at data

We can also look at subsets of data

subset(my_data, Condition=="Fast")
##              VOT Participant   Item Condition
## 2     39.1187515       subj1  item2      Fast
## 4     30.4693097       subj1  item4      Fast
## 6     37.1710733       subj1  item6      Fast
## 8     46.9807138       subj1  item8      Fast
## 10    28.4736995       subj1 item10      Fast
## 12    38.3584361       subj1 item12      Fast
## 14    26.1054615       subj1 item14      Fast
## 16    31.6125367       subj1 item16      Fast
## 18    47.1704913       subj1 item18      Fast
## 20    41.2946820       subj1 item20      Fast
## 22    31.3528478       subj1 item22      Fast
## 24    34.6233935       subj1 item24      Fast
## 26    26.7056101       subj1 item26      Fast
## 28    38.3367957       subj1 item28      Fast
## 30    21.5010941       subj1 item30      Fast
## 32    17.7997123       subj1 item32      Fast
## 34    48.2864751       subj1 item34      Fast
## 36    36.3928832       subj1 item36      Fast
## 38    56.9276016       subj1 item38      Fast
## 40    28.0012031       subj1 item40      Fast
## 42    33.4142650       subj1 item42      Fast
## 44    38.0697383       subj1 item44      Fast
## 46    50.9564954       subj1 item46      Fast
## 48    32.5518577       subj1 item48      Fast
## 49    29.3206529       subj2  item1      Fast
## 51    21.2841500       subj2  item3      Fast
## 53    29.4179335       subj2  item5      Fast
## 55    30.4957624       subj2  item7      Fast
## 57    22.1002693       subj2  item9      Fast
## 59    29.0818474       subj2 item11      Fast
## 61    17.8279327       subj2 item13      Fast
## 63    15.9009109       subj2 item15      Fast
## 65    35.2713052       subj2 item17      Fast
## 67    28.0021078       subj2 item19      Fast
## 69    32.2871064       subj2 item21      Fast
## 71    28.7219209       subj2 item23      Fast
## 73    37.0326394       subj2 item25      Fast
## 75    15.2235918       subj2 item27      Fast
## 77    -2.3416104       subj2 item29      Fast
## 79    36.6257309       subj2 item31      Fast
## 81    26.8459323       subj2 item33      Fast
## 83    20.7730262       subj2 item35      Fast
## 85    28.4177777       subj2 item37      Fast
## 87    16.8227361       subj2 item39      Fast
## 89    21.9097718       subj2 item41      Fast
## 91    19.0755636       subj2 item43      Fast
## 93    24.5248267       subj2 item45      Fast
## 95    32.9489179       subj2 item47      Fast
## 98    31.5722678       subj3  item2      Fast
## 100   20.0571571       subj3  item4      Fast
## 102   43.3411045       subj3  item6      Fast
## 104   29.7857064       subj3  item8      Fast
## 106   38.7722135       subj3 item10      Fast
## 108   14.4175027       subj3 item12      Fast
## 110   11.9849753       subj3 item14      Fast
## 112   38.6867930       subj3 item16      Fast
## 114   23.9410291       subj3 item18      Fast
## 116   16.5341639       subj3 item20      Fast
## 118   39.6985758       subj3 item22      Fast
## 120   24.5894456       subj3 item24      Fast
## 122   34.6139823       subj3 item26      Fast
## 124   36.8627060       subj3 item28      Fast
## 126   23.3114582       subj3 item30      Fast
## 128   32.2984381       subj3 item32      Fast
## 130   46.2213241       subj3 item34      Fast
## 132   43.6100379       subj3 item36      Fast
## 134   36.3475811       subj3 item38      Fast
## 136   20.8872038       subj3 item40      Fast
## 138   25.5312942       subj3 item42      Fast
## 140   28.5429025       subj3 item44      Fast
## 142   39.3291885       subj3 item46      Fast
## 144   10.6126329       subj3 item48      Fast
## 145   32.4185321       subj4  item1      Fast
## 147   27.1989960       subj4  item3      Fast
## 149   48.4495181       subj4  item5      Fast
## 151   38.0043499       subj4  item7      Fast
## 153   26.3256183       subj4  item9      Fast
## 155   41.1627172       subj4 item11      Fast
## 157   29.0116679       subj4 item13      Fast
## 159   25.0019523       subj4 item15      Fast
## 161   32.0095497       subj4 item17      Fast
## 163   37.6003147       subj4 item19      Fast
## 165   50.4163552       subj4 item21      Fast
## 167   27.6264143       subj4 item23      Fast
## 169   38.0839459       subj4 item25      Fast
## 171   28.0687434       subj4 item27      Fast
## 173   18.4040870       subj4 item29      Fast
## 175   24.9782672       subj4 item31      Fast
## 177   41.7930294       subj4 item33      Fast
## 179   39.5678177       subj4 item35      Fast
## 181   35.4288194       subj4 item37      Fast
## 183   18.0748788       subj4 item39      Fast
## 185   48.2035804       subj4 item41      Fast
## 187   34.0192619       subj4 item43      Fast
## 189   36.4375709       subj4 item45      Fast
## 191   20.1860873       subj4 item47      Fast
## 194   44.7606225       subj5  item2      Fast
## 196   19.0884304       subj5  item4      Fast
## 198   34.2091834       subj5  item6      Fast
## 200   52.3252843       subj5  item8      Fast
## 202   38.3316497       subj5 item10      Fast
## 204   28.6307976       subj5 item12      Fast
## 206   32.3434902       subj5 item14      Fast
## 208   29.3081094       subj5 item16      Fast
## 210   28.4431413       subj5 item18      Fast
## 212   61.7186165       subj5 item20      Fast
## 214   36.3350311       subj5 item22      Fast
## 216   39.4432113       subj5 item24      Fast
## 218   43.0069819       subj5 item26      Fast
## 220   50.7277897       subj5 item28      Fast
## 222   43.4051261       subj5 item30      Fast
## 224   37.7203785       subj5 item32      Fast
## 226   34.9556889       subj5 item34      Fast
## 228   23.5150285       subj5 item36      Fast
## 230   35.7969374       subj5 item38      Fast
## 232   19.7100998       subj5 item40      Fast
## 234   41.0772751       subj5 item42      Fast
## 236   31.8061063       subj5 item44      Fast
## 238   41.9915856       subj5 item46      Fast
## 240   41.6470768       subj5 item48      Fast
## 241   22.1611165       subj6  item1      Fast
## 243    9.4105343       subj6  item3      Fast
## 245   28.4888169       subj6  item5      Fast
## 247   30.5016416       subj6  item7      Fast
## 249   26.7853152       subj6  item9      Fast
## 251   26.6226735       subj6 item11      Fast
## 253   11.4006883       subj6 item13      Fast
## 255    4.9802793       subj6 item15      Fast
## 257   16.3408217       subj6 item17      Fast
## 259   39.6987352       subj6 item19      Fast
## 261    7.9678986       subj6 item21      Fast
## 263   38.5046400       subj6 item23      Fast
## 265   29.8843582       subj6 item25      Fast
## 267   -4.3362605       subj6 item27      Fast
## 269  -15.7166370       subj6 item29      Fast
## 271   17.1106820       subj6 item31      Fast
## 273   24.7932227       subj6 item33      Fast
## 275   28.0088634       subj6 item35      Fast
## 277   34.2306507       subj6 item37      Fast
## 279   16.7490147       subj6 item39      Fast
## 281   22.1960835       subj6 item41      Fast
## 283   14.8206189       subj6 item43      Fast
## 285   24.4894034       subj6 item45      Fast
## 287    9.9369803       subj6 item47      Fast
## 290   31.2662699       subj7  item2      Fast
## 292   24.3856645       subj7  item4      Fast
## 294   20.6116870       subj7  item6      Fast
## 296   37.8006957       subj7  item8      Fast
## 298   30.0330709       subj7 item10      Fast
## 300   35.6762325       subj7 item12      Fast
## 302   22.1441589       subj7 item14      Fast
## 304   25.8702356       subj7 item16      Fast
## 306   18.2607581       subj7 item18      Fast
## 308   34.0621707       subj7 item20      Fast
## 310   36.8429159       subj7 item22      Fast
## 312   36.5147810       subj7 item24      Fast
## 314   31.9192530       subj7 item26      Fast
## 316   50.1754442       subj7 item28      Fast
## 318   30.7638996       subj7 item30      Fast
## 320   43.5067322       subj7 item32      Fast
## 322   33.3147231       subj7 item34      Fast
## 324   32.6898469       subj7 item36      Fast
## 326   29.9022203       subj7 item38      Fast
## 328   28.4656643       subj7 item40      Fast
## 330   33.7053548       subj7 item42      Fast
## 332   24.8244380       subj7 item44      Fast
## 334   17.3613409       subj7 item46      Fast
## 336   20.3664053       subj7 item48      Fast
## 337   36.1802024       subj8  item1      Fast
## 339   29.5631247       subj8  item3      Fast
## 341   32.9834033       subj8  item5      Fast
## 343   29.0293532       subj8  item7      Fast
## 345   25.6292333       subj8  item9      Fast
## 347   29.1229333       subj8 item11      Fast
## 349   42.6908316       subj8 item13      Fast
## 351   20.3291894       subj8 item15      Fast
## 353   31.3344446       subj8 item17      Fast
## 355   35.2385677       subj8 item19      Fast
## 357   43.5305027       subj8 item21      Fast
## 359   23.7307810       subj8 item23      Fast
## 361   40.8957234       subj8 item25      Fast
## 363   15.7140845       subj8 item27      Fast
## 365   13.1858739       subj8 item29      Fast
## 367   18.3601571       subj8 item31      Fast
## 369   39.1582697       subj8 item33      Fast
## 371   19.0174064       subj8 item35      Fast
## 373   38.5633846       subj8 item37      Fast
## 375   30.3408026       subj8 item39      Fast
## 377   27.7182364       subj8 item41      Fast
## 379   -8.2686150       subj8 item43      Fast
## 381   24.3418947       subj8 item45      Fast
## 383   14.6412913       subj8 item47      Fast
## 386   37.3635421       subj9  item2      Fast
## 388   22.3762529       subj9  item4      Fast
## 390   24.7067488       subj9  item6      Fast
## 392   24.3086290       subj9  item8      Fast
## 394   43.2060159       subj9 item10      Fast
## 396   25.4891852       subj9 item12      Fast
## 398   19.6024136       subj9 item14      Fast
## 400   27.8894153       subj9 item16      Fast
## 402   18.8797007       subj9 item18      Fast
## 404   24.4473829       subj9 item20      Fast
## 406   23.0081995       subj9 item22      Fast
## 408   13.3741259       subj9 item24      Fast
## 410   23.3255327       subj9 item26      Fast
## 412   30.8559039       subj9 item28      Fast
## 414   11.7043132       subj9 item30      Fast
## 416   32.9942811       subj9 item32      Fast
## 418   24.4684072       subj9 item34      Fast
## 420   31.6932132       subj9 item36      Fast
## 422   25.0817767       subj9 item38      Fast
## 424   16.4490114       subj9 item40      Fast
## 426   31.3999564       subj9 item42      Fast
## 428   33.5414974       subj9 item44      Fast
## 430   23.3735836       subj9 item46      Fast
## 432   33.4041071       subj9 item48      Fast
## 433   41.6636023      subj10  item1      Fast
## 435   39.6171809      subj10  item3      Fast
## 437   48.5279848      subj10  item5      Fast
## 439   31.2758629      subj10  item7      Fast
## 441   20.4618222      subj10  item9      Fast
## 443   32.4312535      subj10 item11      Fast
## 445   25.6495049      subj10 item13      Fast
## 447   24.6292637      subj10 item15      Fast
## 449   32.6100716      subj10 item17      Fast
## 451   48.1627761      subj10 item19      Fast
## 453   49.3605917      subj10 item21      Fast
## 455   35.2928966      subj10 item23      Fast
## 457   40.7380586      subj10 item25      Fast
## 459   24.8291558      subj10 item27      Fast
## 461    5.7194502      subj10 item29      Fast
## 463   33.3837787      subj10 item31      Fast
## 465   47.2324174      subj10 item33      Fast
## 467   30.2970734      subj10 item35      Fast
## 469   53.5966579      subj10 item37      Fast
## 471   24.6279002      subj10 item39      Fast
## 473   41.3164352      subj10 item41      Fast
## 475   30.1673769      subj10 item43      Fast
## 477   42.2430524      subj10 item45      Fast
## 479   31.7817443      subj10 item47      Fast
## 482   31.0903219      subj11  item2      Fast
## 484   28.0168309      subj11  item4      Fast
## 486   27.3264756      subj11  item6      Fast
## 488   25.6890104      subj11  item8      Fast
## 490   13.6170653      subj11 item10      Fast
## 492   11.0422651      subj11 item12      Fast
## 494   13.6189390      subj11 item14      Fast
## 496   25.7031288      subj11 item16      Fast
## 498   12.3673890      subj11 item18      Fast
## 500   21.0060348      subj11 item20      Fast
## 502    7.0610707      subj11 item22      Fast
## 504   32.0838451      subj11 item24      Fast
## 506   32.5848336      subj11 item26      Fast
## 508   22.2927875      subj11 item28      Fast
## 510    8.9932692      subj11 item30      Fast
## 512   23.5187504      subj11 item32      Fast
## 514   26.9831743      subj11 item34      Fast
## 516   33.0429793      subj11 item36      Fast
## 518   22.3315740      subj11 item38      Fast
## 520   23.7290180      subj11 item40      Fast
## 522   32.7441562      subj11 item42      Fast
## 524   10.4818293      subj11 item44      Fast
## 526   23.4803436      subj11 item46      Fast
## 528   14.5240680      subj11 item48      Fast
## 529   26.8079920      subj12  item1      Fast
## 531   29.6524171      subj12  item3      Fast
## 533   38.3287407      subj12  item5      Fast
## 535   34.1245486      subj12  item7      Fast
## 537   34.1309452      subj12  item9      Fast
## 539   27.0018360      subj12 item11      Fast
## 541   11.1474774      subj12 item13      Fast
## 543   23.2321828      subj12 item15      Fast
## 545   31.1748889      subj12 item17      Fast
## 547   21.5589320      subj12 item19      Fast
## 549   30.0096590      subj12 item21      Fast
## 551   36.4091986      subj12 item23      Fast
## 553   41.9897692      subj12 item25      Fast
## 555   31.2704755      subj12 item27      Fast
## 557   29.9077536      subj12 item29      Fast
## 559   10.6940076      subj12 item31      Fast
## 561   39.6091469      subj12 item33      Fast
## 563   42.9459643      subj12 item35      Fast
## 565   52.1153546      subj12 item37      Fast
## 567   31.4886422      subj12 item39      Fast
## 569   20.9983379      subj12 item41      Fast
## 571   32.7191356      subj12 item43      Fast
## 573   42.7215387      subj12 item45      Fast
## 575    6.8065874      subj12 item47      Fast
## 578   43.5885316      subj13  item2      Fast
## 580   21.7650147      subj13  item4      Fast
## 582   47.1256019      subj13  item6      Fast
## 584   41.5198792      subj13  item8      Fast
## 586   43.5139956      subj13 item10      Fast
## 588   40.7948665      subj13 item12      Fast
## 590   41.0779606      subj13 item14      Fast
## 592   54.2635401      subj13 item16      Fast
## 594   44.4507276      subj13 item18      Fast
## 596   35.5716505      subj13 item20      Fast
## 598   43.2337119      subj13 item22      Fast
## 600   45.2438785      subj13 item24      Fast
## 602   20.7120566      subj13 item26      Fast
## 604   35.3995468      subj13 item28      Fast
## 606   35.7962519      subj13 item30      Fast
## 608   45.4790214      subj13 item32      Fast
## 610   43.1459942      subj13 item34      Fast
## 612   37.9313919      subj13 item36      Fast
## 614   36.4895399      subj13 item38      Fast
## 616   50.2424387      subj13 item40      Fast
## 618   34.8735741      subj13 item42      Fast
## 620   39.1924362      subj13 item44      Fast
## 622   51.3710069      subj13 item46      Fast
## 624   34.9746788      subj13 item48      Fast
## 625   36.6955908      subj14  item1      Fast
## 627   25.9911764      subj14  item3      Fast
## 629   34.8153958      subj14  item5      Fast
## 631   40.5824169      subj14  item7      Fast
## 633   31.4060855      subj14  item9      Fast
## 635   34.7554814      subj14 item11      Fast
## 637   20.4485510      subj14 item13      Fast
## 639   18.6051055      subj14 item15      Fast
## 641   40.9530716      subj14 item17      Fast
## 643   33.8449265      subj14 item19      Fast
## 645   50.6097123      subj14 item21      Fast
## 647   40.8544221      subj14 item23      Fast
## 649   52.6594083      subj14 item25      Fast
## 651   47.0161136      subj14 item27      Fast
## 653   21.5927652      subj14 item29      Fast
## 655   40.2634141      subj14 item31      Fast
## 657   50.7768372      subj14 item33      Fast
## 659   43.3550260      subj14 item35      Fast
## 661   48.5795664      subj14 item37      Fast
## 663   25.0777667      subj14 item39      Fast
## 665   38.4357988      subj14 item41      Fast
## 667   31.3614640      subj14 item43      Fast
## 669   54.8905171      subj14 item45      Fast
## 671   14.4715103      subj14 item47      Fast
## 674   26.6319559      subj15  item2      Fast
## 676   16.5180442      subj15  item4      Fast
## 678   46.6384490      subj15  item6      Fast
## 680   20.7222607      subj15  item8      Fast
## 682   37.5523209      subj15 item10      Fast
## 684   37.0974938      subj15 item12      Fast
## 686   16.8552564      subj15 item14      Fast
## 688   39.5594628      subj15 item16      Fast
## 690   27.1664136      subj15 item18      Fast
## 692   30.1217616      subj15 item20      Fast
## 694   14.1680239      subj15 item22      Fast
## 696   47.5012935      subj15 item24      Fast
## 698   18.0984175      subj15 item26      Fast
## 700   23.9970394      subj15 item28      Fast
## 702   20.1154454      subj15 item30      Fast
## 704   33.7442017      subj15 item32      Fast
## 706   51.1595140      subj15 item34      Fast
## 708   29.8798646      subj15 item36      Fast
## 710   17.9387563      subj15 item38      Fast
## 712   32.9301721      subj15 item40      Fast
## 714   27.5861650      subj15 item42      Fast
## 716   30.3154496      subj15 item44      Fast
## 718   42.2058889      subj15 item46      Fast
## 720   12.6645048      subj15 item48      Fast
## 721   29.7487241      subj16  item1      Fast
## 723   25.5733775      subj16  item3      Fast
## 725   31.1931763      subj16  item5      Fast
## 727   21.5427483      subj16  item7      Fast
## 729   25.5646204      subj16  item9      Fast
## 731   37.3077636      subj16 item11      Fast
## 733   15.2930884      subj16 item13      Fast
## 735    8.4375858      subj16 item15      Fast
## 737   27.3153600      subj16 item17      Fast
## 739   31.5051756      subj16 item19      Fast
## 741   26.0692423      subj16 item21      Fast
## 743   27.5941156      subj16 item23      Fast
## 745   35.5765132      subj16 item25      Fast
## 747   28.0862578      subj16 item27      Fast
## 749    6.6778421      subj16 item29      Fast
## 751   46.3367636      subj16 item31      Fast
## 753   34.5695279      subj16 item33      Fast
## 755   14.2906657      subj16 item35      Fast
## 757   38.5986298      subj16 item37      Fast
## 759   20.8319451      subj16 item39      Fast
## 761   24.1136994      subj16 item41      Fast
## 763   21.8425265      subj16 item43      Fast
## 765   18.0894962      subj16 item45      Fast
## 767   21.2075095      subj16 item47      Fast
## 770   41.7990202      subj17  item2      Fast
## 772   21.5395982      subj17  item4      Fast
## 774   33.3853356      subj17  item6      Fast
## 776   36.7321996      subj17  item8      Fast
## 778   29.0860730      subj17 item10      Fast
## 780   23.3821211      subj17 item12      Fast
## 782   44.3374956      subj17 item14      Fast
## 784   44.2112530      subj17 item16      Fast
## 786   50.6693898      subj17 item18      Fast
## 788   34.6491376      subj17 item20      Fast
## 790   26.3409122      subj17 item22      Fast
## 792   28.2777969      subj17 item24      Fast
## 794   32.8018945      subj17 item26      Fast
## 796   33.6122921      subj17 item28      Fast
## 798   25.7379850      subj17 item30      Fast
## 800   20.2967946      subj17 item32      Fast
## 802   34.2518383      subj17 item34      Fast
## 804   39.8629731      subj17 item36      Fast
## 806   20.5150146      subj17 item38      Fast
## 808   21.6190719      subj17 item40      Fast
## 810   32.4046675      subj17 item42      Fast
## 812   35.0538840      subj17 item44      Fast
## 814   33.5208532      subj17 item46      Fast
## 816   25.6307210      subj17 item48      Fast
## 817   28.2917397      subj18  item1      Fast
## 819   21.5977184      subj18  item3      Fast
## 821   31.7632619      subj18  item5      Fast
## 823   39.9850026      subj18  item7      Fast
## 825   27.5121103      subj18  item9      Fast
## 827   23.2147363      subj18 item11      Fast
## 829    4.7033765      subj18 item13      Fast
## 831   29.1530816      subj18 item15      Fast
## 833   26.2507557      subj18 item17      Fast
## 835   24.3991711      subj18 item19      Fast
## 837   22.3280588      subj18 item21      Fast
## 839   34.3160442      subj18 item23      Fast
## 841   25.8685855      subj18 item25      Fast
## 843   18.4902872      subj18 item27      Fast
## 845   23.0928637      subj18 item29      Fast
## 847   27.9553279      subj18 item31      Fast
## 849   20.7098144      subj18 item33      Fast
## 851   33.9175459      subj18 item35      Fast
## 853   29.3228732      subj18 item37      Fast
## 855   18.1478484      subj18 item39      Fast
## 857   17.6858912      subj18 item41      Fast
## 859   18.1849325      subj18 item43      Fast
## 861   12.8117636      subj18 item45      Fast
## 863   37.5473786      subj18 item47      Fast
## 866   54.5767869      subj19  item2      Fast
## 868   30.5938075      subj19  item4      Fast
## 870   36.8857702      subj19  item6      Fast
## 872   38.9311581      subj19  item8      Fast
## 874   54.3242949      subj19 item10      Fast
## 876   38.9279057      subj19 item12      Fast
## 878   40.8867461      subj19 item14      Fast
## 880   34.9558798      subj19 item16      Fast
## 882   33.4040947      subj19 item18      Fast
## 884   43.1222432      subj19 item20      Fast
## 886   25.8752672      subj19 item22      Fast
## 888   41.3478189      subj19 item24      Fast
## 890   39.9315814      subj19 item26      Fast
## 892   36.9804280      subj19 item28      Fast
## 894   24.3408747      subj19 item30      Fast
## 896   44.9372715      subj19 item32      Fast
## 898   42.4207161      subj19 item34      Fast
## 900   40.0110381      subj19 item36      Fast
## 902   42.6470743      subj19 item38      Fast
## 904   30.5007414      subj19 item40      Fast
## 906   16.7628183      subj19 item42      Fast
## 908   29.3485064      subj19 item44      Fast
## 910   47.9978645      subj19 item46      Fast
## 912   19.5755499      subj19 item48      Fast
## 913   26.4871783      subj20  item1      Fast
## 915   24.7677593      subj20  item3      Fast
## 917   26.6919103      subj20  item5      Fast
## 919   50.8844972      subj20  item7      Fast
## 921   27.6826872      subj20  item9      Fast
## 923   26.1900011      subj20 item11      Fast
## 925   25.2177481      subj20 item13      Fast
## 927   32.3002018      subj20 item15      Fast
## 929   46.0798332      subj20 item17      Fast
## 931   36.5372326      subj20 item19      Fast
## 933   30.5531528      subj20 item21      Fast
## 935   33.1090463      subj20 item23      Fast
## 937   44.2899667      subj20 item25      Fast
## 939   33.9846061      subj20 item27      Fast
## 941   -1.4475536      subj20 item29      Fast
## 943   36.8781439      subj20 item31      Fast
## 945   23.3312016      subj20 item33      Fast
## 947   38.2421960      subj20 item35      Fast
## 949   40.0128314      subj20 item37      Fast
## 951   17.7068176      subj20 item39      Fast
## 953   21.5273375      subj20 item41      Fast
## 955   14.3041403      subj20 item43      Fast
## 957   22.7658905      subj20 item45      Fast
## 959   17.6090537      subj20 item47      Fast
## 962   36.9821381      subj21  item2      Fast
## 964   25.5492052      subj21  item4      Fast
## 966   37.6777301      subj21  item6      Fast
## 968   26.1274206      subj21  item8      Fast
## 970   42.2064103      subj21 item10      Fast
## 972   30.1150484      subj21 item12      Fast
## 974   37.6282273      subj21 item14      Fast
## 976   48.9365681      subj21 item16      Fast
## 978   34.1175554      subj21 item18      Fast
## 980   34.0380744      subj21 item20      Fast
## 982   24.3012930      subj21 item22      Fast
## 984   33.8597309      subj21 item24      Fast
## 986   29.1730892      subj21 item26      Fast
## 988   31.9260287      subj21 item28      Fast
## 990   35.8599680      subj21 item30      Fast
## 992   38.6333227      subj21 item32      Fast
## 994   39.9673287      subj21 item34      Fast
## 996   35.0990007      subj21 item36      Fast
## 998   33.9236847      subj21 item38      Fast
## 1000  16.5043842      subj21 item40      Fast
## 1002  38.3211022      subj21 item42      Fast
## 1004  31.3952649      subj21 item44      Fast
## 1006  62.0011720      subj21 item46      Fast
## 1008  26.2234366      subj21 item48      Fast
## 1009  30.2553526      subj22  item1      Fast
## 1011  21.7504327      subj22  item3      Fast
## 1013  52.4264499      subj22  item5      Fast
## 1015  37.0768361      subj22  item7      Fast
## 1017  11.9143961      subj22  item9      Fast
## 1019  29.1747440      subj22 item11      Fast
## 1021  18.1557166      subj22 item13      Fast
## 1023  16.8587616      subj22 item15      Fast
## 1025  22.1892248      subj22 item17      Fast
## 1027  20.1761943      subj22 item19      Fast
## 1029  35.6242290      subj22 item21      Fast
## 1031  30.5736819      subj22 item23      Fast
## 1033  33.5284391      subj22 item25      Fast
## 1035  29.5924736      subj22 item27      Fast
## 1037  11.4356174      subj22 item29      Fast
## 1039  21.4130911      subj22 item31      Fast
## 1041  32.3379838      subj22 item33      Fast
## 1043  22.7171551      subj22 item35      Fast
## 1045  49.4524589      subj22 item37      Fast
## 1047  28.2899147      subj22 item39      Fast
## 1049  21.9456370      subj22 item41      Fast
## 1051  21.9591741      subj22 item43      Fast
## 1053  23.3416074      subj22 item45      Fast
## 1055  22.9313235      subj22 item47      Fast
## 1058  24.4554811      subj23  item2      Fast
## 1060  30.0325404      subj23  item4      Fast
## 1062  31.5846859      subj23  item6      Fast
## 1064  22.7785635      subj23  item8      Fast
## 1066  13.7871982      subj23 item10      Fast
## 1068  17.7372230      subj23 item12      Fast
## 1070  17.6353795      subj23 item14      Fast
## 1072  37.1613063      subj23 item16      Fast
## 1074   6.4494366      subj23 item18      Fast
## 1076   8.2597723      subj23 item20      Fast
## 1078  19.6378877      subj23 item22      Fast
## 1080  28.0600749      subj23 item24      Fast
## 1082  25.4238215      subj23 item26      Fast
## 1084  16.5834502      subj23 item28      Fast
## 1086  21.7964456      subj23 item30      Fast
## 1088  24.3021751      subj23 item32      Fast
## 1090  39.2813525      subj23 item34      Fast
## 1092  30.2916454      subj23 item36      Fast
## 1094  27.9486612      subj23 item38      Fast
## 1096  21.9685455      subj23 item40      Fast
## 1098  18.6355743      subj23 item42      Fast
## 1100  13.2725212      subj23 item44      Fast
## 1102  28.3570443      subj23 item46      Fast
## 1104  32.3235931      subj23 item48      Fast
## 1105  35.7475009      subj24  item1      Fast
## 1107  16.2274413      subj24  item3      Fast
## 1109  39.9644038      subj24  item5      Fast
## 1111  28.8942442      subj24  item7      Fast
## 1113   3.4332896      subj24  item9      Fast
## 1115  18.9738112      subj24 item11      Fast
## 1117  25.9443654      subj24 item13      Fast
## 1119  16.3868078      subj24 item15      Fast
## 1121  34.5222010      subj24 item17      Fast
## 1123  38.8728682      subj24 item19      Fast
## 1125  30.9384667      subj24 item21      Fast
## 1127  17.0054493      subj24 item23      Fast
## 1129  30.1198164      subj24 item25      Fast
## 1131  36.2062753      subj24 item27      Fast
## 1133  16.7392616      subj24 item29      Fast
## 1135  30.2843633      subj24 item31      Fast
## 1137  30.7627428      subj24 item33      Fast
## 1139  28.2010939      subj24 item35      Fast
## 1141  45.7938166      subj24 item37      Fast
## 1143  14.4571807      subj24 item39      Fast
## 1145  25.6363335      subj24 item41      Fast
## 1147  12.1317659      subj24 item43      Fast
## 1149  14.8042055      subj24 item45      Fast
## 1151  14.9676073      subj24 item47      Fast
## 1154  26.7233096      subj25  item2      Fast
## 1156  12.8266191      subj25  item4      Fast
## 1158  28.5863348      subj25  item6      Fast
## 1160  32.3002481      subj25  item8      Fast
## 1162  56.8207673      subj25 item10      Fast
## 1164  34.0431035      subj25 item12      Fast
## 1166  25.6909558      subj25 item14      Fast
## 1168  47.0536048      subj25 item16      Fast
## 1170  33.8119155      subj25 item18      Fast
## 1172  36.6066014      subj25 item20      Fast
## 1174  31.8792464      subj25 item22      Fast
## 1176  19.5100120      subj25 item24      Fast
## 1178  27.0512411      subj25 item26      Fast
## 1180  32.3008892      subj25 item28      Fast
## 1182  24.7071425      subj25 item30      Fast
## 1184  36.4149577      subj25 item32      Fast
## 1186  49.7325307      subj25 item34      Fast
## 1188  26.0766494      subj25 item36      Fast
## 1190  27.4548067      subj25 item38      Fast
## 1192  32.4596505      subj25 item40      Fast
## 1194  38.3688304      subj25 item42      Fast
## 1196  39.1031416      subj25 item44      Fast
## 1198  43.9676072      subj25 item46      Fast
## 1200  24.4886454      subj25 item48      Fast
## 1201  29.3181517      subj26  item1      Fast
## 1203  19.2242980      subj26  item3      Fast
## 1205  20.4359617      subj26  item5      Fast
## 1207  25.5273830      subj26  item7      Fast
## 1209  18.5643652      subj26  item9      Fast
## 1211  19.3886797      subj26 item11      Fast
## 1213   6.6455526      subj26 item13      Fast
## 1215   0.3173835      subj26 item15      Fast
## 1217  16.2151342      subj26 item17      Fast
## 1219  23.6690495      subj26 item19      Fast
## 1221  25.7707760      subj26 item21      Fast
## 1223  39.3361409      subj26 item23      Fast
## 1225  17.2787861      subj26 item25      Fast
## 1227  22.9380400      subj26 item27      Fast
## 1229 -12.2204277      subj26 item29      Fast
## 1231  29.8671438      subj26 item31      Fast
## 1233  13.0955841      subj26 item33      Fast
## 1235  25.2384463      subj26 item35      Fast
## 1237  41.4502811      subj26 item37      Fast
## 1239   9.9491739      subj26 item39      Fast
## 1241  25.3089577      subj26 item41      Fast
## 1243   6.4622713      subj26 item43      Fast
## 1245  12.3035765      subj26 item45      Fast
## 1247  14.6981188      subj26 item47      Fast
## 1250  21.2720558      subj27  item2      Fast
## 1252  21.7288296      subj27  item4      Fast
## 1254  51.5377721      subj27  item6      Fast
## 1256  41.8346330      subj27  item8      Fast
## 1258  30.1508880      subj27 item10      Fast
## 1260  37.1401735      subj27 item12      Fast
## 1262  33.3216425      subj27 item14      Fast
## 1264  48.7114621      subj27 item16      Fast
## 1266  33.7766196      subj27 item18      Fast
## 1268  41.9181979      subj27 item20      Fast
## 1270  48.0474068      subj27 item22      Fast
## 1272  34.3355225      subj27 item24      Fast
## 1274  36.2130053      subj27 item26      Fast
## 1276  43.9064972      subj27 item28      Fast
## 1278  27.6776032      subj27 item30      Fast
## 1280  41.4202828      subj27 item32      Fast
## 1282  41.7204078      subj27 item34      Fast
## 1284  28.9568157      subj27 item36      Fast
## 1286  19.0775368      subj27 item38      Fast
## 1288   9.1298109      subj27 item40      Fast
## 1290  33.5302186      subj27 item42      Fast
## 1292  38.0201663      subj27 item44      Fast
## 1294  33.5111603      subj27 item46      Fast
## 1296  13.7810701      subj27 item48      Fast
## 1297  33.4909087      subj28  item1      Fast
## 1299  24.0312883      subj28  item3      Fast
## 1301  34.2433207      subj28  item5      Fast
## 1303  35.7588514      subj28  item7      Fast
## 1305  38.7270265      subj28  item9      Fast
## 1307  40.3145077      subj28 item11      Fast
## 1309  16.5550212      subj28 item13      Fast
## 1311  15.5933988      subj28 item15      Fast
## 1313  35.0383237      subj28 item17      Fast
## 1315  16.9939874      subj28 item19      Fast
## 1317  32.0261369      subj28 item21      Fast
## 1319  36.5224611      subj28 item23      Fast
## 1321  43.9378338      subj28 item25      Fast
## 1323  23.7439239      subj28 item27      Fast
## 1325   4.8963416      subj28 item29      Fast
## 1327  23.2245423      subj28 item31      Fast
## 1329  31.5400698      subj28 item33      Fast
## 1331  28.9317406      subj28 item35      Fast
## 1333  31.8873048      subj28 item37      Fast
## 1335  21.9822814      subj28 item39      Fast
## 1337  26.9965325      subj28 item41      Fast
## 1339  20.1223058      subj28 item43      Fast
## 1341  29.5424843      subj28 item45      Fast
## 1343   7.6535236      subj28 item47      Fast
## 1346  27.7577604      subj29  item2      Fast
## 1348  21.9775691      subj29  item4      Fast
## 1350  55.5738326      subj29  item6      Fast
## 1352  48.2177331      subj29  item8      Fast
## 1354  46.8919405      subj29 item10      Fast
## 1356  20.5988548      subj29 item12      Fast
## 1358  32.3434526      subj29 item14      Fast
## 1360  39.2392132      subj29 item16      Fast
## 1362  37.5873174      subj29 item18      Fast
## 1364  25.6933354      subj29 item20      Fast
## 1366  31.4089063      subj29 item22      Fast
## 1368  37.1986304      subj29 item24      Fast
## 1370  32.6069474      subj29 item26      Fast
## 1372  45.6209879      subj29 item28      Fast
## 1374  26.1949158      subj29 item30      Fast
## 1376  24.3239618      subj29 item32      Fast
## 1378  29.0909411      subj29 item34      Fast
## 1380  37.1189356      subj29 item36      Fast
## 1382  38.1220575      subj29 item38      Fast
## 1384  35.0158499      subj29 item40      Fast
## 1386  35.9761060      subj29 item42      Fast
## 1388  25.2266499      subj29 item44      Fast
## 1390  30.9857731      subj29 item46      Fast
## 1392  18.3550874      subj29 item48      Fast
## 1393  38.9411338      subj30  item1      Fast
## 1395  21.8320026      subj30  item3      Fast
## 1397  33.2869066      subj30  item5      Fast
## 1399  24.3460319      subj30  item7      Fast
## 1401  25.0525210      subj30  item9      Fast
## 1403  26.6712566      subj30 item11      Fast
## 1405  26.3371082      subj30 item13      Fast
## 1407  18.7829019      subj30 item15      Fast
## 1409  33.4745584      subj30 item17      Fast
## 1411  20.6721633      subj30 item19      Fast
## 1413  33.1536695      subj30 item21      Fast
## 1415  33.1846014      subj30 item23      Fast
## 1417  35.8178186      subj30 item25      Fast
## 1419  25.9292072      subj30 item27      Fast
## 1421  14.9045797      subj30 item29      Fast
## 1423  26.2900364      subj30 item31      Fast
## 1425  54.3873532      subj30 item33      Fast
## 1427  25.0231557      subj30 item35      Fast
## 1429  31.3873370      subj30 item37      Fast
## 1431  25.4104561      subj30 item39      Fast
## 1433  29.3644828      subj30 item41      Fast
## 1435  23.8200063      subj30 item43      Fast
## 1437  19.9973310      subj30 item45      Fast
## 1439  20.0356736      subj30 item47      Fast
## 1442  25.5858056      subj31  item2      Fast
## 1444  11.4230961      subj31  item4      Fast
## 1446  29.5187926      subj31  item6      Fast
## 1448  22.4913294      subj31  item8      Fast
## 1450  37.3077744      subj31 item10      Fast
## 1452  24.0280136      subj31 item12      Fast
## 1454  14.5002676      subj31 item14      Fast
## 1456  32.1632452      subj31 item16      Fast
## 1458  30.3691460      subj31 item18      Fast
## 1460  35.4249485      subj31 item20      Fast
## 1462  32.2225819      subj31 item22      Fast
## 1464  38.8614598      subj31 item24      Fast
## 1466  25.6219002      subj31 item26      Fast
## 1468  24.9442581      subj31 item28      Fast
## 1470  34.2787372      subj31 item30      Fast
## 1472  28.8091253      subj31 item32      Fast
## 1474  33.5098914      subj31 item34      Fast
## 1476  38.7728580      subj31 item36      Fast
## 1478  20.9240234      subj31 item38      Fast
## 1480  21.0803440      subj31 item40      Fast
## 1482  32.4262329      subj31 item42      Fast
## 1484  23.6412394      subj31 item44      Fast
## 1486  48.9075884      subj31 item46      Fast
## 1488  16.9597456      subj31 item48      Fast
## 1489  25.6627457      subj32  item1      Fast
## 1491  20.2975166      subj32  item3      Fast
## 1493  19.6594046      subj32  item5      Fast
## 1495  25.0300113      subj32  item7      Fast
## 1497  18.2033407      subj32  item9      Fast
## 1499  32.8742076      subj32 item11      Fast
## 1501  18.4920215      subj32 item13      Fast
## 1503  17.4502125      subj32 item15      Fast
## 1505  22.8170980      subj32 item17      Fast
## 1507  23.2253390      subj32 item19      Fast
## 1509  13.7755411      subj32 item21      Fast
## 1511  25.9148312      subj32 item23      Fast
## 1513  38.2842595      subj32 item25      Fast
## 1515  13.8615955      subj32 item27      Fast
## 1517   0.3133097      subj32 item29      Fast
## 1519  22.5048885      subj32 item31      Fast
## 1521  22.0883593      subj32 item33      Fast
## 1523  32.8439329      subj32 item35      Fast
## 1525  33.9410369      subj32 item37      Fast
## 1527  20.9347967      subj32 item39      Fast
## 1529  28.6623270      subj32 item41      Fast
## 1531  13.0352506      subj32 item43      Fast
## 1533  13.2996935      subj32 item45      Fast
## 1535   5.1256393      subj32 item47      Fast
## 1538  32.0686475      subj33  item2      Fast
## 1540  30.4192031      subj33  item4      Fast
## 1542  30.0680446      subj33  item6      Fast
## 1544  24.5226565      subj33  item8      Fast
## 1546  42.5457748      subj33 item10      Fast
## 1548  36.5127099      subj33 item12      Fast
## 1550  25.0241831      subj33 item14      Fast
## 1552  33.3715706      subj33 item16      Fast
## 1554  22.1222305      subj33 item18      Fast
## 1556  35.5634816      subj33 item20      Fast
## 1558  18.1809354      subj33 item22      Fast
## 1560  23.5367501      subj33 item24      Fast
## 1562  34.1675805      subj33 item26      Fast
## 1564  38.4970667      subj33 item28      Fast
## 1566   3.5625383      subj33 item30      Fast
## 1568  24.0955076      subj33 item32      Fast
## 1570  36.7786498      subj33 item34      Fast
## 1572  32.8672446      subj33 item36      Fast
## 1574  32.0780025      subj33 item38      Fast
## 1576  26.2818290      subj33 item40      Fast
## 1578  21.7629540      subj33 item42      Fast
## 1580  26.8405159      subj33 item44      Fast
## 1582  32.2674518      subj33 item46      Fast
## 1584  11.0535228      subj33 item48      Fast
## 1585  37.3246812      subj34  item1      Fast
## 1587  20.0034193      subj34  item3      Fast
## 1589  51.1289552      subj34  item5      Fast
## 1591  30.5840206      subj34  item7      Fast
## 1593  15.0647024      subj34  item9      Fast
## 1595  35.0689253      subj34 item11      Fast
## 1597  12.2252619      subj34 item13      Fast
## 1599  19.6739481      subj34 item15      Fast
## 1601  29.5998237      subj34 item17      Fast
## 1603  26.2424391      subj34 item19      Fast
## 1605  31.8424049      subj34 item21      Fast
## 1607  27.0111829      subj34 item23      Fast
## 1609  37.3782004      subj34 item25      Fast
## 1611  22.9227101      subj34 item27      Fast
## 1613  22.3905835      subj34 item29      Fast
## 1615   9.6329457      subj34 item31      Fast
## 1617  52.3399954      subj34 item33      Fast
## 1619  39.8148985      subj34 item35      Fast
## 1621  32.9891814      subj34 item37      Fast
## 1623  36.2269549      subj34 item39      Fast
## 1625  28.9871068      subj34 item41      Fast
## 1627  14.1228741      subj34 item43      Fast
## 1629  37.5212322      subj34 item45      Fast
## 1631  16.9599774      subj34 item47      Fast
## 1634  35.1112023      subj35  item2      Fast
## 1636  15.2693492      subj35  item4      Fast
## 1638  29.5835392      subj35  item6      Fast
## 1640  43.6473200      subj35  item8      Fast
## 1642  27.6206750      subj35 item10      Fast
## 1644  31.4885580      subj35 item12      Fast
## 1646  21.0224831      subj35 item14      Fast
## 1648  19.1497965      subj35 item16      Fast
## 1650  12.4903371      subj35 item18      Fast
## 1652  27.5795953      subj35 item20      Fast
## 1654  33.8790793      subj35 item22      Fast
## 1656  28.0324475      subj35 item24      Fast
## 1658  25.7280410      subj35 item26      Fast
## 1660  19.8101443      subj35 item28      Fast
## 1662  24.9823073      subj35 item30      Fast
## 1664  42.6958886      subj35 item32      Fast
## 1666  38.5025818      subj35 item34      Fast
## 1668  44.4801075      subj35 item36      Fast
## 1670  16.4304317      subj35 item38      Fast
## 1672  25.8874463      subj35 item40      Fast
## 1674  23.5713138      subj35 item42      Fast
## 1676  32.8906787      subj35 item44      Fast
## 1678  45.4566537      subj35 item46      Fast
## 1680  37.2268242      subj35 item48      Fast
## 1681  34.3224088      subj36  item1      Fast
## 1683  29.5032605      subj36  item3      Fast
## 1685  53.3932454      subj36  item5      Fast
## 1687  41.9829174      subj36  item7      Fast
## 1689  48.4063524      subj36  item9      Fast
## 1691  30.4163548      subj36 item11      Fast
## 1693  32.9865671      subj36 item13      Fast
## 1695  29.5740614      subj36 item15      Fast
## 1697  42.6535914      subj36 item17      Fast
## 1699  24.9212176      subj36 item19      Fast
## 1701  35.9962881      subj36 item21      Fast
## 1703  34.5547910      subj36 item23      Fast
## 1705  45.4482324      subj36 item25      Fast
## 1707  28.8499560      subj36 item27      Fast
## 1709  19.0037526      subj36 item29      Fast
## 1711  47.6493094      subj36 item31      Fast
## 1713  42.5319921      subj36 item33      Fast
## 1715  38.1538149      subj36 item35      Fast
## 1717  50.9439608      subj36 item37      Fast
## 1719  43.3142575      subj36 item39      Fast
## 1721  37.6941682      subj36 item41      Fast
## 1723  24.9772465      subj36 item43      Fast
## 1725  34.3254338      subj36 item45      Fast
## 1727  18.8095329      subj36 item47      Fast
## 1730  29.5018189      subj37  item2      Fast
## 1732  18.5373112      subj37  item4      Fast
## 1734  36.0551952      subj37  item6      Fast
## 1736  23.8551781      subj37  item8      Fast
## 1738  46.0816395      subj37 item10      Fast
## 1740  20.6171520      subj37 item12      Fast
## 1742  26.7778075      subj37 item14      Fast
## 1744  44.4493914      subj37 item16      Fast
## 1746  32.0027823      subj37 item18      Fast
## 1748  21.4706628      subj37 item20      Fast
## 1750  33.8220936      subj37 item22      Fast
## 1752  22.9614739      subj37 item24      Fast
## 1754  38.0883532      subj37 item26      Fast
## 1756  30.0252859      subj37 item28      Fast
## 1758   3.0910899      subj37 item30      Fast
## 1760  15.9693506      subj37 item32      Fast
## 1762  40.0713579      subj37 item34      Fast
## 1764  30.2842399      subj37 item36      Fast
## 1766  32.7790525      subj37 item38      Fast
## 1768  20.3892453      subj37 item40      Fast
## 1770  30.9104968      subj37 item42      Fast
## 1772  28.8872640      subj37 item44      Fast
## 1774  44.5194542      subj37 item46      Fast
## 1776  18.2482163      subj37 item48      Fast
## 1777  38.9434757      subj38  item1      Fast
## 1779  43.6332993      subj38  item3      Fast
## 1781  40.5135269      subj38  item5      Fast
## 1783  19.3641427      subj38  item7      Fast
## 1785  21.0947847      subj38  item9      Fast
## 1787  26.6268775      subj38 item11      Fast
## 1789   9.4365405      subj38 item13      Fast
## 1791   8.7410561      subj38 item15      Fast
## 1793  32.9586871      subj38 item17      Fast
## 1795  54.8728592      subj38 item19      Fast
## 1797  23.7032427      subj38 item21      Fast
## 1799  27.9077207      subj38 item23      Fast
## 1801  46.3788979      subj38 item25      Fast
## 1803  13.5273445      subj38 item27      Fast
## 1805  15.3245871      subj38 item29      Fast
## 1807  28.8221376      subj38 item31      Fast
## 1809  28.1753381      subj38 item33      Fast
## 1811  24.5079903      subj38 item35      Fast
## 1813  50.8704913      subj38 item37      Fast
## 1815  15.8379677      subj38 item39      Fast
## 1817  40.8744882      subj38 item41      Fast
## 1819  19.3192343      subj38 item43      Fast
## 1821  24.8290283      subj38 item45      Fast
## 1823  14.9609994      subj38 item47      Fast
## 1826  17.6861291      subj39  item2      Fast
## 1828  22.1522710      subj39  item4      Fast
## 1830  36.0280992      subj39  item6      Fast
## 1832  28.9725498      subj39  item8      Fast
## 1834  35.2129034      subj39 item10      Fast
## 1836  24.6921101      subj39 item12      Fast
## 1838  22.0850305      subj39 item14      Fast
## 1840  23.0626664      subj39 item16      Fast
## 1842  23.8257381      subj39 item18      Fast
## 1844  30.4847716      subj39 item20      Fast
## 1846  14.1254798      subj39 item22      Fast
## 1848  28.5962273      subj39 item24      Fast
## 1850  30.8299210      subj39 item26      Fast
## 1852  23.1643009      subj39 item28      Fast
## 1854  22.8389451      subj39 item30      Fast
## 1856  27.1327217      subj39 item32      Fast
## 1858  33.1929936      subj39 item34      Fast
## 1860  32.3496042      subj39 item36      Fast
## 1862  35.9951553      subj39 item38      Fast
## 1864  28.2086841      subj39 item40      Fast
## 1866  20.1004248      subj39 item42      Fast
## 1868  34.7364173      subj39 item44      Fast
## 1870  46.5593697      subj39 item46      Fast
## 1872  24.2407838      subj39 item48      Fast
## 1873  23.8467025      subj40  item1      Fast
## 1875  32.6537367      subj40  item3      Fast
## 1877  44.4885490      subj40  item5      Fast
## 1879  36.7616674      subj40  item7      Fast
## 1881  35.1322184      subj40  item9      Fast
## 1883  14.7527398      subj40 item11      Fast
## 1885  26.8713006      subj40 item13      Fast
## 1887  27.2368275      subj40 item15      Fast
## 1889  48.3640344      subj40 item17      Fast
## 1891  45.6400772      subj40 item19      Fast
## 1893  29.6963594      subj40 item21      Fast
## 1895  32.8091400      subj40 item23      Fast
## 1897  41.8395542      subj40 item25      Fast
## 1899  47.4266093      subj40 item27      Fast
## 1901  17.7979641      subj40 item29      Fast
## 1903  42.4579294      subj40 item31      Fast
## 1905  45.2648758      subj40 item33      Fast
## 1907  30.7879707      subj40 item35      Fast
## 1909  36.2297577      subj40 item37      Fast
## 1911  17.6320705      subj40 item39      Fast
## 1913  34.0361270      subj40 item41      Fast
## 1915  27.5696551      subj40 item43      Fast
## 1917  37.1656295      subj40 item45      Fast
## 1919  20.3792918      subj40 item47      Fast
## 1922  27.2386425      subj41  item2      Fast
## 1924  -2.6405702      subj41  item4      Fast
## 1926  41.1121914      subj41  item6      Fast
## 1928  14.4679563      subj41  item8      Fast
## 1930  19.9592747      subj41 item10      Fast
## 1932  34.8328033      subj41 item12      Fast
## 1934  14.3492343      subj41 item14      Fast
## 1936  35.5805132      subj41 item16      Fast
## 1938  24.7712827      subj41 item18      Fast
## 1940  33.0904333      subj41 item20      Fast
## 1942  15.1378433      subj41 item22      Fast
## 1944  11.0357971      subj41 item24      Fast
## 1946  16.2643764      subj41 item26      Fast
## 1948  24.8526776      subj41 item28      Fast
## 1950  20.2443177      subj41 item30      Fast
## 1952  25.1099075      subj41 item32      Fast
## 1954  35.2326599      subj41 item34      Fast
## 1956  39.1309401      subj41 item36      Fast
## 1958  11.5240763      subj41 item38      Fast
## 1960  20.2072879      subj41 item40      Fast
## 1962  28.2955360      subj41 item42      Fast
## 1964  29.4320310      subj41 item44      Fast
## 1966  38.8466417      subj41 item46      Fast
## 1968  18.4416454      subj41 item48      Fast
## 1969  31.9187503      subj42  item1      Fast
## 1971  16.9005853      subj42  item3      Fast
## 1973  36.8502491      subj42  item5      Fast
## 1975  36.0866156      subj42  item7      Fast
## 1977  32.8564448      subj42  item9      Fast
## 1979  32.1450830      subj42 item11      Fast
## 1981  23.3102180      subj42 item13      Fast
## 1983  13.6707902      subj42 item15      Fast
## 1985  34.3089809      subj42 item17      Fast
## 1987  25.6408696      subj42 item19      Fast
## 1989  30.8855847      subj42 item21      Fast
## 1991  43.5634178      subj42 item23      Fast
## 1993  17.6455607      subj42 item25      Fast
## 1995  27.3348963      subj42 item27      Fast
## 1997  16.8609255      subj42 item29      Fast
## 1999  32.6613305      subj42 item31      Fast
## 2001  45.7474358      subj42 item33      Fast
## 2003  35.9174429      subj42 item35      Fast
## 2005  34.6730007      subj42 item37      Fast
## 2007  18.5995947      subj42 item39      Fast
## 2009  42.1578329      subj42 item41      Fast
## 2011  17.5943085      subj42 item43      Fast
## 2013  37.1168327      subj42 item45      Fast
## 2015  26.9330195      subj42 item47      Fast
## 2018  30.2324184      subj43  item2      Fast
## 2020  17.7898245      subj43  item4      Fast
## 2022  35.1570903      subj43  item6      Fast
## 2024  24.4178847      subj43  item8      Fast
## 2026  30.8865206      subj43 item10      Fast
## 2028  35.7594334      subj43 item12      Fast
## 2030  27.9797114      subj43 item14      Fast
## 2032  31.8338472      subj43 item16      Fast
## 2034  31.4548309      subj43 item18      Fast
## 2036  30.4598953      subj43 item20      Fast
## 2038  44.2248950      subj43 item22      Fast
## 2040  27.6872032      subj43 item24      Fast
## 2042  15.4042881      subj43 item26      Fast
## 2044  35.4393990      subj43 item28      Fast
## 2046  28.1889415      subj43 item30      Fast
## 2048  24.0769111      subj43 item32      Fast
## 2050  26.9726672      subj43 item34      Fast
## 2052  24.8310572      subj43 item36      Fast
## 2054  43.7642575      subj43 item38      Fast
## 2056  20.0067910      subj43 item40      Fast
## 2058  30.9538917      subj43 item42      Fast
## 2060  30.7284403      subj43 item44      Fast
## 2062  42.0046518      subj43 item46      Fast
## 2064  20.0779636      subj43 item48      Fast
## 2065  45.8627204      subj44  item1      Fast
## 2067  29.2078560      subj44  item3      Fast
## 2069  54.1858506      subj44  item5      Fast
## 2071  17.1598325      subj44  item7      Fast
## 2073  44.8146835      subj44  item9      Fast
## 2075  25.4783809      subj44 item11      Fast
## 2077  25.6168907      subj44 item13      Fast
## 2079  35.1834169      subj44 item15      Fast
## 2081  46.7898592      subj44 item17      Fast
## 2083  34.9901644      subj44 item19      Fast
## 2085  32.0703569      subj44 item21      Fast
## 2087  30.4407743      subj44 item23      Fast
## 2089  49.2123430      subj44 item25      Fast
## 2091  36.8078310      subj44 item27      Fast
## 2093  13.8481584      subj44 item29      Fast
## 2095  38.9649507      subj44 item31      Fast
## 2097  41.6562410      subj44 item33      Fast
## 2099  48.8887187      subj44 item35      Fast
## 2101  50.0916430      subj44 item37      Fast
## 2103  35.0659161      subj44 item39      Fast
## 2105  35.2623560      subj44 item41      Fast
## 2107  32.7838509      subj44 item43      Fast
## 2109  26.7482496      subj44 item45      Fast
## 2111  24.0398871      subj44 item47      Fast
## 2114  31.4253407      subj45  item2      Fast
## 2116  15.3074343      subj45  item4      Fast
## 2118  38.8729819      subj45  item6      Fast
## 2120  43.3193699      subj45  item8      Fast
## 2122  33.5179986      subj45 item10      Fast
## 2124  35.0986932      subj45 item12      Fast
## 2126  17.7345160      subj45 item14      Fast
## 2128  34.1863246      subj45 item16      Fast
## 2130  23.0452545      subj45 item18      Fast
## 2132  31.4608783      subj45 item20      Fast
## 2134  21.6887699      subj45 item22      Fast
## 2136  27.4431842      subj45 item24      Fast
## 2138  37.9579933      subj45 item26      Fast
## 2140  36.5816890      subj45 item28      Fast
## 2142  24.6584695      subj45 item30      Fast
## 2144  35.2800369      subj45 item32      Fast
## 2146  31.1483373      subj45 item34      Fast
## 2148  24.4042133      subj45 item36      Fast
## 2150  35.8223470      subj45 item38      Fast
## 2152   5.8657245      subj45 item40      Fast
## 2154  29.8173336      subj45 item42      Fast
## 2156  18.8499116      subj45 item44      Fast
## 2158  32.3473326      subj45 item46      Fast
## 2160  14.8714704      subj45 item48      Fast
## 2161  31.5091138      subj46  item1      Fast
## 2163  49.1860198      subj46  item3      Fast
## 2165  48.6001874      subj46  item5      Fast
## 2167  40.7062983      subj46  item7      Fast
## 2169  36.8891372      subj46  item9      Fast
## 2171  41.4965246      subj46 item11      Fast
## 2173  14.2369104      subj46 item13      Fast
## 2175  21.3739440      subj46 item15      Fast
## 2177  47.5224402      subj46 item17      Fast
## 2179  26.7114178      subj46 item19      Fast
## 2181  49.4516006      subj46 item21      Fast
## 2183  31.7621753      subj46 item23      Fast
## 2185  41.6146238      subj46 item25      Fast
## 2187  25.1278764      subj46 item27      Fast
## 2189  30.4363700      subj46 item29      Fast
## 2191  34.7900405      subj46 item31      Fast
## 2193  51.5826383      subj46 item33      Fast
## 2195  38.3543394      subj46 item35      Fast
## 2197  64.3938996      subj46 item37      Fast
## 2199  41.3891456      subj46 item39      Fast
## 2201  42.4467040      subj46 item41      Fast
## 2203  27.1507827      subj46 item43      Fast
## 2205  19.8466204      subj46 item45      Fast
## 2207  26.9730248      subj46 item47      Fast
## 2210  34.0930314      subj47  item2      Fast
## 2212  23.2771781      subj47  item4      Fast
## 2214  31.0116393      subj47  item6      Fast
## 2216  15.3680023      subj47  item8      Fast
## 2218  40.2423112      subj47 item10      Fast
## 2220  29.3251567      subj47 item12      Fast
## 2222  37.4419171      subj47 item14      Fast
## 2224  36.3116080      subj47 item16      Fast
## 2226  24.7328672      subj47 item18      Fast
## 2228  29.5092091      subj47 item20      Fast
## 2230  33.3570588      subj47 item22      Fast
## 2232  43.1240986      subj47 item24      Fast
## 2234  18.9981360      subj47 item26      Fast
## 2236  42.7849996      subj47 item28      Fast
## 2238  26.1800121      subj47 item30      Fast
## 2240  28.0043117      subj47 item32      Fast
## 2242  39.8343780      subj47 item34      Fast
## 2244  32.3005631      subj47 item36      Fast
## 2246  20.3390801      subj47 item38      Fast
## 2248  16.9638306      subj47 item40      Fast
## 2250  32.0269211      subj47 item42      Fast
## 2252  11.4996289      subj47 item44      Fast
## 2254  43.1572382      subj47 item46      Fast
## 2256   8.5504593      subj47 item48      Fast
## 2257  25.9828082      subj48  item1      Fast
## 2259  17.0512401      subj48  item3      Fast
## 2261  28.6968239      subj48  item5      Fast
## 2263  20.5069729      subj48  item7      Fast
## 2265  20.6526363      subj48  item9      Fast
## 2267  15.6773027      subj48 item11      Fast
## 2269  16.0045289      subj48 item13      Fast
## 2271  15.7180641      subj48 item15      Fast
## 2273  19.1758697      subj48 item17      Fast
## 2275  23.6661886      subj48 item19      Fast
## 2277  25.7492534      subj48 item21      Fast
## 2279  12.4980301      subj48 item23      Fast
## 2281  19.5647234      subj48 item25      Fast
## 2283  14.8144273      subj48 item27      Fast
## 2285   3.4446468      subj48 item29      Fast
## 2287  21.1210974      subj48 item31      Fast
## 2289  27.1370678      subj48 item33      Fast
## 2291  21.7887120      subj48 item35      Fast
## 2293  29.6468192      subj48 item37      Fast
## 2295  -0.5659601      subj48 item39      Fast
## 2297  18.4791899      subj48 item41      Fast
## 2299  20.0346876      subj48 item43      Fast
## 2301  17.7856395      subj48 item45      Fast
## 2303  15.0659636      subj48 item47      Fast

Looking at data

Using the pipe %>% to combine functions

my_data %>%
  first_do(args) %>%
  then_do(args)
my_data %>%
  subset(Condition=="Fast") %>%
  head()
##         VOT Participant   Item Condition
## 2  39.11875       subj1  item2      Fast
## 4  30.46931       subj1  item4      Fast
## 6  37.17107       subj1  item6      Fast
## 8  46.98071       subj1  item8      Fast
## 10 28.47370       subj1 item10      Fast
## 12 38.35844       subj1 item12      Fast

Tidyverse: A word

“The tidyverse is an opinionated collection of R packages designed for data science. All packages share an underlying design philosophy, grammar, and data structures.” www.tidyverse.org

  • Changed the game of R coding

  • Much more intuitive syntax (IMHO); more “english-like”

  • BUT not everyone likes it. Sometimes makes things easier, sometimes makes things more complicated.

  • We’ll be using both

  • Core packages of the tidyverse: ggplot2, dplyr, tidyr, readr, stringr…

  • “The pipe is syntactic sugar” - Hadley Wickham

📝 Exercise 3

  1. Ensure simulated_vot_data.csv is saved in your R Project folder
  2. Add and run the following code to your R script:
# Load data ----
vot <- read.csv("simulated_vot_data.csv")

# Explore data ----
head(vot) 
tail(vot)
str(vot) 
names(vot) 
summary(vot) 
nrow(vot) 
View(vot) 

Rmarkdown

Essential parts of any R Markdown document

Essential parts of any R Markdown document

For today, we will only bother learning to edit text and code chunks.

We’ll learn about editing the YAML and chunk options another day.

R Markdown: Text in Markdown syntax

Markdown

Markdown: set of conventions for editing plain text.

Write as you normally would in a text editor or word processor, but you signal text formatting with certain characters (next slide).

Markdown (which is distinguished from markUP language) is designed to be

  • easy to read
  • easy to write
  • easy to learn

Markdown syntax

Markdown syntax

Tables written like this:

First Header  | Second Header
------------- | -------------
Content Cell  | Content Cell
Content Cell  | Content Cell
  • See Tables Generator website
  • See remedy and beautifyR R packages/RStudio addins for dealing with markdown tables
  • Data frames can be turned into tables without manual modification
    • See kable and flextable R packages

R Markdown: R code in code chunks

Code chunks

  • Chunks are sections that will include R code. By setting defaults at the beginning of your document, you can specify what you want most of your chunks to do.
  • In each chunk, you can specify options in the form tag=value in the chunk header.
    • Example: echo=TRUE: code will print verbatim in the output.
    • For now, don’t worry about editing the header!
  • Within a chunk: regular R code!

Code chunks

Insert a new R chunk by

  • Typing Alt + Cmd/Ctrl + i OR
  • Clicking Code >> Insert Chunk from the R Studio menu

Inline R code

You can include R code as inline R code, embedded in to the text.



The value of mean(vot$VOT) will print in the output.

📝 Exercise 4

Make a new R Markdown document!

Title it something useful

Save it in your project folder (01_c4s_rmd.Rmd)

📝 Exercise 5

  1. Delete everything after Line 12.
  2. Add a new header
  3. Add some plain text
  4. Add some bold text
  5. Add a code chunk that includes 1x <- 5andx`
  6. Compile! (“Knit”): Cmd/Ctrl + K or with Knit button

📝 Exercise 6

  • Copy the code from your helper.R script to your R Markdown document.
  • Compile again!
  • Let’s diagnose our errors!

Note: It is also possible to source an R script into an R Markdown document. This is much more helpful for manuscript writing… more on this another day!

Getting unstuck

Googling errors as art form

  • Google your errors!
  • Google “how to use XX package in r”
  • Search Twitter (#rstats)

Read the documentation

  • Type ??function in the console
  • Google the package name online
  • R Studio cheat sheets

Schedule for the rest of the term

Date Time Location Topic
2/25 4pm Cary Hall 42 Intro to group + RStudio
3/10 4pm Cary Hall 135 Intro to R + R Markdown
3/24 4pm Cary Hall 135 Cleaning + manipulating data
4/7 4pm Cary Hall 135 Data visualizations
4/21 4pm Cary Hall 135 Praat?
5/5 4pm Cary Hall 135 Praat?

Resources: Intro to R

Resources: RMarkdown