# Be sure to first change the working directory to your data directory tomato <- read.table("tomato.dat",header=T) tomato[tomato=="."]=NA tomato$entry <- factor(tomato$entry) tomato$tg430 <- ordered(tomato$tg430,c("A","H","B")) tomato$yr <- ordered(tomato$yr) tomato$mfwlog <- as.numeric(tomato$mfwlog) tomato1 <- tomato[tomato$yr==1&!is.na(tomato$mfwlog)&!is.na(tomato$tg430),] tomato.aov <- aov(mfwlog~tg430,tomato1) # reduce to complete data tomatos <- tomato[!(is.na(tomato$tg430)|is.na(tomato$mfwlog)),] dimnames(tomatos)[[1]]<- as.character(1:nrow(tomatos))