>> 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).
What about this? x <- c("A","C","B") y <- c("A","B","C") ranks <- match(y,x) > ranks [1] 1 3 2 > cor(seq_along(x), ranks) [1] 0.5 It seems like as long as both sets of filenames contain exactly the same names, that should work. > > David Winsemius, MD > West Hartford, CT -- Joshua Wiley Senior in Psychology University of California, Riverside http://www.joshuawiley.com/ ______________________________________________ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.