Skip to content
Prev 12257 / 398502 Next

returning quartiles of a list?

Yep, that did it.  I can now do this kind of thing:

firsthalf <- function(v) {
  n <- length(v)
  return (v[1:(n/2)])
}

secondhalf <- function(v) {
  n <- length(v)
  return (v[((n%/%2)+1):n])
}

I'll need to write other functions for 1/3, etc., but that's fine.

thanks again!
greg
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._