Skip to content

Commit

Permalink
fix recently introduced bug in getCambicBounds #132
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed May 18, 2020
1 parent b83d191 commit acbac1f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion R/getCambicBounds.R
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,12 @@ getCambicBounds <- function(p, ...,
}
}
# construct data.frame result
iddf <- data.frame(id=profile_id(p), cambic_index=1:nrow(final))
final <- final[complete.cases(final),]
if(nrow(final) == 0) {
return(empty_frame)
}
iddf <- data.frame(id=profile_id(p),
cambic_index=1:nrow(final))
colnames(iddf) <- c(idname(p), "cambic_id")
return(cbind(iddf, final))
}
2 changes: 1 addition & 1 deletion R/mollicEpipedon.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ mollic.thickness.requirement <- function(p, texcl = guessHzTexClName(p), clay.at
no.contact.assigned = NA)

# the B|w == cambic was particularly egregious
cambic_bottom <- max(getCambicBounds(p, argi_bounds=argi_bounds)$cambic_bottom)
cambic_bottom <- max(getCambicBounds(p, argi_bounds=argi_bounds)$cambic_bottom, na.rm=TRUE)

# calculate "deepest of lower boundary of argillic/natric, cambic, oxic, spodic"
crit6c2 <- suppressWarnings(max(c(argillic_bottom,
Expand Down

0 comments on commit acbac1f

Please sign in to comment.