I have some data here [in a .txt file] which I read into a data frame df,
df <- read.table(\"data.txt\", header=T,sep=\"\\t\")
I remove
Another way to exclude outliers is to calculate them then set the y-limit on what you consider an outlier.
For example, if your upper and lower limits are Q3 + 1.5 IQR
and Q1 - 1.5 IQR
, then you may use:
upper.limit <- quantile(x)[4] + 1.5*IQR(x)
lower.limit <- quantile(x)[2] - 1.5*IQR(x)
Then put limits on the y-axis range:
ggplot + coord_cartesian(ylim=c(lower.limit, upper.limit))