Closed giuliaimbu closed 1 year ago
I don't understand what the error is when trying to run `load_datasus(...)
I tried running load_datasus again using the code:
# download raw data for the year 2010 in the state of AM.
data <- load_datasus(dataset = "datasus_sim_do",
time_period = 2010,
states = "AM",
raw_data = TRUE)
# download treated data with the number of deaths by cause in AM and PA.
data <- load_datasus(dataset = "datasus_sim_do",
time_period = 2010,
states = c("AM", "PA"),
raw_data = FALSE)
# download treated data with the number of deaths by cause in AM and PA
# keeping all individual variables.
data <- load_datasus(dataset = "datasus_sim_do",
time_period = 2010,
states = c("AM", "PA"),
raw_data = FALSE,
keep_all = TRUE)
The same message appears for these 3 chunks of code:
Error in `map2()`:
ℹ In index: 1.
Caused by error in `external_download()`:
! object 'dat' not found
Run `rlang::last_trace()` to see where the error occurred.
> data <- load_datasus(dataset = "datasus_sim_do",
+ time_period = 2010,
+ states = c("AM", "PA"),
+ raw_data = FALSE,
+ keep_all = TRUE)
Apparently the object 'dat' can´t be found.
The problem in datasus.R code seems to be here: