From 05f6eb819354cf431bf68738e14954b6648003b2 Mon Sep 17 00:00:00 2001 From: mrustl Date: Wed, 10 Jul 2024 09:45:47 +0200 Subject: [PATCH] Fix mat props generation in write_profile() --- R/write_profile.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/write_profile.R b/R/write_profile.R index 650dc50..972a396 100644 --- a/R/write_profile.R +++ b/R/write_profile.R @@ -99,7 +99,7 @@ write_profile <- function(profile, n_materials <- length(unique(profile$profile$mat)) - if(nrow(profile$mat_props) != length(unique(profile$profile$mat)) & min(profile$profile$x) != min(profile$mat_props$mat_depth)) { + if(nrow(profile$mat_props) != length(unique(profile$profile$mat)) | min(profile$profile$x) != min(profile$mat_props$mat_depth)) { profile$mat_props <- tibble::tibble(mat_id = unique(profile$profile$mat), mat_depth = if(n_materials > 1) { c(rep(0, n_materials-1), min(profile$profile$x)