slu-openGIS / postmastr

R package for Processing and Parsing Untidy Street Addresses
https://slu-opengis.github.io/postmastr/
GNU General Public License v3.0
37 stars 8 forks source link

Example does not work #19

Open edmcman opened 4 years ago

edmcman commented 4 years ago

Describe the bug Running example(pm_parse) results in the following output:

> example(pm_parse)

pm_prs> # construct dictionaries
pm_prs> dirs <- pm_dictionary(type = "directional", filter = c("N", "S", "E", "W"), locale = "us")

pm_prs> sufs <- pm_dictionary(type = "suffix", locale = "us")

pm_prs> mo <- pm_dictionary(type = "state", filter = "MO", case = c("title", "upper"), locale = "us")

pm_prs> cities <- pm_append(type = "city",
pm_prs+     input = c("Brentwood", "Clayton", "CLAYTON", "Maplewood", "St. Louis",
pm_prs+               "SAINT LOUIS", "Webster Groves"),
pm_prs+     output = c(NA, NA, "Clayton", NA, NA, "St. Louis", NA))

pm_prs> # add example data
pm_prs> df <- sushi1

pm_prs> # identify
pm_prs> df <- pm_identify(df, var = address)

pm_prs> # temporary code to subset unit
pm_prs> df <- dplyr::filter(df, name != "Drunken Fish - Ballpark Village")

pm_prs> # parse, full output
pm_prs> pm_parse(df, input = "full", address = address, output = "full", keep_parsed = "no",
pm_prs+     dir_dict = dirs, suffix_dict = sufs, city_dict = cities, state_dict = mo)
Error: Can't combine `..1$...street` <character> and `..2$...street` <logical>.
Run `rlang::last_error()` to see where the error occurred.

Expected behavior I expected the example to complete without an error.

To Reproduce Run example(pm_parse)

Screenshots

> rlang::last_trace()
<error/vctrs_error_incompatible_type>
Can't combine `..1$...street` <character> and `..2$...street` <logical>.
Backtrace:
     █
  1. ├─utils::example(pm_parse)
  2. │ └─base::source(...)
  3. │   ├─base::withVisible(eval(ei, envir))
  4. │   └─base::eval(ei, envir)
  5. │     └─base::eval(ei, envir)
  6. ├─postmastr::pm_parse(...)
  7. │ └─`%>%`(...)
  8. │   ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
  9. │   └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 10. │     └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 11. │       └─postmastr:::`_fseq`(`_lhs`)
 12. │         └─magrittr::freduce(value, `_function_list`)
 13. │           ├─base::withVisible(function_list[[k]](value))
 14. │           └─function_list[[k]](value)
 15. │             └─postmastr:::pm_parse_street(...)
 16. │               └─`%>%`(...)
 17. │                 ├─base::withVisible(eval(quote(`_fseq`(`_lhs`)), env, env))
 18. │                 └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 19. │                   └─base::eval(quote(`_fseq`(`_lhs`)), env, env)
 20. │                     └─postmastr:::`_fseq`(`_lhs`)
 21. │                       └─magrittr::freduce(value, `_function_list`)
 22. │                         ├─base::withVisible(function_list[[k]](value))
 23. │                         └─function_list[[k]](value)
 24. │                           └─postmastr::pm_street_parse(., dictionary = street_dict, ordinal = ordinal)
 25. │                             └─postmastr::pm_street_std(...)
 26. │                               └─postmastr:::pm_street_ord(.data, var = !!varQ, locale = locale)
 27. │                                 └─postmastr:::pm_street_ord_us(.data, var = !!varQ)
 28. │                                   └─dplyr::bind_rows(noOrd, yesOrd)
 29. │                                     └─vctrs::vec_rbind(!!!dots, .names_to = .id)
 30. └─vctrs::vec_default_ptype2(...)
 31.   └─vctrs::stop_incompatible_type(...)
 32.     └─vctrs:::stop_incompatible(...)
 33.       └─vctrs:::stop_vctrs(...)

Desktop (please complete the following information):

chris-prener commented 4 years ago

Thanks @edmcman - we're hoping to get postmastr stabilized this month - this is on my radar!

ryanelittle commented 4 years ago

Hi @chris-prener. Can you provide an update on your stabilization progress?