# Exercise answer 4.2 primate sperm concentration Hylobates_lar<-152.4 Gorilla_gorilla<-c(171,191,48.4,107.9,195.2) Pan_troglodytes<-c(548,608.8,391.1,258.3,142.9,274.5) Pan_paniscus<-456.1 Pongo_pygmaeus<-61 Homo_sapiens<-63.5 names<-list(Hylobates_lar,Gorilla_gorilla,Pan_troglodytes,Pan_paniscus,Pongo_pygmaeus,Homo_sapiens) samples<-lengths(names) sperm_conc<-matrix(nrow=length(names),ncol=max(lengths(names))) for(i in 1:6) sperm_conc[i,1:samples[i]]<-unlist(names[i]) sperm_conc ##### OR an alternative method L<-max(samples) length(Hylobates_lar)<-L length(Gorilla_gorilla)<-L length(Pan_troglodytes)<-L length(Pongo_pygmaeus)<-L length(Homo_sapiens)<-L ape_matrix<-rbind(Hylobates_lar, Gorilla_gorilla, Pan_troglodytes, Pongo_pygmaeus, Homo_sapiens) ape_matrix