Re: [R] General help for a function I'm attempting to write

2009-03-27 Thread Jorge Ivan Velez
Dear Colin, Try this: # Data DF <- structure(c(0, 0, 0, 4, 27, 0, 1, 0, 7, 16, 1, 0, 0, 16, 44, 0, 0, 0, 2, 39), .Dim = c(5L, 4L), .Dimnames = list(c("L01.1", "L01.2", "L01.3", "L01.4", "L01.5"), c("P01", "P02", "P03", "P04" ))) # Distances Names<-t(combn(colnames(DF),2)) apply(Names,1,function(x

[R] General help for a function I'm attempting to write

2009-03-27 Thread Colin Garroway
Hello, I have written a small function ('JostD' based upon a recent molecular ecology paper) to calculate genetic distance between populations (columns in my data set). As I have it now I have to tell it which 2 columns to use (X, Y). I would like it to automatically calculate 'JostD' for all co