I did a search on www.rseek.org to look for the function to test if a
vector is ordered or not. But I don't find it. Could somebody let me
know what function I should use?
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
On Dec 9, 2009, at 10:10 PM, Peng Yu wrote:
I did a search on www.rseek.org to look for the function to test if a
vector is ordered or not. But I don't find it. Could somebody let me
know what function I should use?
If by ordered, you mean sorted, then ?is.unsorted
is.unsorted(c(1, 4, 2,
Try
all(diff(order(yourVector)) == 1)
On Wed, Dec 9, 2009 at 10:10 PM, Peng Yu pengyu...@gmail.com wrote:
I did a search on www.rseek.org to look for the function to test if a
vector is ordered or not. But I don't find it. Could somebody let me
know what function I should use?
3 matches
Mail list logo