How to plot histogram/ frequency-count of a vector with ggplot?

前端 未结 3 1025
无人及你
无人及你 2020-12-19 01:34

I want to plot with ggplot the frequency of values from a numeric vector. With plot() is quite straight forward but I can\'t get the same resul

3条回答
  •  温柔的废话
    2020-12-19 02:13

    Please look at the help page ?geom_histogram. From the first example you may find that this works.

    qplot(as.factor(dice_results), geom="histogram")
    

    Also look at ?ggplot. You will find that the data has to be a data.frame

提交回复
热议问题