On Wed, 26 Aug 2009, Alistair Gee wrote:
If x is a vector (or data frame) that is in a particular order, and I
call split(x, f) to partition x, will the elements of each partition
remain in order?
They must for example( split ) to work as advertised, viz.
### Calculate z-scores by gr
ailto:r-help-boun...@r-project.org] On
Behalf Of Alistair Gee
Sent: Wednesday, August 26, 2009 4:41 PM
To: r-help@r-project.org
Subject: [R] Does split() preserve order?
If x is a vector (or data frame) that is in a particular order, and I
call split(x, f) to partition x, will the elements of ea
If x is a vector (or data frame) that is in a particular order, and I
call split(x, f) to partition x, will the elements of each partition
remain in order?
That is, is the following assertion always TRUE?
for(i in split(x, f)) {
stopifnot(!is.unsorted(i))
}
I suspect that this is the case, but
3 matches
Mail list logo