From 707d8d0f958c7363d47c8b7d2371ec243c0eaf65 Mon Sep 17 00:00:00 2001 From: tew42 <2049715+tew42@users.noreply.github.com> Date: Tue, 16 Feb 2021 15:26:04 +0100 Subject: [PATCH 1/3] Update statAnalysis.R allow negative values --- R/statAnalysis.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/statAnalysis.R b/R/statAnalysis.R index 1f78fca..7cbe77f 100755 --- a/R/statAnalysis.R +++ b/R/statAnalysis.R @@ -68,9 +68,9 @@ statAnalysis <- function(file, Frule = 0.8, normM = "NONE", imputeM = "KNN", glo imdat <- dat[, 3:ncol(dat)] - if (length(imdat[imdat < 0L]) > 0) { - imdat[imdat < 0L] <- 0L - } + #if (length(imdat[imdat < 0L]) > 0) { + # imdat[imdat < 0L] <- 0L + #} imdat[imdat == 0L] <- NA imdat <- cbind(dat[, 1:2], imdat) From 186eb6f407f1dffaf6c1132dcd1f11f4bddbab60 Mon Sep 17 00:00:00 2001 From: tew42 <2049715+tew42@users.noreply.github.com> Date: Thu, 4 Mar 2021 23:18:39 +0100 Subject: [PATCH 2/3] Update statAnalysis.R --- R/statAnalysis.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/statAnalysis.R b/R/statAnalysis.R index 7cbe77f..1f78fca 100755 --- a/R/statAnalysis.R +++ b/R/statAnalysis.R @@ -68,9 +68,9 @@ statAnalysis <- function(file, Frule = 0.8, normM = "NONE", imputeM = "KNN", glo imdat <- dat[, 3:ncol(dat)] - #if (length(imdat[imdat < 0L]) > 0) { - # imdat[imdat < 0L] <- 0L - #} + if (length(imdat[imdat < 0L]) > 0) { + imdat[imdat < 0L] <- 0L + } imdat[imdat == 0L] <- NA imdat <- cbind(dat[, 1:2], imdat) From a27ed642061449487414aee32434f8bdf5b7fb7f Mon Sep 17 00:00:00 2001 From: tew42 <2049715+tew42@users.noreply.github.com> Date: Thu, 4 Mar 2021 23:19:30 +0100 Subject: [PATCH 3/3] Update shapiro.R --- R/shapiro.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/shapiro.R b/R/shapiro.R index b74b425..bab5c28 100755 --- a/R/shapiro.R +++ b/R/shapiro.R @@ -45,11 +45,11 @@ shapiro <- function(file) { shapiro = matrix(rep(NA, ncol(n.x))) for (q in 1:ncol(name)) { notAlist = c() - notAlist = matrix(unlist(name[, q])) + notAlist = as.numeric(matrix(unlist(name[, q]))) if (diff(range(notAlist)) == 0) { shapiro[q, ] = NA } else { - shapiro[q, ] = shapiro.test(as.numeric(notAlist))$p.value + shapiro[q, ] = shapiro.test(notAlist)$p.value } assign(shapname, shapiro) }