Skip to content

Example does not work #19

Description

@edmcman

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):

  • OS: Darwin MacBook-Pro-2.local 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
  • Version of R: 4.0.1
  • Version of RStudio: NA

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions