Skip to content

Commit

Permalink
cleanup function names, arguments and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kotov committed Dec 16, 2024
1 parent 5cd258f commit 7832025
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Generated by roxygen2: do not edit by hand

export(mi_column_values)
export(mi_data)
export(mi_nuts_levels)
export(mi_source_coverage)
export(mi_source_filters)
export(mi_sources)
importFrom(rlang,.data)
4 changes: 2 additions & 2 deletions R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' and the values are the selected values for those fields. Default is an empty list.
#' @param y_filters (Optional) A `named list` where the names are the filter fields for the y variable
#' and the values are the selected values for those fields. Default is `NULL`.
#' @param limit An `integer` specifying the maximum number of results to return. Default is 1500.
#' @param limit An `integer` specifying the maximum number of results to return. Default is 2000.
#'
#' @return A `tibble` with the following columns:
#'
Expand Down Expand Up @@ -58,7 +58,7 @@ mi_data <- function(
level,
x_filters = list(),
y_filters = NULL,
limit = 1500
limit = 2000
) {
# Validate inputs
checkmate::assert_string(x_source)
Expand Down
4 changes: 2 additions & 2 deletions R/column-values.R → R/source-filters.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@
#'
#' @examples
#' \dontrun{
#' mi_column_values(
#' mi_source_filters(
#' source_name = "DEMO_R_FIND2",
#' year = 2020,
#' level = "2",
#' filters = list(unit = "YR")
#' )
#' }
mi_column_values <- function(
mi_source_filters <- function(
source_name,
year,
level,
Expand Down
10 changes: 6 additions & 4 deletions R/sources.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#'
#' @param level a `character` string specifying the NUTS level ("0", "1", "2", or "3"). You can also always check valid NUTS levels using \code{\link{mi_nuts_levels}}.
#' @param year an `integer` of length 1, specifying the year. Optional.
#' @param limit an `integer` of length 1 specifying the maximum number of sources to return. Defaults to 1000.
#' @inheritParams mi_data
#'
#' @return a `tibble` of sources with the following columns:
#'
Expand Down Expand Up @@ -84,7 +84,7 @@ mi_sources <- function(
#' Get the NUTS level and Year coverage for a specific data source.
#'
#' @param source_name name of the data source
#'
#' @inheritParams mi_data
#' @return a `tibble` containing the following columns:
#'
#' * `nuts_level`: NUTS level
Expand All @@ -103,7 +103,8 @@ mi_sources <- function(
#' mi_source_coverage("ghs_smod")
#' }
mi_source_coverage <- function(
source_name
source_name,
limit = 1500
){
checkmate::assert_string(source_name)

Expand Down Expand Up @@ -133,7 +134,8 @@ mi_source_coverage <- function(
"User-Agent" = getOption("mapineqr.user_agent")
) |>
httr2::req_url_query(
`_resource` = source_name
`_resource` = source_name,
`limit` = limit
) |>
httr2::req_method("GET") |>
httr2::req_perform()
Expand Down
4 changes: 2 additions & 2 deletions man/mi_data.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/mi_source_coverage.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions man/mi_column_values.Rd → man/mi_source_filters.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/mi_sources.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7832025

Please sign in to comment.