diff options
author | Hui Lan <lanhui@zjnu.edu.cn> | 2022-11-11 16:09:59 +0800 |
---|---|---|
committer | Hui Lan <lanhui@zjnu.edu.cn> | 2022-11-11 16:09:59 +0800 |
commit | 2812e007f8cee3c17496bec1246fbae660826d2c (patch) | |
tree | 05acd14d7f4e00a28db68e78baa16851998ed170 | |
parent | 5b13b624473ce0c016272af1ef44aeb4991f1a33 (diff) |
correlation_per_group_fixed_number.R: fix 'argument is of length zero' error.
-rw-r--r-- | Code/correlation_per_group_fixed_number.R | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Code/correlation_per_group_fixed_number.R b/Code/correlation_per_group_fixed_number.R index dd28971..2d943af 100644 --- a/Code/correlation_per_group_fixed_number.R +++ b/Code/correlation_per_group_fixed_number.R @@ -199,8 +199,8 @@ for (i in 1:total.pair) { curr.date <- gsub('-','',Sys.Date()) loglik <- '-991.1' cond = as.vector(target.tf[i,3]) - result.1 <- '' - result.2 <- '' + result.1 <- NULL + result.2 <- NULL if (max.pos.n > 0) { sub.cond <- paste(max.pos.samples, collapse=' ') num.sub.cond <- length(max.pos.samples) @@ -211,10 +211,10 @@ for (i in 1:total.pair) { num.sub.cond <- length(max.neg.samples) result.2 = sprintf('%s %s\t%s %s\t%4.2f\t%s\t%s\t%s\t%s\t%s\t%4.2f\t%s\n', gene.target, name2, gene.tf, name1, max.neg.r, 'mix', num.sub.cond, cond, loglik, curr.date, max.neg.r, 'hclust.fixed.group') } - if (result.1 != '') { + if (!is.null(result.1)) { cat(result.1, file=f, sep='') } - if (result.2 != '') { + if (!is.null(result.2)) { cat(result.2, file=f, sep='') } } |