Re: [R] Inserting percentile values in a data frame

2013-01-03 Thread Anthony Damico
it doesn't work because you're trying to save something of the wrong length into your data frame I used agr1$quantile <- quantile(agr1$cnt, probs=c(.50, .75, .90, .95, .99)) > # these two numbers should be the same nrow( agr1 ) length( agr1$quantile ) # these two numbers should be the same lengt

[R] Inserting percentile values in a data frame

2013-01-03 Thread ramoss
Hello I need to calculate and insert the values for the 50,75,90,95 & 99 percentiles in a data frame for each row. I used agr1$quantile <- quantile(agr1$cnt, probs=c(.50, .75, .90, .95, .99)) but that didn't work. How can calculate the percentile for my variable "cnt" , insert & name the percent