#Hello,
#I have three data frames, X,Y and Z with two columns each and different numbers of rows. # creation of data frame X X.alleles <- c(1,5,6,7,8) X.Freq <- c(0.35, 0.15, 0.05 , 0.10, 0.35) Loc1 <- cbind( X.alleles,X.Freq) X <- data.frame(Loc1) #creation of data frame Y Y.alleles <- c(1,4,6,8) Y.Freq <- c(0.35, 0.35, 0.10, 0.20 ) Loc2 <- cbind(Y.alleles, Y.Freq) Y <- data.frame (Loc2) # creation of data frame Z Z.alleles <- c(1,4,5,6,8) Z.Freq <- c(0.35, 0.35, 0.05, 0.05, 0.20) Loc3 <- cbind(Z.alleles, Z.Freq) Z <- data.frame (Loc3) X Y Z # I want to create a pair wise multiplication for all of the second columns of my dataframe X,Y and Z # Here is a way to get two of the data frames to create a pairwise multiplication. X.Freq_times_Y.Freq<- matrix(Y[,2] %o% X[,2], ncol=1) X.Freq_times_Y.Freq # I would like to create a loop to calculate all possible pairwise multiplications for the # second columns of my X,Y, and Z data frames. # I will be conducting pair wise comparisons for up to 50 different data frames so I need the code to be # as flexible as possible Any help would be greatly appreciated. Thanks in advance Luke Neraas [EMAIL PROTECTED] University of Alaska Fairbanks School of Fisheries and Ocean Sciences 11120 Glacier Highway UAF Fisheries Division Juneau, AK 99801 [[alternative HTML version deleted]] ______________________________________________ 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.