Skip to content

Commit

Permalink
update message for #324
Browse files Browse the repository at this point in the history
  • Loading branch information
brownag committed Dec 14, 2023
1 parent 3ec5c19 commit 3c63e3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions R/get_phlabresults_data_from_NASIS_db.R
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,12 @@ LEFT OUTER JOIN phlabresults_View_1 phl on phl.phiidref = ph.phiid
idx <- which(duplicated(d.phlabresults$phiid))

if (length(idx) > 0) {
message(paste("NOTICE: multiple phiid values exist in the `phlabresults` table, computing weighted averages and dominant values based on horizon thickness"))

message(paste("NOTICE: multiple records per pedon horizon exist in the `phlabresults` table, computing weighted averages and dominant values based on sample thickness"))

if (any(is.na(d.phlabresults[idx, "sampledepthbottom"]))) {
message("NOTICE: some `phlabresults` records are missing `sampledepthbottom`; affected weighted averages will return `NA` and dominant values will be from the first (shallowest top depth) record per horizon")
}

# aggregate dup phiid
dup <- d.phlabresults[idx, "phiid"]
dup_idx <- which(d.phlabresults$phiid %in% dup)
Expand Down

0 comments on commit 3c63e3d

Please sign in to comment.