Skip to content

Commit

Permalink
Merge pull request #50 from Moohan/documentation/remove_internal_func…
Browse files Browse the repository at this point in the history
…_docs

Remove Rd help pages for internal functions
  • Loading branch information
csillasch authored Nov 21, 2024
2 parents 8d57e60 + a297184 commit 34aefe5
Show file tree
Hide file tree
Showing 23 changed files with 24 additions and 204 deletions.
2 changes: 2 additions & 0 deletions R/add_context.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#' @keywords internal
#' @noRd
add_context <- function(data, id, name, created_date, modified_date) {
# Catch if the resource has never been modified
if (is.null(modified_date)) {
Expand Down
3 changes: 2 additions & 1 deletion R/check_dataset_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#' Used to attempt to validate a dataset name before submitting it to the API
#'
#' @param dataset_name a resource ID
#'
#' @keywords internal
#' @noRd
check_dataset_name <- function(dataset_name) {
# Starts and ends in a lowercase letter or number
# Has only lowercase alphanum or hyphens inbetween
Expand Down
2 changes: 2 additions & 0 deletions R/check_res_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
#' @param res_id a resource ID
#'
#' @return TRUE / FALSE indicating the validity of the res_id
#' @keywords internal
#' @noRd
check_res_id <- function(res_id) {
# check res_id is single value
if (length(res_id) > 1) {
Expand Down
3 changes: 2 additions & 1 deletion R/dump_download.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#' @param res_id a resource ID
#' @return dataframe containing resource records
#'
#' @keywords internal
#' @noRd
dump_download <- function(res_id) {
# fetch the data
content <- suppressMessages(
Expand Down
3 changes: 2 additions & 1 deletion R/error_check.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#' Throws errors found in the content of an `httr::GET` request
#'
#' @param content object produced by `httr::content`
#'
#' @keywords internal
#' @noRd
error_check <- function(content) {
# if content is not a list,
# stop for content (a string describing an error)
Expand Down
2 changes: 2 additions & 0 deletions R/get_latest_resource_id.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
#' @inheritParams get_dataset
#'
#' @return a string with the resource id
#' @keywords internal
#' @noRd
get_latest_resource_id <- function(dataset_name) {
# send the api request
query <- list("id" = dataset_name)
Expand Down
2 changes: 2 additions & 0 deletions R/parse_col_select.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#'
#' @param col_select a character vector identifying the columns to select.
#' @return a character string
#' @keywords internal
#' @noRd
parse_col_select <- function(col_select) {
if (is.null(col_select)) {
return(NULL)
Expand Down
2 changes: 2 additions & 0 deletions R/parse_row_filters.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#' @description Formats a list or named vector into a valid query
#' @param row_filters list or named vectors matching fields to values
#' @return a json as a character string
#' @keywords internal
#' @noRd
parse_row_filters <- function(row_filters) {
# exit function if no filters
if (is.null(row_filters)) {
Expand Down
2 changes: 2 additions & 0 deletions R/phs_GET.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#' @inheritParams request_url
#' @param verbose TRUE or FALSE. If TRUE, a success message will be printed to the console.
#' @return content of a httr::GET request
#' @keywords internal
#' @noRd
phs_GET <- function(action, query, verbose = FALSE) {
# define URL
url <- request_url(action, query)
Expand Down
3 changes: 2 additions & 1 deletion R/request_url.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#' @param action The API endpoint you want to use, e.g., "package_show" / "datastore_search".
#' @param query The query to pass to the endpoint defined by the action argument.
#' @return a URL as a character string
#'
#' @keywords internal
#' @noRd
request_url <- function(action, query) {
# check action is valid
valid_actions <- c(
Expand Down
3 changes: 2 additions & 1 deletion R/suggest_dataset_name.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#'
#' @param dataset_name a string to be matched against valid dataset names
#'
#' @keywords internal
#' @noRd
suggest_dataset_name <- function(dataset_name) {
content <- phs_GET("package_list", "")

Expand Down
3 changes: 2 additions & 1 deletion R/use_dump_check.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#' @param query a list of items to query
#' @param rows the number of rows user is requesting
#' @return a logical value. TRUE indicates that the dump should be used
#'
#' @keywords internal
#' @noRd
use_dump_check <- function(query, rows) {
# if row input is > 99999 or NULL
# or all queries (inc. rows) are null
Expand Down
14 changes: 0 additions & 14 deletions man/check_dataset_name.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/check_res_id.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/dump_download.Rd

This file was deleted.

14 changes: 0 additions & 14 deletions man/error_check.Rd

This file was deleted.

29 changes: 0 additions & 29 deletions man/get_latest_resource_id.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/parse_col_select.Rd

This file was deleted.

17 changes: 0 additions & 17 deletions man/parse_row_filters.Rd

This file was deleted.

21 changes: 0 additions & 21 deletions man/phs_GET.Rd

This file was deleted.

19 changes: 0 additions & 19 deletions man/request_url.Rd

This file was deleted.

14 changes: 0 additions & 14 deletions man/suggest_dataset_name.Rd

This file was deleted.

19 changes: 0 additions & 19 deletions man/use_dump_check.Rd

This file was deleted.

0 comments on commit 34aefe5

Please sign in to comment.