Download as pdf or txt
Download as pdf or txt
You are on page 1of 15

Penyajian Data

Tim Statistika
Jurusan Peternakan
Fakultas Pertanian
Universitas Lampung
Type Of Data

Categorical Numerical
(Qualitative) (Quantitative)

Ordinal Nominal Discrete Continuous

1.Bar chart 1.Bar chart 1.Strip chart


2.Pie chart 2.Pie chart 2.Histogram
3.Pareto 3.Pareto 3.Index plot
diagram diagram 4.Box plot
4.Dot chart 4.Dot chart 5.Scatter plot
6.Stem
Strip chart
> data <- read.csv('rcd.csv', header=T)

> stripchart(data, method = "stack", xlab = "kg")


> stripchart(data, xlab = "kg")

bw
bw

breed
breed

0 5 10 15 20 25 30

kg
0 5 10 15 20 25 30

kg

> stripchart(data, method = "jitter", xlab = "kg")


Histogram

> hist(data$bw, col=c("red", "yellow","blue","violet","tomato"))


> plot(data$bw, type="h")
Index plot > plot(data$bw, type="p")
Box plot

> boxplot(data$bw, col=c("blue"))


>boxplot(bw~breed,
col=c("blue","red","green"),
Maximum ylab="Bobot lahir (kg)",xlab="Jenis
(32)
75th percentile sapi",data=data)
(25)
Median
(22,56)

25th percentile Minimum


(19,25) (14)
Scatter plot
> x=c(4,7,8,5,9,14);y=c(13,16,18,15,19,22)
> a=data.frame(x,y)
> a
x y
1 4 13
2 7 16
3 8 18
4 5 15
5 9 19
6 14 22
> plot(x,y)
Line chart

v <- c(7,12,28,3,41)
t <- c(14,7,6,19,3)

plot(v,type = "o",col = "red",


xlab = "Month", ylab = "Rain fall",
main = "Rain fall chart")

lines(t, type = "o", col = "blue")

https://www.tutorialspoint.com/r/r_line_graphs.htm
Stem

> stem(data$bw)

The decimal point is 1 digit(s) to the right of the |

1 | 4
1 | 5899
2 | 0122334
2 | 5568
3 | 02
Table

> data <- read.csv('rcd2.csv', header=T)


> data
> tbl= table(data$breed)
> tbl #frekuensi

Bali Brahman Limosin Madura Ongole Simental


6 8 5 6 6 4
Bar plot
> barplot(prop.table(table(data$breed)), cex.names = 0.5)
Poreto diagram
> pareto.chart(table(data$breed), ylab = "Frequency")
Dot chart
> x = table(data$breed)
> dotchart(as.vector(x), labels = names(x))
Pie chart
> tbl=table(data$breed)
> lbl=paste("(", names(tbl),")", "\n", tbl, sep="")
> pie(tbl, labels=lbl, col=c("red", "yellow", "blue"))

You might also like