I am new to statistics and using Rstudio, so I really don't know much about anything :(
As mentioned in the question, I am trying to make a histogram in Rstudio without using the function hist() but using lines() in for loops.
counts = function(x,n) {
xs = cut(x, breaks=seq(min(x),max(x), length.out = n+1), right = FALSE)
ys = as.vector(table(xs))
}
return(ys)
}
So the above is the function that will create intervals of a vector x, and I have to create another function called histo() that will build the histogram without using hist().
I have tried using abline(), but that didn't work. Any suggestions please?