From 26dbb89b021c40582d478b8f754a91b38fc8573e Mon Sep 17 00:00:00 2001 From: "Andrew G. Brown" Date: Tue, 2 Mar 2021 12:01:47 -0800 Subject: [PATCH] safer for user specified metadata --- R/SoilProfileCollection-methods.R | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/R/SoilProfileCollection-methods.R b/R/SoilProfileCollection-methods.R index c0664cc0a..8ddfb510c 100644 --- a/R/SoilProfileCollection-methods.R +++ b/R/SoilProfileCollection-methods.R @@ -79,9 +79,7 @@ setMethod( # filter out missing data, accounting for optional `v` h <- x@horizons - h <- .data.frame.j(h, target.names, aqp_df_class(x)) - x@horizons <- h[complete.cases(h),] - hzdesgnname(x) <- "" + x@horizons <- h[complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))),] # return the shallowest (of the deepest depths in each profile) .LAST <- NULL @@ -120,9 +118,7 @@ setMethod( # filter out missing data, accounting for optional `v` h <- x@horizons - h <- .data.frame.j(h, target.names, aqp_df_class(x)) - x@horizons <- h[complete.cases(h),] - hzdesgnname(x) <- "" + x@horizons <- h[complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))),] # return the deepest (of the deepest depths in each profile) .LAST <- NULL