From 9afda5a6790904e7b9c1b7d38d5b8c6c2b4a977b Mon Sep 17 00:00:00 2001 From: Andrew Singleton <36473866+andrew-MET@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:17:25 +0100 Subject: [PATCH] Fix bug for removing model elevation from sqlite files (#96) --- R/write_fctable_to_sqlite.R | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/R/write_fctable_to_sqlite.R b/R/write_fctable_to_sqlite.R index b740b59..90845d4 100644 --- a/R/write_fctable_to_sqlite.R +++ b/R/write_fctable_to_sqlite.R @@ -26,11 +26,12 @@ write_fctable_to_sqlite <- function( data <- check_level(data) - if (member_elev_diff(data)) { + if (!remove_model_elev && member_elev_diff(data)) { stop( "Problem writing to: \n\"", filename, "\"\n", "`model_elevation` is not the same for all members. ", - "\nSet `remove_model_elev = TRUE` to write data without model elevation.", + "\nSet `remove_model_elev = TRUE` in sqlite_opts()", + "to write data without model elevation.", call. = FALSE ) }