Distribuições


In [1]:
compras <- c(1,1,1,3,3,5,5,6,6,6,6,7,8,8,9,9,9,9,10,10,10,11,13,14,14,15,15,15,15)

In [3]:
# Histograma padrão:
hist(compras)



In [4]:
# Histograma com classes aproximadamente de igual amplitude: 
hist(compras, breaks = c(0,3,6,7,10,13,15), freq = TRUE)


Warning message in plot.histogram(r, freq = freq1, col = col, border = border, angle = angle, :
“the AREAS in the plot are wrong -- rather use 'freq = FALSE'”

Distribuição binomial


In [6]:
x <- dbinom(0:100,size=100,prob=0.5)
barplot(x)



In [ ]: