From d4fc3183aeb41d6dc6ea13f10792949c28c56b74 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Tue, 11 Sep 2018 16:58:57 +0900 Subject: [PATCH 1/2] fix needs square before colSums https://github.com/atusy/qntmap/issues/4#issue-357878935 --- R/cluster.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/cluster.R b/R/cluster.R index 854f679..826a88f 100755 --- a/R/cluster.R +++ b/R/cluster.R @@ -13,7 +13,7 @@ cluster <- function(x, centers, xte = NULL, ...) { x_trans <- t(x) y <- pipeline({ centers - apply(1, function(y) colSums(x_trans - y) ^ 2) + apply(1, function(y) colSums((x_trans - y) ^ 2)) apply(1, which.min) }) rm(x_trans) From 08933f8172313525c111200c36da0362458739a2 Mon Sep 17 00:00:00 2001 From: atusy <30277794+atusy@users.noreply.github.com> Date: Tue, 11 Sep 2018 17:01:19 +0900 Subject: [PATCH 2/2] fix needs `file.exists` as some can be abscent (especially peak.qnt) https://github.com/atusy/qntmap/issues/4#issue-357878935 --- R/read_qnt.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/read_qnt.R b/R/read_qnt.R index c9cd718..4cdc86c 100644 --- a/R/read_qnt.R +++ b/R/read_qnt.R @@ -50,7 +50,7 @@ read_qnt <- function( 'wt' ) %>>% (setNames(paste0(., '.qnt'), .)) %>>% - # `[`(file.exists(.)) %>>% + `[`(file.exists(.)) %>>% lapply(fread) elemw <- c('.cnd/elemw.cnd', 'Pos_0001/data001.cnd')