Re: [R] Ranking correlation with R

2010-04-15 Thread Peter Ehlers
On 2010-04-14 16:04, David Nemer wrote: Hello Guys, thank you all very much for the help! Sorry for my total lack of knowledge in R... so I did the correlation.. and got these results: cor(A, C, method = "spearman") [1] 0.4922165 cor(B, C, method = "spearman") [1] 0.1922412 cor(A, B, method =

Re: [R] Ranking correlation with R

2010-04-14 Thread David Nemer
Hello Guys, thank you all very much for the help! Sorry for my total lack of knowledge in R... so I did the correlation.. and got these results: > cor(A, C, method = "spearman") >[1] 0.4922165 > cor(B, C, method = "spearman") >[1] 0.1922412 > cor(A, B, method = "spearman") > [1] -0.00889328 I do

Re: [R] Ranking correlation with R

2010-04-10 Thread Gabor Grothendieck
Try this: > A <- c("file1.java", "file3.java", "file2.java") > B <- c("file2.java", "file4.java", "file1.java") > cor(A, B, method = "spearman") [1] 0.5 On Fri, Apr 9, 2010 at 11:22 AM, David Nemer wrote: > Hey Everyone, > > Im fresh new in R, and Im supposed to write a code to give me a correl

Re: [R] Ranking correlation with R

2010-04-10 Thread Jim Lemon
On 04/10/2010 01:22 AM, David Nemer wrote: Hey Everyone, Im fresh new in R, and Im supposed to write a code to give me a correlation between two rankings. So I have two ranking lists, which contain file names, e.g.: Ranking list 1: file1.java file3.java file2.java Ranking list 2: fiile2.java f

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
On Fri, Apr 9, 2010 at 10:23 AM, David Nemer wrote: > Would that also work if in one ranking I have a filename that it is not in > the other ranking? match() will return an NA, if it cannot find a match, in which case you could use the argument: use="pairwise.complete.obs") in cor() to have it on

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
>> 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 da

Re: [R] Ranking correlation with R

2010-04-09 Thread David Winsemius
On Apr 9, 2010, at 12:14 PM, Joshua Wiley wrote: On Fri, Apr 9, 2010 at 8:58 AM, David Nemer 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 t

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
On Fri, Apr 9, 2010 at 8:58 AM, David Nemer 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

Re: [R] Ranking correlation with R

2010-04-09 Thread Joshua Wiley
Dear David, Are the rankings the numbers? Like List 1: 1 3 2 If so you should be able to do it fairly easily with cor() If you have a lot of file names and need to extract the numbers look at ?strsplit or ?substring. This will be easier or harder depending how variable the names are. For