For a detailed overview of how to usetrimr, please see thevignettes.
A stable release oftrimris available onCRAN. To install this, use:
install.packages("trimr")You can also install the latest developmental version oftrimr. Please note, though, that this version is undergoingtesting and potentially has unidentified bugs. (If you do use thisversion and note a bug,please log it as anissue). To install the developmental version, you will first need toinstall thedevtools package and installtrimrdirectly from GitHub by using the following commands:
# install devtoolsinstall.packages("devtools")# install trimr from GitHubdevtools::install_github("JimGrange/trimr")trimr is an R package that implements most commonly-usedresponse time trimming methods, allowing the user to go from a raw datafile to a finalised data file ready for inferential statisticalanalysis.
The trimming functions available intrimr fall broadly intothree families:
The latter implements the methods first suggsted by Van Selst &Jolicoeur (1994).
In the example below, we go from a data frame containing data from 32participants (in total, 20,518 trials) to a trimmed data set showing themean trimmed RT for each experimental condition & participant usingthe modified recursive trimming procedure of Van Selst & Jolicoeur(1994):
# load trimr's librarylibrary(trimr)# load the example data that ships with trimrdata(exampleData)# look at the top of the example raw datahead(exampleData)#> participant condition rt accuracy#> 1 1 Switch 1660 1#> 2 1 Switch 913 1#> 3 1 Repeat 2312 1#> 4 1 Repeat 754 1#> 5 1 Switch 3394 1#> 6 1 Repeat 930 1# perform the trimmingtrimmedData<-modifiedRecursive(data = exampleData,minRT =150,digits =0)# look at the trimmedDatatrimmedData#> participant Switch Repeat#> 1 1 1047 717#> 2 10 779 647#> 3 11 1075 931#> 4 12 871 638#> 5 13 911 763#> 6 14 1014 799#> 7 15 1151 831#> 8 16 983 675#> 9 17 831 664#> 10 18 870 761#> 11 19 672 584#> 12 2 1118 1022#> 13 20 1035 718#> 14 21 807 680#> 15 22 1239 941#> 16 23 786 685#> 17 3 1020 793#> 18 4 1103 804#> 19 5 1184 916#> 20 6 1430 1123#> 21 7 994 851#> 22 8 1118 930#> 23 9 951 721#> 24 24 627 589#> 25 25 590 602#> 26 26 721 682#> 27 27 826 784#> 28 28 706 653#> 29 29 543 560#> 30 30 751 652#> 31 31 1080 977#> 32 32 686 634To install the package from GitHub, you need the devools package:
install.packages("devtools")library(devtools)Thentrimr can be directly installed:
devtools::install_github("JimGrange/trimr")Van Selst, M., & Jolicoeur, P. (1994). A solution to the effectof sample size on outlier elimination.Quarterly Journal ofExperimental Psychology, 47 (A), 631–650.