Displaying 2 results from an estimated 2 matches for "rankvar".
Did you mean:
randvar
2007 Nov 30
2
using color coded colorbars for bar plots
Hello R Fundi,
The poetic title of this post is a request for help in regard to a
"simple" plotting question.
I have displayed the mean observations of a series variables using
barplot(). On the same figure I have colored the bars to represent the
Standard deviation of each variable using color.scale(). Now I wish to
add a graduated colorbar (legend) that corresponds to the colors
2011 Oct 21
1
replicating SAS's "proc rank" procedure
Hi try this function ive written
it should be self explantory but let me know if you have any problems.
I've only been using R for a few eeeks so apologies if its not the most
efficient!
rankit2<-function(rankvar,cuts,data,factor) {
ranker<-rankvar
ranker<-0
range<-c(1:cuts)
range2<-range/cuts
range3<-quantile(factor,range2)
over<-length(factor)
for (i in 1:over){
for (j in 1:cuts) {
if (data[[i,1]]<=range3[[j]])
{data[[i,3]]<-j
##test<-j
##print(j)
}
if (data[[i,3]]>0)...