Make Frequency Histogram for Factor Variables

后端 未结 6 1441
野趣味
野趣味 2020-12-01 03:15

I am very new to R, so I apologize for such a basic question. I spent an hour googling this issue, but couldn\'t find a solution.

Say I have some categorical data in

6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-01 04:15

    Data as factor can be used as input to the plot function.

    An answer to a similar question has been given here: https://stat.ethz.ch/pipermail/r-help/2010-December/261873.html

     x=sample(c("Richard", "Minnie", "Albert", "Helen", "Joe", "Kingston"),  
     50, replace=T)
     x=as.factor(x)
     plot(x)
    

提交回复
热议问题