From 13364fbfcebdac22303e62a99ad0ac2f64f4928e Mon Sep 17 00:00:00 2001 From: mrustl Date: Fri, 5 Jul 2024 11:03:56 +0200 Subject: [PATCH] Fix ATMOSPH.in file creation to be displayed correctly in GUI! (requires "weird" adding of RootDepth and deleting of all cTop/cBot headers besides cTop/cBot --- R/convert_atmosphere_to_string.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/R/convert_atmosphere_to_string.R b/R/convert_atmosphere_to_string.R index 4667c73..1090040 100644 --- a/R/convert_atmosphere_to_string.R +++ b/R/convert_atmosphere_to_string.R @@ -52,8 +52,8 @@ convert_atmosphere_to_string <- function( names(atm)[is_short] <- do_pad_short(names(atm)[is_short]) names(atm)[is_long] <- do_pad_long(names(atm)[is_long]) - header_text <- c(names(atm)[!grepl("(cTop|cBot)[2-9][1-9]?[0-9]?", names(atm))], "RootDepth") %>% - do_pad_long() %>% + header_text <- c(names(atm)[!grepl("[cTop|cBot][1-9]0?", names(atm))], + do_pad_long("RootDepth")) %>% kwb.utils::collapsed(collapse = "") body_lines <- apply(atm, 1L, kwb.utils::collapsed, "")