相关疑难解决方法(0)

R:stat_smooth组(x轴)

我有一个数据库,想要使用stat_smooth显示一个数字.

我可以显示avg_time vs Scored_Probabilities数字,如下所示:

c <- ggplot(dataset1, aes(x=Avg.time, y=Scored.Probabilities))
c + stat_smooth()
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

但是当将Avg.time更改为时间或Age时,会发生错误:

c <- ggplot(dataset1, aes(x=Age, y=Scored.Probabilities))
c + stat_smooth()
error: geom_smooth: Only one unique x value each group. Maybe you want aes(group = 1)?
Run Code Online (Sandbox Code Playgroud)

我该怎么办呢?

r smooth stat ggplot2

8
推荐指数
1
解决办法
6937
查看次数

标签 统计

ggplot2 ×1

r ×1

smooth ×1

stat ×1