##################### Versión S-PLUS ################# id.plot <- function(lower.cut, upper.cut, objeto) { y <- data.frame(res1.std(objeto))[, 1] n <- length(y) plot((1:n), y, type = "n", ylab = " ", xlab = "n. observaciones") no.number <- (y > lower.cut) & (y < upper.cut) text((1:n)[no.number], y[no.number], "*") text((1:n)[y < lower.cut], y[y < lower.cut], label = (1:n)[y < lower.cut]) text((1:n)[y > upper.cut], y[y > upper.cut], label = (1:n)[y > upper.cut]) } ##################### Versión R ################# id.plot <- function(lower.cut, upper.cut, objeto) { y <- data.frame(res1.std(objeto))[, 1] n <- length(y) plot((1:n), y, type = "n", ylab = " ", xlab = "n. observaciones") abline(h=upper.cut,col="blue") abline(h=lower.cut,col="blue") no.number <- (y > lower.cut) & (y < upper.cut) text((1:n)[no.number], y[no.number], "*") if(sum(y < lower.cut)>0) text((1:n)[y < lower.cut], y[y < lower.cut], deparse((1:n)[y < lower.cut])) if(sum(y > upper.cut)>0) text((1:n)[y > upper.cut], y[y > upper.cut], deparse((1:n)[y > upper.cut])) }