Skip to content

Commit

Permalink
Fix #209 for data.table SPCs
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Mar 11, 2021
1 parent de0861e commit dd289be
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/SoilProfileCollection-methods.R
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ setMethod(

# filter out missing data, accounting for optional `v`
h <- x@horizons
x@horizons <- h[complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))),]
idx <- which(complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))))
x@horizons <- h[idx,]

# return the shallowest (of the deepest depths in each profile)
.LAST <- NULL
Expand Down Expand Up @@ -118,7 +119,8 @@ setMethod(

# filter out missing data, accounting for optional `v`
h <- x@horizons
x@horizons <- h[complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))),]
idx <- which(complete.cases(.data.frame.j(h, target.names, aqp_df_class(x))))
x@horizons <- h[idx,]

# return the deepest (of the deepest depths in each profile)
.LAST <- NULL
Expand Down

0 comments on commit dd289be

Please sign in to comment.