-
Notifications
You must be signed in to change notification settings - Fork 4
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
Change get_sotkanet default years, add function sotkanet_indicators_metadata and move from httr to httr2 #24
Conversation
Move from |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work
path <- paste(url_object$path, sotkanet_uri, sep = "") | ||
url_object$path <- path | ||
final_url <- httr::build_url(url_object) | ||
final_url <- httr2::url_build(url_object) | ||
|
||
res <- sotkanet.json_query(final_url, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here flatten = TRUE but in sotkanet.json_query function the parameters is not passed forward anymore (?)
R/json.R
Outdated
response <- httr2::request(url) %>% httr2::req_user_agent(useragent) %>% | ||
httr2::req_perform() %>% httr2::resp_body_json(simplifyVector = TRUE) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the output still the same as before? Is simplifyVector essentially the same as flatten = TRUE?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is that simplifyVector does work in a similar way. At least in my testing the output is similar with simplifyVector.
R/get_sotkanet.R
Outdated
#' work with only the gender value 'total' and return an empty data.frame. In these situations | ||
#' it is advised to check out the [eurostat] package instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe remove eurostat reference and instruct user to just try with other options
Maybe one final addition: since packages like
See Vignettes - Special considerations for vignette code for more info. |
Change
get_sotkanet
years
parameter default from1991:2015
toNULL
. The default now gives the data from all the available years. Also update the function documentation and add more examples.Add function
sotkanet_indicators_metadata
and update other functions to use it instead ofSotkanetIndicatorsMetadata
.