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

Bug in `pm_has_unit` #27

Open jennahgosciak opened 1 year ago

jennahgosciak commented 1 year ago

Before you open your issue:

Describe the bug working_data is referenced in two places in the function, but I think .data is the proper argument.

Expected behavior pm_has_unit gives me the error message "Error 2." even though pm_has_uid==TRUE

To Reproduce Please include a minimal reproducible example (AKA a reprex). If you've never heard of a reprex before, start by reading https://www.tidyverse.org/help/#reprex. When you create your reprex, please use a data set available in a package.

library(postmastr)
library(tidyverse)
#> Warning: package 'tidyverse' was built under R version 4.2.2
#> Warning: package 'ggplot2' was built under R version 4.2.2
#> Warning: package 'tibble' was built under R version 4.2.2
#> Warning: package 'readr' was built under R version 4.2.2
#> Warning: package 'purrr' was built under R version 4.2.2
#> Warning: package 'dplyr' was built under R version 4.2.2
#> Warning: package 'stringr' was built under R version 4.2.2
#> Warning: package 'forcats' was built under R version 4.2.2

sushi1 %>%
  filter(name != "Drunken Fish - Ballpark Village") %>% 
  pm_identify(var = address) %>% 
  pm_prep(var = address, type = "address") %>% 
  pm_has_unit()
#> Error in pm_has_unit(.): Error 2.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.