# Example R codes usable in dChip R view # sample a new gene list (output.file) of a fixed number of genes # (num.gene) from an existing gene list # example: # sampling.gene.list("C:\\tmp\\filtered list.xls", "C:\\tmp\\sampled.list.xls", 100) sampling.gene.list <- function(input.file, output.file, num.gene) { gene.list <- as.vector(read.table(input.file)[,1]) sampled.list <- sample(gene.list, num.gene) write(sampled.list, output.file) }