Skip to content

Commit

Permalink
issue proper error message on entire year without valid uStart
Browse files Browse the repository at this point in the history
  • Loading branch information
bgctw committed Feb 7, 2020
1 parent 604ec60 commit 0068e19
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion R/EddyUStarFilterDP.R
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,14 @@ usEstUstarThreshold = function(
resultsSeasonYearPooled <- data.frame(seasonYear = NA_character_
, nRec = NA_integer_ , uStarPooled = NA_real_)[FALSE, ]
} else {
dscPooled <- dsc %>% filter(UQ(sym("seasonYear")) %in% !!seasonYearsPooled)
#dscPooled <- dsc %>% filter(UQ(sym("seasonYear")) %in% !!seasonYearsPooled)
dscPooled <- dsc %>% filter(.data$seasonYear %in% !!seasonYearsPooled)
if (!nrow(dscPooled)) {
stop("Expected valid uStar records for year ", seasonYearsPooled,
", but got no records.\n",
"Does the analyzed dataset include single records of",
" adjacent years?")
}
UstarYearsTempL <- tmp <- dscPooled %>%
split(.$seasonYear) %>%
map(fEstimateUStarSeason
Expand Down

0 comments on commit 0068e19

Please sign in to comment.