How do you use hist to plot relative frequencies in R?

前端 未结 5 1991
抹茶落季
抹茶落季 2020-12-31 07:13

How do you use hist() to plot relative frequencies in R?

If I do the following, I will get a density plot, but I want a relative frequency plot:

a &l         


        
5条回答
  •  孤城傲影
    2020-12-31 07:24

    you can try using the histogram() function in lattice

    a <- c(0,0,0,1,1,2)
    library(lattice)
    histogram(a)
    

    defaults to percent.

提交回复
热议问题