dleutnant / swmmr

R Interface for US EPA's SWMM
https://cran.r-project.org/package=swmmr
39 stars 15 forks source link

read_inp in swmmr package issue #119

Open Shaahin-Nazarpour-Tameh opened 1 month ago

Shaahin-Nazarpour-Tameh commented 1 month ago

Hi

does anybody know how can i sove the error pasted below (ERROR) using "swmmr" package?

Thank you in advance

Cheers!

ERROR:

inp <- read_inp(inp_file) Error in map2(): ℹ In index: 7. ℹ With name: infiltration. Caused by error in tidyr::separate(): ! into must be a character vector, not NULL. Run rlang::last_trace() to see where the error occurred. rlang::last_trace() <error/purrr_error_indexed> Error in map2(): ℹ In index: 7. ℹ With name: infiltration. Caused by error in tidyr::separate(): ! into must be a character vector, not NULL.

Backtrace: ▆

  1. ├─swmmr::read_inp(inp_file)
  2. │ ├─... %>% purrr::discard(~ nrow(.) < 1)
  3. │ └─purrr::imap(...)
  4. │ └─purrr::map2(.x, vec_index(.x), .f, ...)
  5. │ └─purrr:::map2_("list", .x, .y, .f, ..., .progress = .progress)
  6. │ ├─purrr:::with_indexed_errors(...)
  7. │ │ └─base::withCallingHandlers(...)
  8. │ ├─purrr:::call_with_cleanup(...)
  9. │ └─swmmr (local) .f(.x[[i]], .y[[i]], ...)
  10. │ └─swmmr:::section_to_tbl(.x, .y, rm.comment = rm.comment, options = options)
  11. │ ├─swmmr:::parse_section(x, inf_model = tolower(options$INFILTRATION))
  12. │ └─swmmr:::parse_section.infiltration(x, inf_model = tolower(options$INFILTRATION))
  13. │ └─swmmr:::separate_into(x, header)
  14. │ ├─tidyr::separate(...)
  15. │ └─tidyr:::separate.data.frame(into = into)
  16. ├─purrr::discard(., ~nrow(.) < 1)
  17. │ └─purrr:::where_if(.x, .p, ...)
  18. │ └─purrr:::map_(.x, .p, ..., .type = "logical", .purrr_error_call = .purrr_error_call)
  19. │ └─purrr:::vctrs_vec_compat(.x, .purrr_user_env)
  20. └─purrr::discard(., is.null)
  21. └─purrr:::where_if(.x, .p, ...)
  22. └─purrr:::map_(.x, .p, ..., .type = "logical", .purrr_error_call = .purrr_error_call)
  23. └─purrr:::vctrs_vec_compat(.x, .purrr_user_env)