What is the difference between geoms and stats in ggplot2?

前端 未结 3 786
再見小時候
再見小時候 2020-12-24 08:57

Both geoms and stats can be used to make plots in the R package ggplot2, and they often give similar results (e.g., geom_area and stat_bin). They also often have slightly di

3条回答
  •  一整个雨季
    2020-12-24 09:32

    geom is for geometrical representation while stat is for statistical infos and representations. i think sometimes geom uses some stats functions such as stat_count() used by geom_bar(). in this case geom_bar takes one argument (x or y) and the stat_count takes in charge the counting of frequencies.

提交回复
热议问题