Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions R/chi_calc.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ chi_calc <- function(ph.data = NULL,
tempbv <- unique(na.omit(c(tempbv1, tempbv2)))
tempend <- current_row$end
tempstart <- current_row$start
temptab <- current_row$tab

# use calc()----
if(rate == FALSE){ # standard proportion analysis
if(any(grepl('wastate', tempbv))){
if(temptab == '_wastate'){
tempest <- rads::calc(ph.data = ph.data[chi_year >= tempstart & chi_year <= tempend],
what = current_row$indicator_key,
by = tempbv,
Expand All @@ -214,7 +215,7 @@ chi_calc <- function(ph.data = NULL,
}
}
if(rate == TRUE){
if(any(grepl('wastate', tempbv))){
if(temptab == '_wastate'){
tempest <- rads::calc(ph.data = ph.data[chi_year >= tempstart & chi_year <= tempend],
what = current_row$indicator_key,
by = tempbv,
Expand Down