### Fitch, W. Tecumseh (2000), "Skull dimensions in relation to body size in nonhuman mammals: The causal bases for acoustic allometry," Zoology, 103, 40-58. install.packages("Stat2Data") library(Stat2Data) data(Fitch) # use data function to load Fitch Fitch # Species Order Wt Skull Palate #1 Coyote Carnivora 14.500 19.70 9.47 #2 Grizzly bear Carnivora 306.000 41.10 20.30 #3 Wolverine Carnivora 15.000 16.70 8.24 #4 Lion Carnivora 175.000 37.40 18.10 #5 Leopard Carnivora 50.300 22.60 9.41 #6 Gray Wolf Carnivora 33.000 27.80 13.60 #7 Kit fox Carnivora 1.820 11.39 5.78 #8 Fennec Fox Carnivora 1.250 8.86 4.25 #9 Tiger Carnivora 113.000 32.70 15.20 #10 Jaguar Carnivora 89.000 26.20 10.98 #11 Cougar Carnivora 70.900 21.30 8.40 #12 Maned wolf Carnivora 23.800 22.70 10.78 #13 Fisher Carnivora 6.800 13.06 6.29 #14 Leopard seal Carnivora 270.000 28.60 12.60 #15 Gorilla Primates 170.000 30.80 11.82 #16 Baboon Primates 32.500 16.70 7.31 #17 Mouse lemur Primates 0.070 3.19 1.33 #18 Bush-baby Primates 0.210 4.45 1.59 #19 Capuhcin Primates 2.200 9.80 3.55 #20 Black howler Primates 6.700 12.88 4.89 #21 Macaque Primates 3.820 10.90 4.53 #22 Proboscis monkey Primates 14.000 12.16 4.54 #23 Orangutan Primates 54.400 23.95 10.30 #24 Dwarf lemur Primates 0.389 5.68 2.44 #25 Avahi Primates 0.900 5.44 1.50 #26 Sportive lemur Primates 0.700 4.94 1.73 #27 Potto Primates 1.200 6.36 2.25 #28 Monk saki Primates 1.200 8.95 3.30 #### first a simple plot plot(Fitch$Skull,Fitch$Palate,pch=c(rep(17,14),rep(19,14)),col=c(rep("darkred",14),rep("darkgreen",14))) ### OR USING with with(Fitch,plot(Skull,Palate,pch=c(rep(17,14),rep(19,14)),col=c(rep("darkred",14),rep("darkgreen",14)))) legend("topleft",inset=0.05,pch=c(17,19),col=c("darkred","darkgreen"),legend=c("Carnivores","Primates"),text.col=c("darkred","darkgreen")) #### Now using Grammar of Graphics library(ggplot2) ggplot(Fitch, aes(x=Skull, y=Palate)) + geom_point() + geom_smooth(method=lm, aes(fill=Order))