[R] All possible combinations of functions within a function

2009-11-10 Thread bikemike42
Dear All, I wrote a function for cluster analysis to compute cophenetic correlations between dissimilarity matrices (using the VEGAN library) and cluster analyses of every possible clustering algorithm (SEE ATTACHED) http://old.nabble.com/file/p26288610/cor.coef.R cor.coef.R . As it is now, it

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

[R] Create Artificial Binary Matrix based on probability

2009-11-03 Thread bikemike42
Dear All, I am trying to create an artificial binary matrix such that each cell has a probability of 0.048 of having a 1. So far the closest I've come is us by using a random poisson distribution with a mean of 0.048, but I can't figure out how to limit the max value to 1. Otherwise that would

[R] Re place only first NA in column

2009-11-03 Thread bikemike42
Dear All, I am trying to fill in a blank vector (a) with one value at a time, with the value of the number of rows in a randomized dataset with rowSums=0. Below is the code I've got so far, but what I want to be as the last line is a[1st NA,]=nz such that this will run until all of my NAs are