Skip to content

Commit

Permalink
Scenarios added of when to add in functions to certain packages. Clea…
Browse files Browse the repository at this point in the history
…ned up functions language. Removed dev_util prefix
  • Loading branch information
bms63 committed Aug 11, 2022
1 parent 3f6c99b commit 7228d32
Show file tree
Hide file tree
Showing 22 changed files with 158 additions and 69 deletions.
17 changes: 7 additions & 10 deletions R/dev_utilities.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
#' @author Thomas Neitmann
#'
#' @keywords dev_utility
#'
#' @rdname dev_util_notin
#' @family dev_utility
#' @export
`%notin%` <- function(x, table) { # nolint
!(x %in% table)
Expand All @@ -26,8 +25,7 @@
#' @author Ondrej Slama
#'
#' @keywords dev_utility
#'
#' @rdname dev_util_convert_dtm_to_dtc
#' @family dev_utility
#' @export
convert_dtm_to_dtc <- function(dtm) {
stopifnot(lubridate::is.instant(dtm))
Expand All @@ -41,8 +39,7 @@ convert_dtm_to_dtc <- function(dtm) {
#' @author Thomas Neitmann, Ondrej Slama
#'
#' @keywords dev_utility
#'
#' @rdname dev_util_arg_name
#' @family dev_utility
#' @export
arg_name <- function(expr) { # nolint
if (length(expr) == 1L && is.symbol(expr)) {
Expand Down Expand Up @@ -70,8 +67,7 @@ arg_name <- function(expr) { # nolint
#' @author Thomas Neitmann
#'
#' @keywords dev_utility
#'
#' @rdname dev_util_extract_vars
#' @family dev_utility
#' @export
extract_vars <- function(x, side = "lhs") {
if (is.null(x)) {
Expand Down Expand Up @@ -106,8 +102,8 @@ extract_vars <- function(x, side = "lhs") {
#' @author Thomas Neitmann
#'
#' @keywords dev_utility
#' @family dev_utility
#'
#' @rdname dev_util_replace_values_by_names
#'
#' @return A list of quosures
#' @export
Expand All @@ -131,7 +127,8 @@ replace_values_by_names <- function(quosures) {
#' This function is missing in earlier version of {rlang} which is why we re-
#' implment it here.
#'
#' @noRd
#' @keywords dev_utility
#' @family dev_utility
#' @export
as_name <- function(x) {
if (is_quosure(x)) {
Expand Down
19 changes: 8 additions & 11 deletions R/quote.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
#'
#' @author Thomas Neitmann
#'
#' @keywords quo
#' @family quo
#' @keywords quote
#' @family quote
#'
#' @rdname dev_util_enumerate
#' @export
enumerate <- function(x, quote_fun = backquote, conjunction = "and") {
if (length(x) == 1L) {
Expand All @@ -29,10 +28,9 @@ enumerate <- function(x, quote_fun = backquote, conjunction = "and") {
#'
#' @author Thomas Neitmann
#'
#' @keywords quo
#' @family quo
#' @keywords quote
#' @family quote
#'
#' @rdname dev_util_backquote
#' @export
backquote <- function(x) {
paste0("`", x, "`")
Expand All @@ -44,10 +42,9 @@ backquote <- function(x) {
#'
#' @author Thomas Neitmann
#'
#' @keywords quo
#' @family quo
#' @keywords quote
#' @family quote
#'
#' @rdname dev_util_squote
#' @export
squote <- function(x) {
paste0("'", x, "'")
Expand All @@ -65,8 +62,8 @@ squote <- function(x) {
#'
#' @author Stefan Bundfuss
#'
#' @keywords quo
#' @family quo
#' @keywords quote
#' @family quote
#' @export
dquote <- function(x) {
if (is.null(x)) {
Expand Down
6 changes: 3 additions & 3 deletions R/remove_these.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
#'
#' @export
#'
#' @keywords user_utility
#' @keywords remove_utility
#'
#' @examples
#' vars2chr(vars(USUBJID, AVAL))
Expand All @@ -34,7 +34,7 @@ vars2chr <- function(quosures) {
#'
#' @export
#'
#' @keywords user_utility
#' @keywords remove_utility
#'
#' @examples
#' negate_vars(vars(USUBJID, STUDYID))
Expand All @@ -61,7 +61,7 @@ negate_vars <- function(vars = NULL) {
#'
#' @export
#'
#' @keywords user_utility
#' @keywords remove_utility
#'
filter_if <- function(dataset, filter) {
assert_data_frame(dataset)
Expand Down
4 changes: 2 additions & 2 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ADaM in R Asset Library Development Utilities

Tools for developing functions and maintaining a healthy code base within the family of admiral R packages. `{admiraldev}` is intended to be used when developing `{admiral}` or `{admiral}` extension packages.

**NOTE:** Use of this package as a standalone package is currently not recommended.
**NOTE:** This package is not intended for standalone use but rather as a central dependency for all developer utilities of `{admiral}` and its extension packages

## Installation

Expand All @@ -61,7 +61,7 @@ remotes::install_github("pharmaverse/admiraldev", ref = "devel")

## Release Schedule

`{admiraldev}` is to be official released to CRAN one week before the release of `{admiral}`. You can find the release schedule for `{admiral}` packages [here](https://github.com/pharmaverse/admiral/tree/devel#release-schedule).
`{admiraldev}` is to be officially released to CRAN one week before an official release of `{admiral}`. You can find the release schedule for `{admiral}` packages [here](https://github.com/pharmaverse/admiral/tree/devel#release-schedule).



Expand Down
29 changes: 18 additions & 11 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,26 @@ reference:
contents:
- has_keyword('test_helper')

- title: Quosure and Quoting Helper Functions
desc: Helping your quoting and quosure needs
- title: Quosure Helper Functions
desc: Helping yourquosure needs
contents:
- has_keyword('quo')

- title: Developer Utility Functions
desc: General Utilities
- title: Quoting Helper Functions
desc: Helping your quoting needs
contents:
- has_keyword('quote')

- title: Miscellaneous
desc: Utilities without a theme
contents:
- has_keyword('dev_utility')

- title: Unsure where these functions should live?
desc: Used with dataset_vignette and a few assert, is and get functions...
contents:
- has_keyword('remove_utility')

navbar:
components:
reference:
Expand All @@ -64,18 +74,15 @@ navbar:
articles:
text: Developer Guides
menu:
- text: Overview
- text: Development Process
href: articles/development_process.html
- text: -------
- text: "{admiral} development processes"
- text: Programming Strategy
href: articles/programming_strategy.html
- text: Guidance for git and GitHub Usage
href: articles/git_usage.html
- text: Writing Vignettes
href: articles/writing_vignettes.html
- text: Pull Request Review Guidance
href: articles/pr_review_guidance.html
- text: Unit Test Guidance
href: articles/unit_test_guidance.html
- text: Guidance for git and GitHub Usage
href: articles/git_usage.html
- text: Pull Request Review Guidance
href: articles/pr_review_guidance.html
9 changes: 9 additions & 0 deletions man/dev_util_arg_name.Rd → man/arg_name.Rd

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

25 changes: 25 additions & 0 deletions man/as_name.Rd

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

7 changes: 3 additions & 4 deletions man/dev_util_backquote.Rd → man/backquote.Rd

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

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

7 changes: 0 additions & 7 deletions man/dev_util_quo_c.Rd

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

7 changes: 3 additions & 4 deletions man/dquote.Rd

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

7 changes: 3 additions & 4 deletions man/dev_util_enumerate.Rd → man/enumerate.Rd

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

9 changes: 9 additions & 0 deletions man/dev_util_extract_vars.Rd → man/extract_vars.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/filter_if.Rd

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

9 changes: 9 additions & 0 deletions man/dev_util_notin.Rd → man/grapes-notin-grapes.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/negate_vars.Rd

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

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

Loading

0 comments on commit 7228d32

Please sign in to comment.