diff --git a/DESCRIPTION b/DESCRIPTION index 065ff8f..ca45f2e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,17 +1,16 @@ Package: stbl Title: Stabilize Function Arguments -Version: 0.1.0 -Authors@R: - person("Jon", "Harmon", , "jonthegeek@gmail.com", role = c("aut", "cre", "cph"), - comment = c(ORCID = "0000-0003-4781-4346")) -Description: A set of consistent, opinionated functions to quickly check - function arguments, coerce them to the desired configuration, or deliver - informative error messages when that is not possible. +Version: 0.1.1 +Authors@R: person("Jon", "Harmon", , "jonthegeek@gmail.com", role = c("aut", "cre", "cph"), + comment = c(ORCID = "0000-0003-4781-4346")) +Description: A set of consistent, opinionated functions to quickly check + function arguments, coerce them to the desired configuration, or + deliver informative error messages when that is not possible. License: MIT + file LICENSE URL: https://github.com/jonthegeek/stbl, https://jonthegeek.github.io/stbl/ BugReports: https://github.com/jonthegeek/stbl/issues -Imports: +Imports: cli, glue, rlang (>= 1.1.0), diff --git a/NEWS.md b/NEWS.md index 35f72f5..9befd36 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# stbl 0.1.1 + +* Formatting changes in DESCRIPTION and examples. + # stbl 0.1.0 * Initial CRAN submission. diff --git a/R/stabilize_chr.R b/R/stabilize_chr.R index 6604c88..c231600 100644 --- a/R/stabilize_chr.R +++ b/R/stabilize_chr.R @@ -29,7 +29,6 @@ #' @export #' #' @examples -#' # to_chr() #' to_chr("a") #' to_chr(letters) #' to_chr(1:10) @@ -37,11 +36,9 @@ #' to_chr(NULL) #' try(to_chr(NULL, allow_null = FALSE)) #' -#' # to_chr_scalar() #' to_chr_scalar("a") #' try(to_chr_scalar(letters)) #' -#' # stabilize_chr() #' stabilize_chr(letters) #' stabilize_chr(1:10) #' stabilize_chr(NULL) @@ -51,7 +48,6 @@ #' try(stabilize_chr(letters, max_size = 20)) #' try(stabilize_chr(c("hide", "find", "find", "hide"), regex = "hide")) #' -#' # stabilize_chr_scalar() #' stabilize_chr_scalar(TRUE) #' stabilize_chr_scalar("TRUE") #' try(stabilize_chr_scalar(c(TRUE, FALSE, TRUE))) diff --git a/R/stabilize_fct.R b/R/stabilize_fct.R index 5a6932f..56931f6 100644 --- a/R/stabilize_fct.R +++ b/R/stabilize_fct.R @@ -27,24 +27,20 @@ #' @export #' #' @examples -#' # to_fct #' to_fct("a") #' to_fct(1:10) #' to_fct(NULL) #' try(to_fct(letters[1:5], levels = c("a", "c"), to_na = "b")) #' -#' # to_fct_scalar #' to_fct_scalar("a") #' try(to_fct_scalar(letters)) #' -#' # stabilize_fct #' stabilize_fct(letters) #' try(stabilize_fct(NULL, allow_null = FALSE)) #' try(stabilize_fct(c("a", NA), allow_na = FALSE)) #' try(stabilize_fct(c("a", "b", "c"), min_size = 5)) #' try(stabilize_fct(c("a", "b", "c"), max_size = 2)) #' -#' # stabilize_fct_scalar #' stabilize_fct_scalar("a") #' try(stabilize_fct_scalar(letters)) #' try(stabilize_fct_scalar("c", levels = c("a", "b"))) diff --git a/R/stabilize_int.R b/R/stabilize_int.R index 5e8b8a9..5e77d4c 100644 --- a/R/stabilize_int.R +++ b/R/stabilize_int.R @@ -26,7 +26,6 @@ #' @export #' #' @examples -#' # to_int #' to_int(1:10) #' to_int("1") #' to_int(1 + 0i) @@ -35,11 +34,9 @@ #' try(to_int("1", coerce_character = FALSE)) #' try(to_int(c("1", "2", "3.1", "4", "5.2"))) #' -#' # to_int_scalar #' to_int_scalar("1") #' try(to_int_scalar(1:10)) #' -#' # stabilize_int #' stabilize_int(1:10) #' stabilize_int("1") #' stabilize_int(1 + 0i) @@ -53,7 +50,6 @@ #' try(stabilize_int(1:10, min_value = 3)) #' try(stabilize_int(1:10, max_value = 7)) #' -#' # stabilize_int_scalar #' stabilize_int_scalar(1L) #' stabilize_int_scalar("1") #' try(stabilize_int_scalar(1:10)) diff --git a/R/stabilize_lgl.R b/R/stabilize_lgl.R index 370ddbd..04681a5 100644 --- a/R/stabilize_lgl.R +++ b/R/stabilize_lgl.R @@ -16,7 +16,6 @@ #' @export #' #' @examples -#' # to_lgl #' to_lgl(TRUE) #' to_lgl("TRUE") #' to_lgl(1:10) @@ -25,11 +24,9 @@ #' try(to_lgl(letters)) #' try(to_lgl(list(TRUE))) #' -#' # to_lgl_scalar #' to_lgl_scalar("TRUE") #' try(to_lgl_scalar(c(TRUE, FALSE))) #' -#' # stabilize_lgl #' stabilize_lgl(c(TRUE, FALSE, TRUE)) #' stabilize_lgl("true") #' stabilize_lgl(NULL) @@ -39,7 +36,6 @@ #' try(stabilize_lgl(c(TRUE, FALSE, TRUE), min_size = 5)) #' try(stabilize_lgl(c(TRUE, FALSE, TRUE), max_size = 2)) #' -#' # stabilize_lgl_scalar #' stabilize_lgl_scalar(TRUE) #' stabilize_lgl_scalar("TRUE") #' try(stabilize_lgl_scalar(c(TRUE, FALSE, TRUE))) diff --git a/man/stabilize_chr.Rd b/man/stabilize_chr.Rd index 8cf8268..f891422 100644 --- a/man/stabilize_chr.Rd +++ b/man/stabilize_chr.Rd @@ -109,7 +109,6 @@ that this is the expected behavior, use \code{as.character()} instead. } } \examples{ -# to_chr() to_chr("a") to_chr(letters) to_chr(1:10) @@ -117,11 +116,9 @@ to_chr(1 + 0i) to_chr(NULL) try(to_chr(NULL, allow_null = FALSE)) -# to_chr_scalar() to_chr_scalar("a") try(to_chr_scalar(letters)) -# stabilize_chr() stabilize_chr(letters) stabilize_chr(1:10) stabilize_chr(NULL) @@ -131,7 +128,6 @@ try(stabilize_chr(letters, min_size = 50)) try(stabilize_chr(letters, max_size = 20)) try(stabilize_chr(c("hide", "find", "find", "hide"), regex = "hide")) -# stabilize_chr_scalar() stabilize_chr_scalar(TRUE) stabilize_chr_scalar("TRUE") try(stabilize_chr_scalar(c(TRUE, FALSE, TRUE))) diff --git a/man/stabilize_fct.Rd b/man/stabilize_fct.Rd index 44abc00..0c0fd93 100644 --- a/man/stabilize_fct.Rd +++ b/man/stabilize_fct.Rd @@ -114,24 +114,20 @@ supplied in the \code{to_na} argument. } } \examples{ -# to_fct to_fct("a") to_fct(1:10) to_fct(NULL) try(to_fct(letters[1:5], levels = c("a", "c"), to_na = "b")) -# to_fct_scalar to_fct_scalar("a") try(to_fct_scalar(letters)) -# stabilize_fct stabilize_fct(letters) try(stabilize_fct(NULL, allow_null = FALSE)) try(stabilize_fct(c("a", NA), allow_na = FALSE)) try(stabilize_fct(c("a", "b", "c"), min_size = 5)) try(stabilize_fct(c("a", "b", "c"), max_size = 2)) -# stabilize_fct_scalar stabilize_fct_scalar("a") try(stabilize_fct_scalar(letters)) try(stabilize_fct_scalar("c", levels = c("a", "b"))) diff --git a/man/stabilize_int.Rd b/man/stabilize_int.Rd index eb51689..5743a52 100644 --- a/man/stabilize_int.Rd +++ b/man/stabilize_int.Rd @@ -117,7 +117,6 @@ than \code{to_int()}. length-1 integer vectors. } \examples{ -# to_int to_int(1:10) to_int("1") to_int(1 + 0i) @@ -126,11 +125,9 @@ try(to_int(c(1, 2, 3.1, 4, 5.2))) try(to_int("1", coerce_character = FALSE)) try(to_int(c("1", "2", "3.1", "4", "5.2"))) -# to_int_scalar to_int_scalar("1") try(to_int_scalar(1:10)) -# stabilize_int stabilize_int(1:10) stabilize_int("1") stabilize_int(1 + 0i) @@ -144,7 +141,6 @@ try(stabilize_int(factor("1"), coerce_factor = FALSE)) try(stabilize_int(1:10, min_value = 3)) try(stabilize_int(1:10, max_value = 7)) -# stabilize_int_scalar stabilize_int_scalar(1L) stabilize_int_scalar("1") try(stabilize_int_scalar(1:10)) diff --git a/man/stabilize_lgl.Rd b/man/stabilize_lgl.Rd index af14f01..476edd9 100644 --- a/man/stabilize_lgl.Rd +++ b/man/stabilize_lgl.Rd @@ -91,7 +91,6 @@ than \code{to_lgl()}. length-1 logical vectors. } \examples{ -# to_lgl to_lgl(TRUE) to_lgl("TRUE") to_lgl(1:10) @@ -100,11 +99,9 @@ try(to_lgl(NULL, allow_null = FALSE)) try(to_lgl(letters)) try(to_lgl(list(TRUE))) -# to_lgl_scalar to_lgl_scalar("TRUE") try(to_lgl_scalar(c(TRUE, FALSE))) -# stabilize_lgl stabilize_lgl(c(TRUE, FALSE, TRUE)) stabilize_lgl("true") stabilize_lgl(NULL) @@ -114,7 +111,6 @@ try(stabilize_lgl(letters)) try(stabilize_lgl(c(TRUE, FALSE, TRUE), min_size = 5)) try(stabilize_lgl(c(TRUE, FALSE, TRUE), max_size = 2)) -# stabilize_lgl_scalar stabilize_lgl_scalar(TRUE) stabilize_lgl_scalar("TRUE") try(stabilize_lgl_scalar(c(TRUE, FALSE, TRUE)))