Skip to content

Commit

Permalink
markdown for documentation
Browse files Browse the repository at this point in the history
ref #431
  • Loading branch information
wibeasley committed Oct 16, 2022
1 parent a5f9266 commit 6d4c425
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
9 changes: 4 additions & 5 deletions R/redcap-metadata-read.R
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,11 @@ redcap_metadata_read <- function(
#' the array. Must be either "fields" or "forms".
#'
#' @return
#' If \code{x} is not \code{NULL} a list is returned with one element for
#' If `x` is not `NULL` a list is returned with one element for
#' each element of x in the format:
#' \code{list(`arr_name[0]` = x[1], `arr_name[1]` = x[2], ...)}. If \code{x} is
#' \code{NULL} then \code{NULL} is returned.
#' \code{list(`arr_name[0]` = x[1], `arr_name[1]` = x[2], ...)}.
#'
#' If `x` is `NULL` then `NULL` is returned.
to_api_array <- function(x, arr_name) {
checkmate::assert_character(x , null.ok = TRUE, any.missing = FALSE)
checkmate::assert_character(arr_name, null.ok = TRUE, any.missing = FALSE, max.len = 1L, pattern = "^fields|forms$")
Expand All @@ -208,8 +209,6 @@ to_api_array <- function(x, arr_name) {
return(NULL)
} else if (is.null(arr_name)){
rlang::abort("The `arr_name` parameter cannot be null if `x` is not null.")
} else if (length(x) != length(arr_name)) {
rlang::abort("The `x` and `arr_name` arrays must be the same length.")
}

res <- as.list(x)
Expand Down
5 changes: 3 additions & 2 deletions man/to_api_array.Rd

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

0 comments on commit 6d4c425

Please sign in to comment.