Skip to content

R Statistical Programming

Adam Kimbler edited this page Aug 7, 2017 · 1 revision

Open a terminal window and type 'R' on the command line

Loading data:

data1 <- read.table("tenDollar_HmM_data.txt")

Changing to matrix:

data2 <- as.matrix(data1)

Changing to dataframe (for repeated measures anova):

data3 <- data.frame(HmM = as.vector(data2),subj=factor(rep(paste("subj",1:14,sep=""),3)),cond=factor(rep(c("avoid","neut","gain"),c(14,14,14))))

Running repeated measures anova:

summary(aov(HmM ~ cond + Error(subj/cond), data3