r program. Draw the histogram of the eruption waiting periods in 'faithful '.

#1
Code:
#head(faithful)
vct <- faithful$waiting
#vct
#is.vector(vct)
range(vct)
cls.boundary <- seq(40,100,by=10)
#cls.boundary
cut.vct <- cut(vct,cls.boundary,right=FALSE)
#str(cut.vct)
freq<-table(cut.vct)
show<-cbind(freq)
#show
hist(show)
Is this right? The Y-axis(frequency) of the histogram is labeling as 0.0,0.5,1.0,1.5,2.0 but frequency of "show" ranges from 12 to 80. Is there a way to labeling The Y-axis(frequency) of the histogram from 10 to 80?
 
Last edited:

Dason

Ambassador to the humans
#2
The hist command takes in a vector and makes a histogram out of that univariate data. So what you're getting is a histogram of the frequencies which probably isn't what you want.

If you have the actual data you can instead just supply what you want the breakpoints for the histogram to be
Code:
hist(faithful$waiting, breaks = seq(40,100,by=10))