Ian wants to quantify the overlap of flowering time between all pairs of plants in his experiment. This following R script reads his file with the flowering schedule of all 31 plants in his experiment and writes a file called ianPhenPairs.csv that has the flowering schedule of every possible pair combination (one per line). Note that there is a separate record for each plant as a sire and dam.
# script ian.phenology.r
pp <- read.csv("https://echinaceaproject.org/wp-content/uploads/ian.phenology.final.csv")
str(pp)
p <- merge(pp,pp, by = NULL)
str(p)
31^2 == dim(p)[1]
write.csv(p, “ianPhenPairs.csv”, row.names = FALSE)
Leave a Reply