############################################################## # # # A Script for the Analysis of: # # Echinacea pallida and Echinacea angustifolia # # reciprical crosses performed during the summer of 2011 # # # # Second Version # # # ############################################################## # # # @Author: Nicholas Goldsmith # # @Professor: Stuart Wagenius # # @Collaborators: # # @Date 2 August 2011 # # # ############################################################## # # # Table of Contents: # # 1) Importing the Data # # 2) The Data # # 3) Questions for the Data # # . Examining these questions, A through E # # # ############################################################## # 1) Importing the Data crossData <- read.csv("http://blog.lib.umn.edu/wage0005/echinacea/CSV_recip_Crosses.csv") # 2) The Data #crossData$Pallida = E. pallida ID (Ex. PAL1001) #crossData$Angustifolia = E. angustifolia ID (Ex. 18_967) #crossData$PalColor = color the bracts on E. pallida was painted (Ex. AQA) #crossData$PalColorDate = Date the E. pallida bracts were painted #crossData$PalNumBract = Number of E. pallida bracts painted #crossData$PalDateCross = Date the E. pallida was pollinated #crossData$PalnumCross = Number of styles pollinated #crossData$PalNumShrivel = Number of E. pallida styles that shriveled #crossData$PalPercentShrivel = Percentage of E. pallida styles that shriveled #crossData$PalComp = Compatability of the cross with E. pallida as the maternal plant with: 0 = incompatible, 1 = compatible, 99 = unsure #crossData$AngColor = color the bracts on E. angustifolia was painted (Ex. AQA) #crossData$AngColorDate = Date the E. angustifolia bracts were painted #crossData$AngNumBract = Number of E. angustifolia bracts painted #crossData$AngDateCross = Date the E. angustifolia was pollinated #crossData$AngnumCross = Number of styles pollinated #crossData$AngNumShrivel = Number of E. angustifolia styles that shriveled #crossData$AngPercentShrivel = Percentage of E. angustifolia styles that shriveled #crossData$AngComp = Compatability of the cross with E. angustifolia as the maternal plant with: 0 = incompatible, 1 = compatible, 99 = unsure # 3) Questions for the data # a. Does E. pallida cause shriveling in E. angustifolia? # a.a ) Does E. angustifolia cause shriveling in E. pallida? # b. Is there evidence of S alleles in common between the two species? # c. Is there are difference in compatability between the two species depending on which one is maternal/paternal? # d. Are certain E. pallida plants more likely to be compatible maternal plants than others? # e. Are certain E. pallida plants more likely to be compatible paternal plants than others? # A) Does E. pallida cause shriveling in E. angustifolia? windows() #Makes a window for the historgram hist(crossData$AngPercentShrivel, breaks=seq(0,100,by=((100)*(1/3))), xlab="Percent styles shriveling", main="Style shriveling in Echinacea angustifolia") #Histogram when E. angustolia is the maternal plant # A.a) Does E. angustifolia cause shriveling in E. pallida? windows() #Makes a window for the histogram hist(crossData$PalPercentShrivel, breaks=seq(0,100,by=((100)*(1/3))), xlab="Percent styles shriveling", main="Style shriveling in Echinacea pallida") #Histogram when E. pallida is the maternal plant # B) Is there evidence of S alleles in common between the two species? # The histograms showing the shriveling occurs also appears to show this, right? # C) Is there are difference in compatability between the two species depending on which one is maternal/paternal? crossPalSubset <- subset(crossData, PalComp != 99) crossAngSubset <- subset(crossData, AngComp != 99) #table(crossPalSubset$PalComp,crossAngSubset$AngComp) #chisq.test(table(crossPalSubset$PalComp,crossAngSubset$AngComp)) #In the following series of steps I will get the number of compatible and incompatible crosses for each species numPalComp <- subset (crossData, PalComp == 1) palAndComp = length(numPalComp$PalComp) numAngComp <- subset(crossData, AngComp == 1) angAndComp = length(numAngComp$AngComp) numPalIncomp <- subset (crossData, PalComp == 0) palAndIncomp = length(numPalIncomp$PalComp) numAngIncomp <- subset (crossData, AngComp == 0) angAndIncomp = length(numAngIncomp$AngComp) #constructing a matrix with this information compTable <- matrix (c(palAndComp, angAndComp, palAndIncomp, angAndIncomp), ncol=2, byrow=TRUE) rownames(compTable)<-c("Compatible", "Incompatible") colnames(compTable)<-c("E. pallida", "E. angustifolia") compTable #Performing the Chi Squared chisq.test(compTable) # D) Are certain E. pallida plants more likely to be compatible maternal plants than others? table(crossPalSubset$Pallida,crossPalSubset$PalComp) fisher.test(table(crossPalSubset$Pallida,crossPalSubset$PalComp)) # E) Are certain E. pallida plants more likely to be compatible paternal plants than others? table(crossAngSubset$Pallida,crossAngSubset$AngComp) fisher.test(table(crossAngSubset$Pallida,crossAngSubset$AngComp))