How to plot one variable in ggplot?

前端 未结 5 1792
孤独总比滥情好
孤独总比滥情好 2020-12-23 16:48

I\'m searching but still can\'t find an answer to a quite simple question - how can we produce a simple dot plot of one variable with ggplot2 in R?

with plot<

5条回答
  •  时光说笑
    2020-12-23 17:02

    You can manually create an index vector with seq_along.

    library(ggplot2)
    
    qplot(seq_along(iris$Sepal.Length), iris$Sepal.Length)
    

    enter image description here

提交回复
热议问题