From e7704cecc6b629af33f742ce474b064d1108d429 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cassandre=20H=C3=A9ritier--Tellier?= <72193398+CassandreHeritier@users.noreply.github.com> Date: Wed, 30 Jul 2025 15:55:36 +0200 Subject: [PATCH] Update aggregate_pcrs.R : avoid error while non-identical plates coordinates I suggest removing the sort() function in order to resolve the issue raised here https://github.com/metabaRfactory/metabaR/issues/55#issuecomment-3132836584 (two samples placed in different locations but forming identical combinations if these combinations are then sorted resolve the error). We will see if this addresses all situations. --- R/aggregate_pcrs.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/aggregate_pcrs.R b/R/aggregate_pcrs.R index ea8d66a..a20abf9 100644 --- a/R/aggregate_pcrs.R +++ b/R/aggregate_pcrs.R @@ -81,7 +81,7 @@ aggregate_pcrs <- function(metabarlist, if (is.numeric(x)) { mean(x) } else { - ifelse(length(unique(x)) == 1, x[1], paste(unique(sort(x)), collapse = "|")) + ifelse(length(unique(x)) == 1, x[1], paste(unique(x), collapse = "|")) } }) })))