Re: [R] Replace array with percentile values

2012-11-04 Thread William Dunlap
rank() would do it: > x <- c(1,2,2,2,2,3,4,4,5,5) > rank(x, ties="max")/length(x) * 100 [1] 10 50 50 50 50 60 80 80 100 100 as would ecdf() > ecdf(x)(x)*100 [1] 10 50 50 50 50 60 80 80 100 100 Bill Dunlap Spotfire, TIBCO Software wdunlap tibco.com > -Origina

Re: [R] Replace array with percentile values

2012-11-04 Thread David Winsemius
On Nov 4, 2012, at 7:22 PM, greggal...@gmail.com wrote: > Hi: > > I have an array of measurements, that I've been doing linear > regression model and AI models on. Because there are many errors and > the values are "ill-formed" I would like to copy the array, but > replace each value with the P