【发布时间】:2020-12-18 22:49:40
【问题描述】:
图像是 5 行和两个我想要绘制的变量,下面是我正在使用的代码。
第二张图片显示结果
#histogram plot
Pwill1 <- ggplot(AvgPWill, aes(Segment))+geom_histogram()
#Structure of AvgPWill
str(AvgPWill)
'data.frame': 5 obs. of 2 variables:
$ Segment: chr "Costcutter" "Innovator" "Mercedes" "Workhorse" ...
$ Values : num 2084 3595 4695 2994 3422
我不熟悉绘图功能,但我尝试了这个并收到此错误:
plot(AvgPWill$Segment, AvgPWill$Values)
plot.window(...) 中的错误:需要有限的“xlim”值
另外:警告消息:
1:在 xy.coords(x, y, xlabel, ylabel, log) 中:强制引入的 NA
2:在 min(x) 中:min 没有非缺失参数;返回 Inf
3:在 max(x) 中:max 没有非缺失参数;返回 -Inf
【问题讨论】:
-
或许可以试试
plot(Pwill1) -
试试
Pwill1 <- ggplot(AvgPWill, aes(Values))+geom_histogram() -
仍然是一个使用 Pwill1 的列表
-
qplot(AvgPWill$Segment, AvgPWill$Values) 创建了一个图,但我似乎无法超越做这个散点图
-
那行得通@Dave2e。我想将其标记为答案。感谢您对该答案和编辑的帮助。我对 Stack Overflow 还是比较陌生