Hi everyone,
I am using polar coordinate to present my data. Because of the presence of a few outliers, my graph has extremely wide y scale. If I use scale_y_continuous(limit=c(0,20000)), it will remove some data, see the warning:
Warning message:
Removed 3 rows containing non-finite values (stat_boxplot).
see the example:
##note the last value of value is far larger than the rest
value<-c(rnorm(19),5)
sample<-c("a","b","c","d")
data<-data.frame(sample,value)
library(ggplot2)
p<-ggplot(data)
##the scale is large to include the outlier in the graph
p+geom_boxplot(aes(x=sample,y=value))+coord_polar()
##if use scale_y_continuous(limit=c(-3,3)), there will be warning
p+geom_boxplot(aes(x=sample,y=value))+coord_polar()+scale_y_continuous(limit=c(-3,3))
Warning message:
Removed 1 rows containing non-finite values (stat_boxplot).
However, I cannot use coord_polar(ylim=c(-3,3)) as I would do in the cartesian coordinate.
p+geom_boxplot(aes(x=sample,y=value))+coord_polar()+coord_polar(ylim=c(-3,3))
Error in coord_polar(ylim = c(-3, 3)) : unused argument (ylim = c(-3, 3))
I am wondering if there is a similar solution as in cartesian coordinate, which is using coord_cartesian(ylim=c(0,20000))
I appreciate your help!
Aaron