[R] Ranking correlation with R

David Winsemius dwinsemius at comcast.net
Fri Apr 9 18:39:57 CEST 2010


On Apr 9, 2010, at 12:14 PM, Joshua Wiley wrote:

> On Fri, Apr 9, 2010 at 8:58 AM, David Nemer <davidnemer at gmail.com>  
> wrote:
>> Hello Joshua,
>> Thanks for your help. The ranking list doesn't have numbers (it  
>> doesn't
>> matter the name of the file), just the file name, and the ranking  
>> is assumed
>> base on the position of the file name in the list (so the first  
>> filename to
>> appear is ranked number 1). So I guess I would just need to add the
>> filenames into a vector (array) for both rankings and then compare  
>> them.. is
>
> You would add both lists to vectors.
>
>> it right? And to compare them I would use cor() right?
>
> cor() requires numeric data.  To use it in this case, you would need
> to come up with rankings based on the position for each file name, and
> use those pairs of numbers with cor().

One possible source for such numbers would be row.names(dfrm) since by  
default (assuming they are in a data.frame) row.names are an ascending  
series of integers, but one could also number them by appending a  
colrankn=1:nrow(dfrm).

>
>> Cheers,
>> --
>> David Nemer
>
>
> -- 
> Joshua Wiley
> Senior in Psychology


David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list