plot(ChickWeight$weight) plot(ChickWeight$Time,ChickWeight$weight) # grafico con punti a colori col1<-c("red", "green", "blue", "yellow") plot(ChickWeight$Time,ChickWeight$weight, main="Weight by Time", xlab="Time", ylab="Weight", col = col1[ChickWeight$Diet]) legend("topleft", title="Diet", cex = 0.8, legend=levels(ChickWeight$Diet), fill = col1) # grafico con diversi simboli punti<-c(0,1,2,6) plot(ChickWeight$Time,ChickWeight$weight, main="Weight by Time", xlab="Time", ylab="Weight", pch = punti[ChickWeight$Diet]) legend("topleft", title="Diet", cex = 0.8, legend=levels(ChickWeight$Diet), pch=punti)