rawdata <- read.csv("F:/20170926_Comp2/20171106_Individuals_NewMeasurements.csv", sep=";", header=T) library("lattice") setwd("C:/PATH/TO/Horse_Domestication/TestPaedomorphicFeatures/") rawdata=read.table("INPUT.TXT.VERSION.OF.EXCEL.FILE.txt",header=T,sep="\t", stringsAsFactors=FALSE) data2=rawdata[which(!rawdata$Breed=="she"),] data=data2[which(!data2$Breed=="fab"),] she=rawdata[which(rawdata$Breed=="she"),] fab=rawdata[which(rawdata$Breed=="fab"),] #idxshe=which(rawdata$Breed=="she") #idxfab=which(rawdata$Breed=="fab") ######################### # Orbit versus skull length boxplot(data$Ratio.Skull.Orbit.~ data$AltAge, range=1,ylim=c(0.10,0.22),xlim=c(0,7), main="Eye vs skull length", xlab="Age class", ylab="ratio orbit/skull length") points(she$AltAge,she$Ratio.Skull.Orbit., cex=2,pch=5) points(fab$AltAge,fab$Ratio.Skull.Orbit., cex=2,pch=11) #bwplot(data$Ratio..Skull.Orbit.~ data$AltAge, horizontal = FALSE, panel=panel.violin) #bwplot(data$Ratio..Skull.Orbit.~ data$AltAge, horizontal = FALSE, panel=panel.stripplot) # Palate versus basicranium boxplot(data$Ratio.Endo.Snout.~ data$AltAge, range=1,ylim=c(0.40,0.8),xlim=c(0,7), main="basicranium vs palate", xlab="Age class", ylab="ratio braincase/snout length") points(she$AltAge,she$Ratio.Endo.Snout., cex=2,pch=5) points(fab$AltAge,fab$Ratio.Endo.Snout., cex=2,pch=11) #angles palate basicranium boxplot(data$Angle~ data$AltAge, range=1,ylim=c(150,180),xlim=c(0,7), main="angle basicranium vs palate", xlab="Age class", ylab="angle braincase, snout length") points(she$AltAge,she$Angle, cex=2,pch=5) points(fab$AltAge,fab$Angle, cex=2,pch=11) #skull length vs wither height adults=data[which(data$AltAge=="6"),] shead=she[which(she$AltAge=="6"),] fabad=fab[which(fab$AltAge=="6"),] plot(adults$Total_skull_length ~ adults$Wither_height, ylim=range(data2$Total_skull_length,na.rm = TRUE),xlim=range(data2$Wither_height,na.rm = TRUE),main="skull length vs wither height", xlab="wither height [cm]", ylab="skull length [cm]",cex=2) points(shead$Wither.height,shead$Total.skull.length, cex=2,pch=5) points(fabad$Wither.height,fabad$Total.skull.length, cex=2,pch=11) mylm<-lm(adults$Total.skull.length ~ adults$Wither.height) abline(mylm,col="red") install.packages("UsingR") library("USingR") X=simple.lm(na.omit(adults$Wither_height),na.omit(adults$Total_skull_length), show.residuals=FALSE, show.ci=TRUE, conf.level=0.95, pred=c(78,97)) #1 2 #24.60787 31.07772 #--> 78cm wither height, Falabella, should have 24 cm long skull, 97cm high Shetland-- 28 cm skull) #ratio skull lenght/wither height versus breed x=rbind(fabad,shead,adults[order(adults$Wither_height),]) x$Breed=factor(x$Breed,c("fab", "she" ,"exm", "wel" ,"mon", "kon" ,"bos" ,"huz" ,"scp" ,"ice" ,"hny" ,"arb", "grp", "grb", "lpz" ,"piz" ,"nor" ,"ano", "thb" ,"hun" ,"trk" ,"han" ,"odb", "suf" ,"kdr" ,"blg", "hol" ,"cds", "shi" ,"ind", "tog" ,"kos", "gbh" ,"ses" ,"pll" ,"bif" ,"stm")) boxplot(x$Total_skull_length/x$Wither_height~ x$Breed,boxwex=0.8, las=2) #bwplot(x$Total_skull_length/x$Wither_height~ x$Breed, panel=panel.stripplot, scales = list(x = list(rot = 90)))