Saatnya kita bermain dengan Grafik

Line Chart Satu Variabel

Membuat variabel jumlah mobil

mobil <- c(1, 3, 6, 4, 9,4,11,23,44)
plot(mobil)

Membuat Grafik garis,buble, title

plot(mobil, type="o", col="blue")
title(main="Jumlah Otomotif", col.main="red", font.main=4)

cars <- c(1, 3, 6, 4, 9,4,11,23,44)
trucks <- c(2, 5, 4, 5, 12,4,34,18,9)
plot(cars, type="o", col="blue", ylim=c(0,50))
lines(trucks, type="o", pch=22, lty=2, col="red")
title(main="Autos", col.main="red", font.main=4)

mobil <- c(1, 3, 6, 4, 9)
barplot(mobil)

barplot(mobil, main="Cars", xlab="Days",names.arg=c("Sen","Sel","Rab","Kam","Jum"))

Membuat variabel antar dengan 5 nilai

antar <- c(4,4,6,6,16)

Membuat grafik histogram dengan fungsi hist

hist(antar)

Membuat variabel vector cars dengan 5 nilai

cars <- c(1, 3, 6, 4, 9)
pie(cars, main="Automobile", col=rainbow(length(cars)),labels=c("Toyota","Honda","Isuzu","Fiat","BMW"))

aswin.januarsjaf@gmail.com