# importing data sp <- read.csv("/Users/deborah/Desktop/hhelianthoides.csv") # the data #sp$headId = identification number assigned to flower head #sp$row = which row of styles (1=bottom row) #sp$treatment = pollination treatment applied #sp$styleDate = date when styles emerged #sp$dateTreat = date when treatment was first applied #sp$styleShriv = whether styles were shriveled on first visit after treatment (0=no, 1-yes) #sp$dateShriv = date when styles were observed to have shriveled #sp$daysPerstLong = large estimate of how long styles persisted #sp$daysPerstAvg = middle estimate of how long styles persisted #sp$daysPerstShort = small estimate of how long styles persisted #sp$lastDayFlw = last day flower head put out anthers #sp$endShrivLong = large estimate of how many days styles persisted after last day of flowering (0=shriveled on last day) #sp$endShrivAvg = middle estimate of how many days styles persisted after last day of flowering #sp$endShrivShort = small estimate of how many days styles persisted after last day of flowering #sp$shrivNotes = notes about shriveling #sp$repollinated = date when pollination treatment was reapplied #sp$notes = other notes # checking the data file str(sp) #structure sp$headId levels(sp$treatment) # how many rows received each treatment table(sp$treatment) # how many rows do heads have hist(sp$row, breaks= 0:20) #histogram of "how many heads have a row with this number", not of total number of rows on each head # phenology #This is not a representative sample of the population. For my experiment, I selected heads that flowered later than most. # how do I make a bar graph? table(sp$styleDate) #how many rows of styles came out each day fs <- subset(sp, row == 1) table(fs$styleDate) #how many heads started flowering one day before table(fs$lastDayFlw) #how many heads finished flowering each day # subsets for each treatment sc <- subset(sp, treatment == "control") so <- subset(sp, treatment == "outcross") ss <- subset(sp, treatment == "self") # style persistence after treatment summary(sp$styleShriv) summary(sc$styleShriv) summary(so$styleShriv) summary(ss$styleShriv) #How do I compare three proportions in R? # length of style persistence summary(sp$daysPerstAvg) #overall hist(sp$daysPerstAvg, breaks= 0:18) summary(sc$daysPerstAvg) #control quartz() hist(sc$daysPerstAvg, breaks= 0:18) summary(so$daysPerstAvg) #outcross quartz() hist(so$daysPerstAvg, breaks= 0:18) summary(ss$daysPerstAvg) #self quartz() hist(ss$daysPerstAvg, breaks= 0:18) summary(aov(sp$daysPerstAvg~sp$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately? # length of style persistence after last day of flowering summary(sp$endShrivAvg) #overall quartz() hist(sp$endShrivAvg, breaks= -12:12) summary(sc$endShrivAvg) #control quartz() hist(sc$endShrivAvg, breaks= -12:12) summary(so$endShrivAvg) #outcross quartz() hist(so$endShrivAvg, breaks= -12:12) summary(ss$endShrivAvg) #self quartz() hist(ss$endShrivAvg, breaks= -12:12) summary(aov(sp$endShrivAvg~sp$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately? # re-analysis excluding 23-Jul-11 # subsets excluding 23-Jul-11 rp <- subset(sp, dateTreat != "21-Jul-11") rc <- subset(sc, dateTreat != "21-Jul-11") ro <- subset(so, dateTreat != "21-Jul-11") rs <- subset(ss, dateTreat != "21-Jul-11") # style persistence after treatment summary(rp$styleShriv) summary(rc$styleShriv) summary(ro$styleShriv) summary(rs$styleShriv) #How do I compare three proportions in R? # length of style persistence summary(rp$daysPerstAvg) #overall quartz() hist(rp$daysPerstAvg, breaks= 0:15) summary(rc$daysPerstAvg) #control quartz() hist(rc$daysPerstAvg, breaks= 0:15) summary(ro$daysPerstAvg) #outcross quartz() hist(ro$daysPerstAvg, breaks= 0:15) summary(rs$daysPerstAvg) #self quartz() hist(rs$daysPerstAvg, breaks= 0:15) summary(aov(rp$daysPerstAvg~rp$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately? # length of style persistence after last day of flowering summary(rp$endShrivAvg) #overall quartz() hist(rp$endShrivAvg, breaks= -12:12) summary(rc$endShrivAvg) #control quartz() hist(rc$endShrivAvg, breaks= -12:12) summary(ro$endShrivAvg) #outcross quartz() hist(ro$endShrivAvg, breaks= -12:12) summary(rs$endShrivAvg) #self quartz() hist(rs$endShrivAvg, breaks= -12:12) summary(aov(rp$endShrivAvg~rp$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately? # analysis of first four rows only # subsets of first four rows only ep <- subset(sp, row < 5) ec <- subset(sc, row < 5) eo <- subset(so, row < 5) es <- subset(ss, row < 5) # style persistence after treatment summary(ep$styleShriv) summary(ec$styleShriv) summary(eo$styleShriv) summary(es$styleShriv) #How do I compare three proportions in R? # length of style persistence summary(ep$daysPerstAvg) #overall quartz() hist(ep$daysPerstAvg, breaks= 0:15) summary(ec$daysPerstAvg) #control quartz() hist(ec$daysPerstAvg, breaks= 0:15) summary(eo$daysPerstAvg) #outcross quartz() hist(eo$daysPerstAvg, breaks= 0:15) summary(es$daysPerstAvg) #self quartz() hist(es$daysPerstAvg, breaks= 0:15) summary(aov(ep$daysPerstAvg~ep$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately? # length of style persistence after last day of flowering summary(ep$endShrivAvg) #overall quartz() hist(ep$endShrivAvg, breaks= -12:5) summary(ec$endShrivAvg) #control quartz() hist(ec$endShrivAvg, breaks= -12:5) summary(eo$endShrivAvg) #outcross quartz() hist(eo$endShrivAvg, breaks= -12:5) summary(es$endShrivAvg) #self quartz() hist(es$endShrivAvg, breaks= -12:5) summary(aov(ep$endShrivAvg~ep$treatment)) #Can I add lines to show the high and low estimates, or should I just graph these separately?