How to Histogram with relative frequency in R?data = read.table(infilename, sep="\t", fill=FALSE, strip.white=TRUE, head=T)here data$V2 is your data> h<-hist(data$V2, plot=F)> h$counts <- h$counts / sum(h$counts)> plot(h, freq=TRUE, ylab="Relative Frequency")> plot(h, freq=TRUE, ylab="Relative Frequency",ylim=c(0.0,1.0),xlim=c(0.0,1.0))
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.