Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- scatter_compare2 = function(
- df,
- col1, col2,
- pch = 3,
- legend = c(col1,col2),
- label_col = 0,
- xlab = col1, ylab = col2
- ) {
- xlim = c( get_lim(c(df[,col1],df[,col2])) )
- ylim = c( get_lim(c(df[,col1],df[,col2])) )
- plot(
- df[,col1], df[,col2],
- xlab = xlab, ylab = ylab,
- xlim = xlim, ylim = ylim
- )
- abline( a = 0, b = 1 )
- if ( label_col != 0 ) {
- library(plotrix)
- outliers = df[ abs( df[,col1] - df[,col2] ) > 15, ]
- thigmophobe.labels( outliers[,col1], outliers[,col2], outliers[,
- label_col], col = 1 )
- }
- }
Add Comment
Please, Sign In to add comment