我需要在Rstudio中绘制一个直方图,其中我具有以下值:1 2 34。它们的频率分别为0.2 0.5 0.2 0.1。我该怎么办?
library(ggplot2)
df <- data.frame(points= c(1,2,3,4), data = c(0.2, 0.5, 0.2, 0.1))
ggplot(df, aes(x = points, y = data)) + geom_histogram(stat = "identity")
ggplot2
是一个程序包,它允许对图形和图形进行很多操作。