library(reshape2) DF = read.csv('../../Data/ASCII_Comma/Chapter_10/windspeed.txt', quote='\'', header=FALSE) colnames(DF) = c('City', sprintf('Year%d', seq(37))) DF_melt = melt(DF, id.vars=c('City'), variable.name='Year', value.name='Speed') fit = aov(Speed ~ City * Year, data=DF_melt) print(summary(fit)) fit = aov(Speed ~ City + Year, data=DF_melt) print(summary(fit))