1. p = ggplot(diamonds, aes(carat,price, colour = cut))
p = p + layer(geom = "point",stat ="identity",position = "identity")
这个程序写出来系统不报错,但是也没有图案是为什么呢?哪里有错需要改吗?
2.params匹配问题,在以前版本里面分别命名了geom_params和stat_params,但是现在统一用params来代表,如果按照以前的方式来写,如下:
p <- p + layer(
geom = "bar",
geom_params = list(fill ="steelblue"),
stat = "bin",
position = "identity",
stat_params = list(binwidth = 0.5)
)
R会报错,“Error in layer(geom = "bar", geom_params = list(fill = "steelblue"), stat = "bin", : unused arguments (geom_params = list(fill ="steelblue"), stat_params = list(binwidth = 0.5))”
如果改成Params的话,他又会说你把一个参量和多个主题匹配
“Error in layer(geom = "bar", params = list(fill = "steelblue"), stat = "bin", : formal argument "params" matched by multiple actual arguments”
想问下大家是怎么解决这2个问题的呢?