Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If the package is not loaded, the get0 wont work aparently #40

Merged
merged 1 commit into from
Nov 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions R/read_dictionary.R
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ read_dictionary <- function(city = "S\u00E3o Paulo",
# Get the correct dictionary
od_dic <- get0(od_dic_name, envir = asNamespace("odbr"))

# Second try to get the dictionary, using ::
if (is.null(od_dic)) {
od_dic <- eval(parse(text = paste0("odbr::", od_dic_name)))
}
# Verify is loaded as a data.frame object
if (is.data.frame(od_dic) == FALSE) {
usethis::ui_stop("The specified dictionary is not available.
Expand Down
Loading