# NOT RUN {
# }
# NOT RUN {
data(saliva)
data(throat)
### Combine the data into a single data frame
group.data <- list(saliva, throat)
group.data <- formatDataSets(group.data)
data <- do.call("rbind", group.data)
### Normalize the data by subject
dataNorm <- t(apply(data, 1, function(x){x/sum(x)}))
### Set covars to just be group membership
memb <- c(rep(0, nrow(saliva)), rep(1, nrow(throat)))
covars <- matrix(memb, length(memb), 1)
### We use low numbers for speed. The exact numbers to use depend
### on the data being used, but generally the higher iters and popSize
### the longer it will take to run. earlyStop is then used to stop the
### run early if the results aren't improving.
iters <- 500
popSize <- 200
earlyStop <- 250
gaRes <- Gen.Alg(dataNorm, covars, iters, popSize, earlyStop)
# }
Run the code above in your browser using DataLab