我有代码创建一个boxplot,使用R中的ggplot,我想用年份和Battle标记我的异常值.
这是我创建箱图的代码
require(ggplot2)
ggplot(seabattle, aes(x=PortugesOutcome,y=RatioPort2Dutch ),xlim="OutCome",
y="Ratio of Portuguese to Dutch/British ships") +
geom_boxplot(outlier.size=2,outlier.colour="green") +
stat_summary(fun.y="mean", geom = "point", shape=23, size =3, fill="pink") +
ggtitle("Portugese Sea Battles")
Run Code Online (Sandbox Code Playgroud)
有人可以帮忙吗?我知道这是正确的,我只想标记异常值.