data <- matrix(scan(),ncol=3,byrow=TRUE) 1 1 42.5 1 1 43.3 1 1 42.9 1 2 42.2 1 2 41.4 1 2 41.8 2 3 48.0 2 3 44.6 2 3 43.7 2 4 42.0 2 4 42.8 2 4 42.8 3 5 41.7 3 5 43.4 3 5 42.5 3 6 40.6 3 6 41.8 3 6 41.8 data table77 <- data.frame(data) colnames(table77) <- c("day","run","glucose") rm(data) table77$day <- as.factor(table77$day) table77$run <- as.factor(table77$run) aov(glucose ~ day + Error(day/run), data = table77) # or instead use aov(glucose ~ day + run %in% day, data = table77)