我有一个数据库,想要使用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)
我该怎么办呢?
如果我有这样的数据:
A B C
1 GM1 100
2 DOX 10
3 GM2 3
4 GM3 99
5 MY 62
6 GMPN 30
Run Code Online (Sandbox Code Playgroud)
我如何使用R let数据看起来像:(只选择包含"GM"数据)
A B C
1 GM1 100
3 GM2 3
4 GM3 99
Run Code Online (Sandbox Code Playgroud) 我有一个数据集看起来像:
classification Interest Age Gender
Card battle IL029 18-24 male
Card battle IL001 45-54 male
Card battle IL001 18-24 male
Card battle IL001 35-44 male
Card battle IL001 35-44 male
Card battle IL013 35-44 male
Run Code Online (Sandbox Code Playgroud)
如何在年龄栏中将“ 18-24”替换为20,将“ 35-44”替换为40,将“ 45-54”替换为50?