From d8e1d66d855b0a4a1859c1668fc62800af62022a Mon Sep 17 00:00:00 2001 From: Andrew Gene Brown Date: Fri, 22 Mar 2024 11:11:04 -0700 Subject: [PATCH] fix for #312 --- R/SoilProfileCollection-setters.R | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/R/SoilProfileCollection-setters.R b/R/SoilProfileCollection-setters.R index b262a98a..c612d43f 100644 --- a/R/SoilProfileCollection-setters.R +++ b/R/SoilProfileCollection-setters.R @@ -702,7 +702,10 @@ setReplaceMethod("diagnostic_hz", # if data are already present, warn the user if(nrow(d) > 0) warning('overwriting existing diagnostic horizon data!', call.=FALSE) - + + # convert id column to character to match @site + value[[idn]] <- as.character(value[[idn]]) + # copy data over object@diagnostic <- .as.data.frame.aqp(value, metadata(object)$aqp_df_class) @@ -784,7 +787,10 @@ setReplaceMethod("restrictions", signature(object = "SoilProfileCollection"), # if data are already present, warn the user if(nrow(d) > 0) warning('overwriting existing restriction data!', call.=FALSE) - + + # convert id column to character to match @site + value[[idn]] <- as.character(value[[idn]]) + # copy data over object@restrictions <- .as.data.frame.aqp(value, metadata(object)$aqp_df_class)