0

I am dealing with a relatively straightforward problem. Using the code below, I would like to apply bi_class function only if the condition meets: ProjectID==48. The code below, perfectly works when the if statement is removed but adding the if statement returns an error: Error in if (.) ProjectID == 48 else { : the condition has length > 1.

# here is my code:

IDD_nhmap <- IDD_nhmap %>%
  if (ProjectID==48) {
    bi_class(x = svi,
             y = race_hisp,
             style = "quantile",
             dim = 3) %>%
      mutate() %>%
      rename(bi_class_svi_H = bi_class) %>%
      relocate(svi, race_hisp, bi_class_svi_H, .after = bi_class_ACSB_B)
  }
Nader Mehri
  • 514
  • 1
  • 5
  • 21
  • https://stackoverflow.com/questions/75439733/error-with-bi-class-function-breaks-are-not-unique#comment133128381_75439733 still applies – r2evans Feb 18 '23 at 04:39

0 Answers0