PageRenderTime 36ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/fingerprint/R/balance.R

http://github.com/rajarshi/cdkr
R | 18 lines | 18 code | 0 blank | 0 comment | 2 complexity | f28cc7591c8d64e99d90d9f91383a1c6 MD5 | raw file
  1. balance <- function(fplist) {
  2. if (is.list(fplist)) {
  3. lapply(fplist, function(fp) {
  4. compl <- !fp
  5. new('fingerprint',
  6. nbit = 2 * length(fp),
  7. bits = c(fp@bits, compl@bits+length(fp)),
  8. provider='R', name='balanced')
  9. })
  10. } else {
  11. fp <- fplist
  12. compl <- !fp
  13. new('fingerprint',
  14. nbit = 2 * length(fp),
  15. bits = c(fp@bits, compl@bits+length(fp)),
  16. provider='R', name='balanced')
  17. }
  18. }