From c3ae475d7118fa58eb9b424a19c43bec5d43363f Mon Sep 17 00:00:00 2001 From: nwickel Date: Thu, 2 May 2024 19:42:22 +0200 Subject: [PATCH] Catch error in add_path because of factor/character confusion --- R/add_path.R | 3 +++ 1 file changed, 3 insertions(+) diff --git a/R/add_path.R b/R/add_path.R index 5f5e379..9e8e9e1 100644 --- a/R/add_path.R +++ b/R/add_path.R @@ -217,6 +217,9 @@ add_path_subdata <- function(subdata, cutoff) { subdata_path <- lapply(subdata_moves, check_moves, cutoff = cutoff) subdata <- dplyr::bind_rows(subdata_path) + if (nrow(subdata) != 0) { + subdata$path <- as.factor(subdata$path) + } subdata }