#read data
data=read.csv("edited_life_history_data.csv")
head(data)
life.history <- read.csv("edited_life_history_data.csv")
dose <- factor(c("1 Gy", "2 Gy", "4 Gy", "5.5 Gy", "Sham"))
dose <- relevel(dose, "Sham")
head(life.history)
colnames(life.history)[1]="Group"
life.history$dose = relevel(life.history$Group,"Sham")
lh <- data.frame(life.history$Average.Egg.Size..LxW.,
life.history$Early.Life.Hatching.Success....hatched., life.history$Early.Life.Hatchling.vigor..days.survived. without.food.,
life.history$Total.Reproductive.Rate)
log.lh <- log(lh)
lh.dose <- life.history[, "Group"]
lh.pca <-prcomp(na.omit(log.lh,
center =TRUE,
scale. =TRUE))
summary(lh.pca)
Importance of components:
PC1 PC2 PC3 PC4
Standard deviation 0.7780 0.25380 0.19543 0.11532