From 2812e007f8cee3c17496bec1246fbae660826d2c Mon Sep 17 00:00:00 2001 From: Hui Lan Date: Fri, 11 Nov 2022 16:09:59 +0800 Subject: correlation_per_group_fixed_number.R: fix 'argument is of length zero' error. --- Code/correlation_per_group_fixed_number.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'Code') 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='') } } -- cgit v1.2.1