kockaszamolo<-function(l){ s=c() for(i in 1:6){ s<-c(s,length(l[l==i])) } return(s) } ggplot(data=dd,aes(x=f))+geom_histogram(breaks=seq(80,120,0.5)) ggplot(dd, aes(x=a)) + stat_ecdf(colour = "blue", size=1,alpha=0.7) + stat_function(fun = pnorm, args = list(100, 3), colour = "red", size=1, alpha=0.7) PP<-function(data,column,dist,arglist){ ggplot(data, aes(x=column))+stat_ecdf(colour = "blue", size=1.2,alpha=0.8)+stat_function(fun = dist, args = arglist, colour = "red", size=1.2, alpha=0.8) } PP(dd,b,pnorm,list(100,9))