Hello, I have a matrix and I want to sample 20 rows that are the the percentiles of 0-100 in 0.05 increments. I have a vector of my sequence
(0, 0.05, 0.10, 0.15,....1.0) and also a normalised vector of rownumbers. That is, there are 234 rows (for example) so I do perc<-c(1:234/234) which looks like a bunch of numbers from 0 - 1. In Excel (which I try not to use at every possible occaison) you can use a VLOOKUP function to say choose the rows from the perc vector that are the closest match to the sequence vector - i.e. you can specify to choose the "closest" match, it doesn't have to be an exact match. In R, I'd normally use the grep command when I know it's an exact match. Does anyone know how to achieve this in R? Also, I've been getting heaps of help from everyone on this mailing list - if I reply to the respondent and R Help again, will it show up in the correct thread? I haven't been able to say thankyou as I wasn't sure it would show up in the thread. Thanks -- Gareth Campbell PhD Candidate The University of Auckland P +649 815 3670 M +6421 256 3511 E [EMAIL PROTECTED] [EMAIL PROTECTED] [[alternative HTML version deleted]] ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.