require(UsingR) #opens the functions and data of #the package UsingR data(kid.weights) X=kid.weights;str(X) pairs(X[ ,1:3] , col=X[ ,4], pch=20) ## BMI : body mass index attach(kid.weights) #allows to write height #instead of kid.weights$height... ht_in_m = height*2.54/100 # 2.54 cm per inch weight_in_kg = weight / 2.2046 # 2.2046 lbs. per kg bmi = weight_in_kg/ht_in_m^2 histogram(bmi) histogram(~bmi|gender) library(car) states=as.data.frame(state.x77[,c("Murder", "Population", "Illiteracy", "Income", "Frost")]) scatterplotMatrix(states,spread=T,pch=20,lty.smooth=2)