Skip to content

Commit

Permalink
fix for #312
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Mar 22, 2024
1 parent 84fc1f3 commit d8e1d66
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions R/SoilProfileCollection-setters.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit d8e1d66

Please sign in to comment.