driving.Rdata
file.head( driving )
to look at the first few observationslsr
, psych
load( "~/Work/Research/Rbook/workshop_dsto/datasets/driving.Rdata")
head( driving )
library(lsr)
library(psych)
table()
to construct a tabulation of the distractor
varibletable()
to cross-tabulate distractor
by peak.hour
xtabs()
to cross-tabulate distractor
by peak.hour
describe
to get descriptives for all variables in driving
(this will produce some warnings!)summary
to get descriptives for all variables in driving
describeBy
to get descriptives separately depending on whether the tests were conducted in peak hour or not (this will produce some warnings!)aggregate
to calculate the mean number of errors in the first test (i.e. errors_time1
) broken down by peak.hour
and distractor
cor()
cor()
correlate()
to compute all pairwise correlations.