From 2a27a748d34acb5e93f02929703037e5f15d27fb Mon Sep 17 00:00:00 2001 From: Andrew Ghazi Date: Tue, 4 Apr 2023 12:08:10 -0400 Subject: [PATCH] allow matrix input (#30) --- R/Maaslin2.R | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/R/Maaslin2.R b/R/Maaslin2.R index 50f3c1d..8e7298e 100755 --- a/R/Maaslin2.R +++ b/R/Maaslin2.R @@ -395,8 +395,11 @@ Maaslin2 <- stop("If supplying input_data as a data frame, it must have appropriate rownames!") } data <- as.data.frame(input_data) # in case it's a tibble or something + } else if (is.matrix(input_data)) { + logging::logwarn("Input is a matrix, passing through as.data.frame() .") + data <- as.data.frame(input_data) } else { - stop("input_data is neither a file nor a data frame!") + stop("input_data is neither a file nor a data frame!") } if (is.character(input_metadata) && file.exists(input_metadata)) {