Split Vectors for Parallelization

Share:

Description

Aids in splitting of a vector for parallelization, e.g. splitting up a group of SNPs into subgroups, so each one can analyzed in a parallel process. Other uses might be to choose splitting points for k-fold cross validation.

Usage

1
msplit(vec, m)

Arguments

vec

A vector, e.g. c(1,2,3), 1:10.

m

Numer of splits.

Details

Returns a list, with each member being a subgroup to be parallelized.

References

Thomas J. Hoffmann (2011). Passing in Command Line Arguments and Parallel Cluster/Multicore Batching in R with batch. Journal of Statistical Software, Code Snippets, 39(1), 1-11. URL http://www.jstatsoft.org/v39/c01/.

See Also

parseCommandArgs, rbatch, mergeCsv

Examples

1
2
3
  snps <- paste("snp", 1:98, sep="")
  print(snps)
  print(msplit(snps, 10)) ## Splits it into 10 groups

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.