diff --git a/.Rbuildignore b/.Rbuildignore index 375e1c988..1fc50bef5 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,3 +1,4 @@ ^cardinal\.Rproj$ ^\.Rproj\.user$ ^LICENSE\.md$ +^README\.Rmd$ diff --git a/DESCRIPTION b/DESCRIPTION index fc1ed5abb..55de12ce1 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -9,7 +9,10 @@ License: MIT + file LICENSE Imports: cli (>= 3.6.1), dplyr (>= 1.1.2), - rlang (>= 1.1.1) + rlang (>= 1.1.1), + tidyr (>= 1.3.0) +Suggests: + broom Encoding: UTF-8 Roxygen: list(markdown = TRUE) RoxygenNote: 7.2.3 diff --git a/NAMESPACE b/NAMESPACE index b7bc75d4a..e8da0f285 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -1,3 +1,30 @@ # Generated by roxygen2: do not edit by hand +export("%>%") +export(all_of) +export(any_of) +export(ard_categorical) +export(ard_continuous) +export(ard_ttest) +export(contains) +export(ends_with) +export(everything) +export(last_col) +export(matches) +export(num_range) +export(one_of) +export(starts_with) +export(vars) +importFrom(dplyr,"%>%") +importFrom(dplyr,all_of) +importFrom(dplyr,any_of) +importFrom(dplyr,contains) +importFrom(dplyr,ends_with) +importFrom(dplyr,everything) +importFrom(dplyr,last_col) +importFrom(dplyr,matches) +importFrom(dplyr,num_range) +importFrom(dplyr,one_of) +importFrom(dplyr,starts_with) +importFrom(dplyr,vars) importFrom(rlang,"%||%") diff --git a/R/ard_comparison.R b/R/ard_comparison.R new file mode 100644 index 000000000..6cb9e97e0 --- /dev/null +++ b/R/ard_comparison.R @@ -0,0 +1,43 @@ +#' Comparison ARD Statistics +#' +#' @param data a data frame +#' @param by charcter column name to compare by +#' @param variable charadter column name to be compared +#' @param ... arguments passed to method. +#' +#' @return data frame +#' @name ard_comparison +#' +#' @examples +#' ard_ttest(data = mtcars, by = "am", variable = "hp") +NULL + +#' @rdname ard_comparison +#' @export +ard_ttest <- function(data, by, variable, conf.level = 0.95, ...) { + # check installed packages --------------------------------------------------- + rlang::check_installed("broom") + + # perform t-test and format results ------------------------------------------ + stats::t.test(data[[variable]] ~ data[[by]], conf.level = conf.level, ...) |> + broom::tidy() |> + dplyr::mutate( + conf.level = conf.level, + dplyr::across(everything(), .fns = list), + strata1 = by, + variable = variable, + context = "ttest" + ) |> + tidyr::pivot_longer( + cols = -c("strata1", "variable", "context"), + names_to = "stat_name", + values_to = "statistic" + ) |> + dplyr::mutate( + strata1_level = + dplyr::case_when( + .data$stat_name %in% "estimate1" ~ unique(data[[by]]) |> stats::na.omit() |> sort() |> dplyr::first() |> list(), + .data$stat_name %in% "estimate2" ~ unique(data[[by]]) |> stats::na.omit() |>sort() |> dplyr::last() |> list(), + ) + ) +} diff --git a/R/ard_simple.R b/R/ard_simple.R new file mode 100644 index 000000000..0b0683981 --- /dev/null +++ b/R/ard_simple.R @@ -0,0 +1,162 @@ +#' Simple ARD Statistics +#' +#' Compute Analysis Results Data (ARD) for simple summary statistics from +#' continuous and categorical data. +#' +#' @param data a data frame +#' @param by columns to compute statistics by. Default are the columns +#' returned by `dplyr::group_vars(data)`. +#' @param statistics a named list of functions that return a summary statistic, +#' e.g. `list(mpg = list(mean = \(x) mean(x, na.rm = TRUE)))` +#' @param include columns to include in summaries. Default is `everything()`. +#' +#' @return a data frame +#' @name ard_simple +#' +#' @examples +#' ard_continuous(mtcars, by = cyl, include = c(mpg, hp)) +#' ard_categorical(mtcars, by = cyl, include = c(am, gear)) +NULL + +#' @rdname ard_simple +#' @export +ard_continuous <- function(data, by = dplyr::group_vars(data), statistics = NULL, include = everything()) { + # process arguments ----------------------------------------------------------- + by <- dplyr::select(data, {{ by }}) |> colnames() + all_summary_variables <- dplyr::select(data, {{ include }}) |> colnames() |> setdiff(by) + data <- dplyr::ungroup(data) + + # check inputs (will make this more robust later) ---------------------------- + + # setting default statistics ------------------------------------------------- + statistics <- + all_summary_variables |> + lapply(function(x) statistics[[x]] %||% .default_continuous_statistics()) |> + stats::setNames(nm = all_summary_variables) + + df_statsistics <- + lapply( + X = all_summary_variables, + FUN = function(x) { + dplyr::tibble( + variable = x, + stat_name = names(statistics[[x]]) + ) + } + ) |> + dplyr::bind_rows() + + # calculate statistics ------------------------------------------------------- + data |> + tidyr::nest( + .by = all_of(by), + .key = "...ard_nested_data..." + ) |> + # setting column names for stratum levels + dplyr::mutate(!!!(list(by) |> stats::setNames(paste0("strata", seq_along(by)))), .before = 0L) |> + dplyr::rename(!!!(list(by) |> stats::setNames(paste0("strata", seq_along(by), "_levels")))) |> + dplyr::mutate( + ..ard_all_stats.. = + lapply( + .data[["...ard_nested_data..."]], + FUN = function(nested_data) { + df_statsistics |> + dplyr::mutate( + statistic = + .mapply( + FUN = function(variable, stat_name) { + do.call(statistics[[variable]][[stat_name]], args = list(nested_data[[variable]])) + }, + dots = + list( + df_statsistics$variable, + df_statsistics$stat_name + ), + MoreArgs = NULL + ) + ) + } + ) + ) |> + dplyr::select(-"...ard_nested_data...") |> + tidyr::unnest(cols = "..ard_all_stats..") |> + dplyr::mutate(context = "continuous") +} + +#' @rdname ard_simple +#' @export +ard_categorical <- function(data, by = dplyr::group_vars(data), include = everything()) { + # process arguments ----------------------------------------------------------- + by <- dplyr::select(data, {{ by }}) |> colnames() + all_summary_variables <- dplyr::select(data, {{ include }}) |> colnames() |> setdiff(by) + data <- dplyr::ungroup(data) + + # check inputs (will make this more robust later) ---------------------------- + + # calculating summary stats -------------------------------------------------- + # first, calculating variable-level stats + statistics <- + rep_len( + list(.default_continuous_statistics()[c("N", "N_miss", "N_tot")]), + length.out = length(all_summary_variables) + ) |> + stats::setNames(nm = all_summary_variables) + + df_ard <- + ard_continuous(data = data, by = !!all_of(by), statistics = statistics, include = !!all_of(all_summary_variables)) + + # second, tabulate variable + df_ard_tablulation <- + lapply( + X = all_summary_variables, + FUN = function(x) { + ard_continuous( + data = data |> dplyr::select(all_of(c(by, x))) |> tidyr::drop_na(), + by = !!all_of(by), + statistics = + list( + table = function(x) { + dplyr::tibble( + variable_level = unique(x) |> sort(), + n = table(x) |> as.integer(), + p = .data$n / sum(.data$n) + ) + } + ) |> + list() |> + setNames(nm = x) + ) |> + dplyr::select(-"stat_name") |> + tidyr::unnest(cols = "statistic") |> + dplyr::mutate( + dplyr::across(c("variable_level", "n", "p"), .fns = as.list) + ) |> + tidyr::pivot_longer( + cols = c("n", "p"), + names_to = "stat_name", + values_to = "statistic" + ) + } + ) |> + dplyr::bind_rows() + + # bind data frames with stats, and return to user ---------------------------- + dplyr::bind_rows(df_ard_tablulation, df_ard) |> + dplyr::mutate(context = "categorical") +} + + + + + +.default_continuous_statistics <- function() { + list( + N = function(x) sum(!is.na(x)), + N_miss = function(x) sum(is.na(x)), + N_tot = function(x) length(x), + mean = function(x) mean(x, na.rm = TRUE), + sd = function(x) sd(x, na.rm = TRUE), + min = function(x) min(x, na.rm = TRUE), + max = function(x) max(x, na.rm = TRUE) + ) +} diff --git a/R/reexports.R b/R/reexports.R new file mode 100644 index 000000000..c9d592d95 --- /dev/null +++ b/R/reexports.R @@ -0,0 +1,49 @@ +# dplyr ------------------------------------------------------------------------ +#' @export +#' @importFrom dplyr %>% +dplyr::`%>%` + +#' @importFrom dplyr starts_with +#' @export +dplyr::starts_with + +#' @importFrom dplyr ends_with +#' @export +dplyr::ends_with + +#' @importFrom dplyr contains +#' @export +dplyr::contains + +#' @importFrom dplyr matches +#' @export +dplyr::matches + +#' @importFrom dplyr num_range +#' @export +dplyr::num_range + +#' @importFrom dplyr all_of +#' @export +dplyr::all_of + +#' @importFrom dplyr any_of +#' @export +dplyr::any_of + +#' @importFrom dplyr everything +#' @export +dplyr::everything + +#' @importFrom dplyr last_col +#' @export +dplyr::last_col + +#' @importFrom dplyr one_of +#' @export +dplyr::one_of + +#' @importFrom dplyr vars +#' @export +dplyr::vars + diff --git a/R/utils.R b/R/utils.R new file mode 100644 index 000000000..e69de29bb diff --git a/README.Rmd b/README.Rmd new file mode 100644 index 000000000..192701b8c --- /dev/null +++ b/README.Rmd @@ -0,0 +1,51 @@ +--- +output: github_document +--- + + + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>", + fig.path = "man/figures/README-", + out.width = "100%" +) +``` + +# cardinal + + + + +The goal of cardinal is to ... + +## Installation + +You can install the development version of cardinal from [GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("insightsengineering/cardinal") +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +```{r example} +library(cardinal) + +ard_continuous(mtcars, by = cyl, include = c(mpg, hp)) |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), unlist)) + +ard_categorical(mtcars, by = cyl, include = c(am, gear)) |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), ~lapply(., \(x) if (!is.null(x)) x else NA) |> unlist())) + +ard_ttest(data = mtcars, by = "am", variable = "hp") |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), ~lapply(., \(x) if (!is.null(x)) x else NA) |> unlist())) +``` + diff --git a/README.md b/README.md new file mode 100644 index 000000000..425c733da --- /dev/null +++ b/README.md @@ -0,0 +1,81 @@ + + + +# cardinal + + + + +The goal of cardinal is to … + +## Installation + +You can install the development version of cardinal from +[GitHub](https://github.com/) with: + +``` r +# install.packages("devtools") +devtools::install_github("insightsengineering/cardinal") +``` + +## Example + +This is a basic example which shows you how to solve a common problem: + +``` r +library(cardinal) + +ard_continuous(mtcars, by = cyl, include = c(mpg, hp)) |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), unlist)) +#> # A tibble: 42 × 6 +#> strata1 strata1_levels variable stat_name statistic context +#> +#> 1 cyl 6 mpg N 7 continuous +#> 2 cyl 6 mpg N_miss 0 continuous +#> 3 cyl 6 mpg N_tot 7 continuous +#> 4 cyl 6 mpg mean 19.7 continuous +#> 5 cyl 6 mpg sd 1.45 continuous +#> 6 cyl 6 mpg min 17.8 continuous +#> 7 cyl 6 mpg max 21.4 continuous +#> 8 cyl 6 hp N 7 continuous +#> 9 cyl 6 hp N_miss 0 continuous +#> 10 cyl 6 hp N_tot 7 continuous +#> # ℹ 32 more rows + +ard_categorical(mtcars, by = cyl, include = c(am, gear)) |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), ~lapply(., \(x) if (!is.null(x)) x else NA) |> unlist())) +#> # A tibble: 46 × 7 +#> strata1 strata1_levels variable variable_level context stat_name statistic +#> +#> 1 cyl 6 am 0 categoric… n 4 +#> 2 cyl 6 am 0 categoric… p 0.571 +#> 3 cyl 6 am 1 categoric… n 3 +#> 4 cyl 6 am 1 categoric… p 0.429 +#> 5 cyl 4 am 0 categoric… n 3 +#> 6 cyl 4 am 0 categoric… p 0.273 +#> 7 cyl 4 am 1 categoric… n 8 +#> 8 cyl 4 am 1 categoric… p 0.727 +#> 9 cyl 8 am 0 categoric… n 12 +#> 10 cyl 8 am 0 categoric… p 0.857 +#> # ℹ 36 more rows + +ard_ttest(data = mtcars, by = "am", variable = "hp") |> + # convert list columns to character for a nicer print + dplyr::mutate(across(where(is.list), ~lapply(., \(x) if (!is.null(x)) x else NA) |> unlist())) +#> # A tibble: 11 × 6 +#> strata1 variable context stat_name statistic strata1_level +#> +#> 1 am hp ttest estimate 33.417004048583 NA +#> 2 am hp ttest estimate1 160.263157894737 0 +#> 3 am hp ttest estimate2 126.846153846154 1 +#> 4 am hp ttest statistic 1.26618876980934 NA +#> 5 am hp ttest p.value 0.220979581335913 NA +#> 6 am hp ttest parameter 18.7154096625045 NA +#> 7 am hp ttest conf.low -21.8785802016468 NA +#> 8 am hp ttest conf.high 88.7125882988128 NA +#> 9 am hp ttest method Welch Two Sample t-test NA +#> 10 am hp ttest alternative two.sided NA +#> 11 am hp ttest conf.level 0.95 NA +``` diff --git a/docs/404.html b/docs/404.html new file mode 100644 index 000000000..c884dd85f --- /dev/null +++ b/docs/404.html @@ -0,0 +1,93 @@ + + + + + + + +Page not found (404) • cardinal + + + + + + + + + + + +
+
+ + + + +
+
+ + +Content not found. Please use links in the navbar. + +
+ + + +
+ + + +
+ +
+

+

Site built with pkgdown 2.0.7.

+
+ +
+
+ + + + + + + + diff --git a/docs/LICENSE-text.html b/docs/LICENSE-text.html new file mode 100644 index 000000000..bc92f8b94 --- /dev/null +++ b/docs/LICENSE-text.html @@ -0,0 +1,70 @@ + +License • cardinal + + +
+
+ + + +
+
+ + +
YEAR: 2023
+COPYRIGHT HOLDER: cardinal authors
+
+ +
+ + + +
+ + + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/LICENSE.html b/docs/LICENSE.html new file mode 100644 index 000000000..f8fbc197f --- /dev/null +++ b/docs/LICENSE.html @@ -0,0 +1,74 @@ + +MIT License • cardinal + + +
+
+ + + +
+
+ + +
+ +

Copyright (c) 2023 cardinal authors

+

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

+

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

+

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+
+ +
+ + + +
+ + + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/authors.html b/docs/authors.html new file mode 100644 index 000000000..4fd2b628e --- /dev/null +++ b/docs/authors.html @@ -0,0 +1,88 @@ + +Authors and Citation • cardinal + + +
+
+ + + +
+
+
+ + + +
  • +

    Daniel D. Sjoberg. Author, maintainer. +

    +
  • +
+
+
+

Citation

+ +
+
+ + +

Sjoberg D (2023). +cardinal: CDISC Aanalys Results Data. +R package version 0.0.0.9000. +

+
@Manual{,
+  title = {cardinal: CDISC Aanalys Results Data},
+  author = {Daniel D. Sjoberg},
+  year = {2023},
+  note = {R package version 0.0.0.9000},
+}
+ +
+ +
+ + + +
+ +
+

Site built with pkgdown 2.0.7.

+
+ +
+ + + + + + + + diff --git a/docs/bootstrap-toc.css b/docs/bootstrap-toc.css new file mode 100644 index 000000000..5a859415c --- /dev/null +++ b/docs/bootstrap-toc.css @@ -0,0 +1,60 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ + +/* modified from https://github.com/twbs/bootstrap/blob/94b4076dd2efba9af71f0b18d4ee4b163aa9e0dd/docs/assets/css/src/docs.css#L548-L601 */ + +/* All levels of nav */ +nav[data-toggle='toc'] .nav > li > a { + display: block; + padding: 4px 20px; + font-size: 13px; + font-weight: 500; + color: #767676; +} +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 19px; + color: #563d7c; + text-decoration: none; + background-color: transparent; + border-left: 1px solid #563d7c; +} +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 18px; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-left: 2px solid #563d7c; +} + +/* Nav: second level (shown on .active) */ +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} +nav[data-toggle='toc'] .nav .nav > li > a { + padding-top: 1px; + padding-bottom: 1px; + padding-left: 30px; + font-size: 12px; + font-weight: normal; +} +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 29px; +} +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 28px; + font-weight: 500; +} + +/* from https://github.com/twbs/bootstrap/blob/e38f066d8c203c3e032da0ff23cd2d6098ee2dd6/docs/assets/css/src/docs.css#L631-L634 */ +nav[data-toggle='toc'] .nav > .active > ul { + display: block; +} diff --git a/docs/bootstrap-toc.js b/docs/bootstrap-toc.js new file mode 100644 index 000000000..1cdd573b2 --- /dev/null +++ b/docs/bootstrap-toc.js @@ -0,0 +1,159 @@ +/*! + * Bootstrap Table of Contents v0.4.1 (http://afeld.github.io/bootstrap-toc/) + * Copyright 2015 Aidan Feldman + * Licensed under MIT (https://github.com/afeld/bootstrap-toc/blob/gh-pages/LICENSE.md) */ +(function() { + 'use strict'; + + window.Toc = { + helpers: { + // return all matching elements in the set, or their descendants + findOrFilter: function($el, selector) { + // http://danielnouri.org/notes/2011/03/14/a-jquery-find-that-also-finds-the-root-element/ + // http://stackoverflow.com/a/12731439/358804 + var $descendants = $el.find(selector); + return $el.filter(selector).add($descendants).filter(':not([data-toc-skip])'); + }, + + generateUniqueIdBase: function(el) { + var text = $(el).text(); + var anchor = text.trim().toLowerCase().replace(/[^A-Za-z0-9]+/g, '-'); + return anchor || el.tagName.toLowerCase(); + }, + + generateUniqueId: function(el) { + var anchorBase = this.generateUniqueIdBase(el); + for (var i = 0; ; i++) { + var anchor = anchorBase; + if (i > 0) { + // add suffix + anchor += '-' + i; + } + // check if ID already exists + if (!document.getElementById(anchor)) { + return anchor; + } + } + }, + + generateAnchor: function(el) { + if (el.id) { + return el.id; + } else { + var anchor = this.generateUniqueId(el); + el.id = anchor; + return anchor; + } + }, + + createNavList: function() { + return $(''); + }, + + createChildNavList: function($parent) { + var $childList = this.createNavList(); + $parent.append($childList); + return $childList; + }, + + generateNavEl: function(anchor, text) { + var $a = $(''); + $a.attr('href', '#' + anchor); + $a.text(text); + var $li = $('
  • '); + $li.append($a); + return $li; + }, + + generateNavItem: function(headingEl) { + var anchor = this.generateAnchor(headingEl); + var $heading = $(headingEl); + var text = $heading.data('toc-text') || $heading.text(); + return this.generateNavEl(anchor, text); + }, + + // Find the first heading level (`

    `, then `

    `, etc.) that has more than one element. Defaults to 1 (for `

    `). + getTopLevel: function($scope) { + for (var i = 1; i <= 6; i++) { + var $headings = this.findOrFilter($scope, 'h' + i); + if ($headings.length > 1) { + return i; + } + } + + return 1; + }, + + // returns the elements for the top level, and the next below it + getHeadings: function($scope, topLevel) { + var topSelector = 'h' + topLevel; + + var secondaryLevel = topLevel + 1; + var secondarySelector = 'h' + secondaryLevel; + + return this.findOrFilter($scope, topSelector + ',' + secondarySelector); + }, + + getNavLevel: function(el) { + return parseInt(el.tagName.charAt(1), 10); + }, + + populateNav: function($topContext, topLevel, $headings) { + var $context = $topContext; + var $prevNav; + + var helpers = this; + $headings.each(function(i, el) { + var $newNav = helpers.generateNavItem(el); + var navLevel = helpers.getNavLevel(el); + + // determine the proper $context + if (navLevel === topLevel) { + // use top level + $context = $topContext; + } else if ($prevNav && $context === $topContext) { + // create a new level of the tree and switch to it + $context = helpers.createChildNavList($prevNav); + } // else use the current $context + + $context.append($newNav); + + $prevNav = $newNav; + }); + }, + + parseOps: function(arg) { + var opts; + if (arg.jquery) { + opts = { + $nav: arg + }; + } else { + opts = arg; + } + opts.$scope = opts.$scope || $(document.body); + return opts; + } + }, + + // accepts a jQuery object, or an options object + init: function(opts) { + opts = this.helpers.parseOps(opts); + + // ensure that the data attribute is in place for styling + opts.$nav.attr('data-toggle', 'toc'); + + var $topContext = this.helpers.createChildNavList(opts.$nav); + var topLevel = this.helpers.getTopLevel(opts.$scope); + var $headings = this.helpers.getHeadings(opts.$scope, topLevel); + this.helpers.populateNav($topContext, topLevel, $headings); + } + }; + + $(function() { + $('nav[data-toggle="toc"]').each(function(i, el) { + var $nav = $(el); + Toc.init($nav); + }); + }); +})(); diff --git a/docs/docsearch.css b/docs/docsearch.css new file mode 100644 index 000000000..e5f1fe1df --- /dev/null +++ b/docs/docsearch.css @@ -0,0 +1,148 @@ +/* Docsearch -------------------------------------------------------------- */ +/* + Source: https://github.com/algolia/docsearch/ + License: MIT +*/ + +.algolia-autocomplete { + display: block; + -webkit-box-flex: 1; + -ms-flex: 1; + flex: 1 +} + +.algolia-autocomplete .ds-dropdown-menu { + width: 100%; + min-width: none; + max-width: none; + padding: .75rem 0; + background-color: #fff; + background-clip: padding-box; + border: 1px solid rgba(0, 0, 0, .1); + box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .175); +} + +@media (min-width:768px) { + .algolia-autocomplete .ds-dropdown-menu { + width: 175% + } +} + +.algolia-autocomplete .ds-dropdown-menu::before { + display: none +} + +.algolia-autocomplete .ds-dropdown-menu [class^=ds-dataset-] { + padding: 0; + background-color: rgb(255,255,255); + border: 0; + max-height: 80vh; +} + +.algolia-autocomplete .ds-dropdown-menu .ds-suggestions { + margin-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion { + padding: 0; + overflow: visible +} + +.algolia-autocomplete .algolia-docsearch-suggestion--category-header { + padding: .125rem 1rem; + margin-top: 0; + font-size: 1.3em; + font-weight: 500; + color: #00008B; + border-bottom: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--wrapper { + float: none; + padding-top: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column { + float: none; + width: auto; + padding: 0; + text-align: left +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content { + float: none; + width: auto; + padding: 0 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--content::before { + display: none +} + +.algolia-autocomplete .ds-suggestion:not(:first-child) .algolia-docsearch-suggestion--category-header { + padding-top: .75rem; + margin-top: .75rem; + border-top: 1px solid rgba(0, 0, 0, .1) +} + +.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column { + display: block; + padding: .1rem 1rem; + margin-bottom: 0.1; + font-size: 1.0em; + font-weight: 400 + /* display: none */ +} + +.algolia-autocomplete .algolia-docsearch-suggestion--title { + display: block; + padding: .25rem 1rem; + margin-bottom: 0; + font-size: 0.9em; + font-weight: 400 +} + +.algolia-autocomplete .algolia-docsearch-suggestion--text { + padding: 0 1rem .5rem; + margin-top: -.25rem; + font-size: 0.8em; + font-weight: 400; + line-height: 1.25 +} + +.algolia-autocomplete .algolia-docsearch-footer { + width: 110px; + height: 20px; + z-index: 3; + margin-top: 10.66667px; + float: right; + font-size: 0; + line-height: 0; +} + +.algolia-autocomplete .algolia-docsearch-footer--logo { + background-image: url("data:image/svg+xml;utf8,"); + background-repeat: no-repeat; + background-position: 50%; + background-size: 100%; + overflow: hidden; + text-indent: -9000px; + width: 100%; + height: 100%; + display: block; + transform: translate(-8px); +} + +.algolia-autocomplete .algolia-docsearch-suggestion--highlight { + color: #FF8C00; + background: rgba(232, 189, 54, 0.1) +} + + +.algolia-autocomplete .algolia-docsearch-suggestion--text .algolia-docsearch-suggestion--highlight { + box-shadow: inset 0 -2px 0 0 rgba(105, 105, 105, .5) +} + +.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content { + background-color: rgba(192, 192, 192, .15) +} diff --git a/docs/docsearch.js b/docs/docsearch.js new file mode 100644 index 000000000..b35504cd3 --- /dev/null +++ b/docs/docsearch.js @@ -0,0 +1,85 @@ +$(function() { + + // register a handler to move the focus to the search bar + // upon pressing shift + "/" (i.e. "?") + $(document).on('keydown', function(e) { + if (e.shiftKey && e.keyCode == 191) { + e.preventDefault(); + $("#search-input").focus(); + } + }); + + $(document).ready(function() { + // do keyword highlighting + /* modified from https://jsfiddle.net/julmot/bL6bb5oo/ */ + var mark = function() { + + var referrer = document.URL ; + var paramKey = "q" ; + + if (referrer.indexOf("?") !== -1) { + var qs = referrer.substr(referrer.indexOf('?') + 1); + var qs_noanchor = qs.split('#')[0]; + var qsa = qs_noanchor.split('&'); + var keyword = ""; + + for (var i = 0; i < qsa.length; i++) { + var currentParam = qsa[i].split('='); + + if (currentParam.length !== 2) { + continue; + } + + if (currentParam[0] == paramKey) { + keyword = decodeURIComponent(currentParam[1].replace(/\+/g, "%20")); + } + } + + if (keyword !== "") { + $(".contents").unmark({ + done: function() { + $(".contents").mark(keyword); + } + }); + } + } + }; + + mark(); + }); +}); + +/* Search term highlighting ------------------------------*/ + +function matchedWords(hit) { + var words = []; + + var hierarchy = hit._highlightResult.hierarchy; + // loop to fetch from lvl0, lvl1, etc. + for (var idx in hierarchy) { + words = words.concat(hierarchy[idx].matchedWords); + } + + var content = hit._highlightResult.content; + if (content) { + words = words.concat(content.matchedWords); + } + + // return unique words + var words_uniq = [...new Set(words)]; + return words_uniq; +} + +function updateHitURL(hit) { + + var words = matchedWords(hit); + var url = ""; + + if (hit.anchor) { + url = hit.url_without_anchor + '?q=' + escape(words.join(" ")) + '#' + hit.anchor; + } else { + url = hit.url + '?q=' + escape(words.join(" ")); + } + + return url; +} diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 000000000..1f6d927ce --- /dev/null +++ b/docs/index.html @@ -0,0 +1,110 @@ + + + + + + + +CDISC Aanalys Results Data • cardinal + + + + + + + + + + + + +
    +
    + + + + +
    +
    +What the package does (one paragraph). +
    + + +
    + + +
    + +
    +

    +

    Site built with pkgdown 2.0.7.

    +
    + +
    +
    + + + + + + + + diff --git a/docs/link.svg b/docs/link.svg new file mode 100644 index 000000000..88ad82769 --- /dev/null +++ b/docs/link.svg @@ -0,0 +1,12 @@ + + + + + + diff --git a/docs/pkgdown.css b/docs/pkgdown.css new file mode 100644 index 000000000..80ea5b838 --- /dev/null +++ b/docs/pkgdown.css @@ -0,0 +1,384 @@ +/* Sticky footer */ + +/** + * Basic idea: https://philipwalton.github.io/solved-by-flexbox/demos/sticky-footer/ + * Details: https://github.com/philipwalton/solved-by-flexbox/blob/master/assets/css/components/site.css + * + * .Site -> body > .container + * .Site-content -> body > .container .row + * .footer -> footer + * + * Key idea seems to be to ensure that .container and __all its parents__ + * have height set to 100% + * + */ + +html, body { + height: 100%; +} + +body { + position: relative; +} + +body > .container { + display: flex; + height: 100%; + flex-direction: column; +} + +body > .container .row { + flex: 1 0 auto; +} + +footer { + margin-top: 45px; + padding: 35px 0 36px; + border-top: 1px solid #e5e5e5; + color: #666; + display: flex; + flex-shrink: 0; +} +footer p { + margin-bottom: 0; +} +footer div { + flex: 1; +} +footer .pkgdown { + text-align: right; +} +footer p { + margin-bottom: 0; +} + +img.icon { + float: right; +} + +/* Ensure in-page images don't run outside their container */ +.contents img { + max-width: 100%; + height: auto; +} + +/* Fix bug in bootstrap (only seen in firefox) */ +summary { + display: list-item; +} + +/* Typographic tweaking ---------------------------------*/ + +.contents .page-header { + margin-top: calc(-60px + 1em); +} + +dd { + margin-left: 3em; +} + +/* Section anchors ---------------------------------*/ + +a.anchor { + display: none; + margin-left: 5px; + width: 20px; + height: 20px; + + background-image: url(./link.svg); + background-repeat: no-repeat; + background-size: 20px 20px; + background-position: center center; +} + +h1:hover .anchor, +h2:hover .anchor, +h3:hover .anchor, +h4:hover .anchor, +h5:hover .anchor, +h6:hover .anchor { + display: inline-block; +} + +/* Fixes for fixed navbar --------------------------*/ + +.contents h1, .contents h2, .contents h3, .contents h4 { + padding-top: 60px; + margin-top: -40px; +} + +/* Navbar submenu --------------------------*/ + +.dropdown-submenu { + position: relative; +} + +.dropdown-submenu>.dropdown-menu { + top: 0; + left: 100%; + margin-top: -6px; + margin-left: -1px; + border-radius: 0 6px 6px 6px; +} + +.dropdown-submenu:hover>.dropdown-menu { + display: block; +} + +.dropdown-submenu>a:after { + display: block; + content: " "; + float: right; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; + border-width: 5px 0 5px 5px; + border-left-color: #cccccc; + margin-top: 5px; + margin-right: -10px; +} + +.dropdown-submenu:hover>a:after { + border-left-color: #ffffff; +} + +.dropdown-submenu.pull-left { + float: none; +} + +.dropdown-submenu.pull-left>.dropdown-menu { + left: -100%; + margin-left: 10px; + border-radius: 6px 0 6px 6px; +} + +/* Sidebar --------------------------*/ + +#pkgdown-sidebar { + margin-top: 30px; + position: -webkit-sticky; + position: sticky; + top: 70px; +} + +#pkgdown-sidebar h2 { + font-size: 1.5em; + margin-top: 1em; +} + +#pkgdown-sidebar h2:first-child { + margin-top: 0; +} + +#pkgdown-sidebar .list-unstyled li { + margin-bottom: 0.5em; +} + +/* bootstrap-toc tweaks ------------------------------------------------------*/ + +/* All levels of nav */ + +nav[data-toggle='toc'] .nav > li > a { + padding: 4px 20px 4px 6px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; +} + +nav[data-toggle='toc'] .nav > li > a:hover, +nav[data-toggle='toc'] .nav > li > a:focus { + padding-left: 5px; + color: inherit; + border-left: 1px solid #878787; +} + +nav[data-toggle='toc'] .nav > .active > a, +nav[data-toggle='toc'] .nav > .active:hover > a, +nav[data-toggle='toc'] .nav > .active:focus > a { + padding-left: 5px; + font-size: 1.5rem; + font-weight: 400; + color: inherit; + border-left: 2px solid #878787; +} + +/* Nav: second level (shown on .active) */ + +nav[data-toggle='toc'] .nav .nav { + display: none; /* Hide by default, but at >768px, show it */ + padding-bottom: 10px; +} + +nav[data-toggle='toc'] .nav .nav > li > a { + padding-left: 16px; + font-size: 1.35rem; +} + +nav[data-toggle='toc'] .nav .nav > li > a:hover, +nav[data-toggle='toc'] .nav .nav > li > a:focus { + padding-left: 15px; +} + +nav[data-toggle='toc'] .nav .nav > .active > a, +nav[data-toggle='toc'] .nav .nav > .active:hover > a, +nav[data-toggle='toc'] .nav .nav > .active:focus > a { + padding-left: 15px; + font-weight: 500; + font-size: 1.35rem; +} + +/* orcid ------------------------------------------------------------------- */ + +.orcid { + font-size: 16px; + color: #A6CE39; + /* margins are required by official ORCID trademark and display guidelines */ + margin-left:4px; + margin-right:4px; + vertical-align: middle; +} + +/* Reference index & topics ----------------------------------------------- */ + +.ref-index th {font-weight: normal;} + +.ref-index td {vertical-align: top; min-width: 100px} +.ref-index .icon {width: 40px;} +.ref-index .alias {width: 40%;} +.ref-index-icons .alias {width: calc(40% - 40px);} +.ref-index .title {width: 60%;} + +.ref-arguments th {text-align: right; padding-right: 10px;} +.ref-arguments th, .ref-arguments td {vertical-align: top; min-width: 100px} +.ref-arguments .name {width: 20%;} +.ref-arguments .desc {width: 80%;} + +/* Nice scrolling for wide elements --------------------------------------- */ + +table { + display: block; + overflow: auto; +} + +/* Syntax highlighting ---------------------------------------------------- */ + +pre, code, pre code { + background-color: #f8f8f8; + color: #333; +} +pre, pre code { + white-space: pre-wrap; + word-break: break-all; + overflow-wrap: break-word; +} + +pre { + border: 1px solid #eee; +} + +pre .img, pre .r-plt { + margin: 5px 0; +} + +pre .img img, pre .r-plt img { + background-color: #fff; +} + +code a, pre a { + color: #375f84; +} + +a.sourceLine:hover { + text-decoration: none; +} + +.fl {color: #1514b5;} +.fu {color: #000000;} /* function */ +.ch,.st {color: #036a07;} /* string */ +.kw {color: #264D66;} /* keyword */ +.co {color: #888888;} /* comment */ + +.error {font-weight: bolder;} +.warning {font-weight: bolder;} + +/* Clipboard --------------------------*/ + +.hasCopyButton { + position: relative; +} + +.btn-copy-ex { + position: absolute; + right: 0; + top: 0; + visibility: hidden; +} + +.hasCopyButton:hover button.btn-copy-ex { + visibility: visible; +} + +/* headroom.js ------------------------ */ + +.headroom { + will-change: transform; + transition: transform 200ms linear; +} +.headroom--pinned { + transform: translateY(0%); +} +.headroom--unpinned { + transform: translateY(-100%); +} + +/* mark.js ----------------------------*/ + +mark { + background-color: rgba(255, 255, 51, 0.5); + border-bottom: 2px solid rgba(255, 153, 51, 0.3); + padding: 1px; +} + +/* vertical spacing after htmlwidgets */ +.html-widget { + margin-bottom: 10px; +} + +/* fontawesome ------------------------ */ + +.fab { + font-family: "Font Awesome 5 Brands" !important; +} + +/* don't display links in code chunks when printing */ +/* source: https://stackoverflow.com/a/10781533 */ +@media print { + code a:link:after, code a:visited:after { + content: ""; + } +} + +/* Section anchors --------------------------------- + Added in pandoc 2.11: https://github.com/jgm/pandoc-templates/commit/9904bf71 +*/ + +div.csl-bib-body { } +div.csl-entry { + clear: both; +} +.hanging-indent div.csl-entry { + margin-left:2em; + text-indent:-2em; +} +div.csl-left-margin { + min-width:2em; + float:left; +} +div.csl-right-inline { + margin-left:2em; + padding-left:1em; +} +div.csl-indent { + margin-left: 2em; +} diff --git a/docs/pkgdown.js b/docs/pkgdown.js new file mode 100644 index 000000000..6f0eee40b --- /dev/null +++ b/docs/pkgdown.js @@ -0,0 +1,108 @@ +/* http://gregfranko.com/blog/jquery-best-practices/ */ +(function($) { + $(function() { + + $('.navbar-fixed-top').headroom(); + + $('body').css('padding-top', $('.navbar').height() + 10); + $(window).resize(function(){ + $('body').css('padding-top', $('.navbar').height() + 10); + }); + + $('[data-toggle="tooltip"]').tooltip(); + + var cur_path = paths(location.pathname); + var links = $("#navbar ul li a"); + var max_length = -1; + var pos = -1; + for (var i = 0; i < links.length; i++) { + if (links[i].getAttribute("href") === "#") + continue; + // Ignore external links + if (links[i].host !== location.host) + continue; + + var nav_path = paths(links[i].pathname); + + var length = prefix_length(nav_path, cur_path); + if (length > max_length) { + max_length = length; + pos = i; + } + } + + // Add class to parent
  • , and enclosing
  • if in dropdown + if (pos >= 0) { + var menu_anchor = $(links[pos]); + menu_anchor.parent().addClass("active"); + menu_anchor.closest("li.dropdown").addClass("active"); + } + }); + + function paths(pathname) { + var pieces = pathname.split("/"); + pieces.shift(); // always starts with / + + var end = pieces[pieces.length - 1]; + if (end === "index.html" || end === "") + pieces.pop(); + return(pieces); + } + + // Returns -1 if not found + function prefix_length(needle, haystack) { + if (needle.length > haystack.length) + return(-1); + + // Special case for length-0 haystack, since for loop won't run + if (haystack.length === 0) { + return(needle.length === 0 ? 0 : -1); + } + + for (var i = 0; i < haystack.length; i++) { + if (needle[i] != haystack[i]) + return(i); + } + + return(haystack.length); + } + + /* Clipboard --------------------------*/ + + function changeTooltipMessage(element, msg) { + var tooltipOriginalTitle=element.getAttribute('data-original-title'); + element.setAttribute('data-original-title', msg); + $(element).tooltip('show'); + element.setAttribute('data-original-title', tooltipOriginalTitle); + } + + if(ClipboardJS.isSupported()) { + $(document).ready(function() { + var copyButton = ""; + + $("div.sourceCode").addClass("hasCopyButton"); + + // Insert copy buttons: + $(copyButton).prependTo(".hasCopyButton"); + + // Initialize tooltips: + $('.btn-copy-ex').tooltip({container: 'body'}); + + // Initialize clipboard: + var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + text: function(trigger) { + return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); + } + }); + + clipboardBtnCopies.on('success', function(e) { + changeTooltipMessage(e.trigger, 'Copied!'); + e.clearSelection(); + }); + + clipboardBtnCopies.on('error', function() { + changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); + }); + }); + } +})(window.jQuery || window.$) diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml new file mode 100644 index 000000000..84cfda718 --- /dev/null +++ b/docs/pkgdown.yml @@ -0,0 +1,6 @@ +pandoc: 3.1.1 +pkgdown: 2.0.7 +pkgdown_sha: ~ +articles: {} +last_built: 2023-07-26T22:21Z + diff --git a/docs/reference/Rplot001.png b/docs/reference/Rplot001.png new file mode 100644 index 000000000..17a358060 Binary files /dev/null and b/docs/reference/Rplot001.png differ diff --git a/docs/reference/ard_simple.html b/docs/reference/ard_simple.html new file mode 100644 index 000000000..3b80fd470 --- /dev/null +++ b/docs/reference/ard_simple.html @@ -0,0 +1,143 @@ + +Simple ARD Statistics — ard_simple • cardinal + + +
    +
    + + + +
    +
    + + +
    +

    Compute Analysis Results Data (ARD) for simple summary statistics from +continuous and categorical data.

    +
    + +
    +
    ard_continuous(
    +  data,
    +  by = dplyr::group_vars(data),
    +  statistics = NULL,
    +  include = everything()
    +)
    +
    +ard_categorical(data, by = dplyr::group_vars(data), include = everything())
    +
    + +
    +

    Arguments

    +
    data
    +

    a data frame

    + + +
    by
    +

    columns to compute statistics by. Default are the columns +returned by dplyr::group_vars(data).

    + + +
    statistics
    +

    a named list of functions that return a summary statistic, +e.g. list(mpg = list(mean = \(x) mean(x, na.rm = TRUE)))

    + + +
    include
    +

    columns to include in summaries. Default is everything().

    + +
    +
    +

    Value

    + + +

    a data frame

    +
    + +
    +

    Examples

    +
    ard_continuous(mtcars, by = cyl, include = c(mpg, hp))
    +#> # A tibble: 42 × 5
    +#>    strata1 strata1_levels variable stat_name statistic
    +#>    <chr>            <dbl> <chr>    <chr>     <list>   
    +#>  1 cyl                  6 mpg      N         <int [1]>
    +#>  2 cyl                  6 mpg      N_miss    <int [1]>
    +#>  3 cyl                  6 mpg      N_tot     <int [1]>
    +#>  4 cyl                  6 mpg      mean      <dbl [1]>
    +#>  5 cyl                  6 mpg      sd        <dbl [1]>
    +#>  6 cyl                  6 mpg      min       <dbl [1]>
    +#>  7 cyl                  6 mpg      max       <dbl [1]>
    +#>  8 cyl                  6 hp       N         <int [1]>
    +#>  9 cyl                  6 hp       N_miss    <int [1]>
    +#> 10 cyl                  6 hp       N_tot     <int [1]>
    +#> # ℹ 32 more rows
    +ard_categorical(mtcars, by = cyl, include = c(am, gear))
    +#> # A tibble: 46 × 6
    +#>    strata1 strata1_levels variable variable_level stat_name statistic
    +#>    <chr>            <dbl> <chr>    <list>         <chr>     <list>   
    +#>  1 cyl                  6 am       <dbl [1]>      n         <int [1]>
    +#>  2 cyl                  6 am       <dbl [1]>      p         <dbl [1]>
    +#>  3 cyl                  6 am       <dbl [1]>      n         <int [1]>
    +#>  4 cyl                  6 am       <dbl [1]>      p         <dbl [1]>
    +#>  5 cyl                  4 am       <dbl [1]>      n         <int [1]>
    +#>  6 cyl                  4 am       <dbl [1]>      p         <dbl [1]>
    +#>  7 cyl                  4 am       <dbl [1]>      n         <int [1]>
    +#>  8 cyl                  4 am       <dbl [1]>      p         <dbl [1]>
    +#>  9 cyl                  8 am       <dbl [1]>      n         <int [1]>
    +#> 10 cyl                  8 am       <dbl [1]>      p         <dbl [1]>
    +#> # ℹ 36 more rows
    +
    +
    +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/cardinal-package.html b/docs/reference/cardinal-package.html new file mode 100644 index 000000000..69aef593e --- /dev/null +++ b/docs/reference/cardinal-package.html @@ -0,0 +1,75 @@ + +cardinal: CDISC Aanalys Results Data — cardinal-package • cardinal + + +
    +
    + + + +
    +
    + + +
    +

    What the package does (one paragraph).

    +
    + + +
    +

    Author

    +

    Maintainer: Daniel D. Sjoberg danield.sjoberg@gmail.com (ORCID)

    +
    + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/index.html b/docs/reference/index.html new file mode 100644 index 000000000..df0c4aba4 --- /dev/null +++ b/docs/reference/index.html @@ -0,0 +1,72 @@ + +Function reference • cardinal + + +
    +
    + + + +
    +
    + + + + + +
    +

    All functions

    +

    +
    +

    ard_continuous() ard_categorical()

    +

    Simple ARD Statistics

    + + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/reference/reexports.html b/docs/reference/reexports.html new file mode 100644 index 000000000..b45e77289 --- /dev/null +++ b/docs/reference/reexports.html @@ -0,0 +1,83 @@ + +Objects exported from other packages — reexports • cardinal + + +
    +
    + + + +
    +
    + + +
    +

    These objects are imported from other packages. Follow the links +below to see their documentation.

    +
    dplyr
    +

    %>%, all_of, any_of, contains, ends_with, everything, last_col, matches, num_range, one_of, starts_with, vars

    + + +
    + + + +
    + +
    + + +
    + +
    +

    Site built with pkgdown 2.0.7.

    +
    + +
    + + + + + + + + diff --git a/docs/sitemap.xml b/docs/sitemap.xml new file mode 100644 index 000000000..2410305db --- /dev/null +++ b/docs/sitemap.xml @@ -0,0 +1,30 @@ + + + + /404.html + + + /LICENSE-text.html + + + /LICENSE.html + + + /authors.html + + + /index.html + + + /reference/ard_simple.html + + + /reference/cardinal-package.html + + + /reference/index.html + + + /reference/reexports.html + + diff --git a/man/ard_comparison.Rd b/man/ard_comparison.Rd new file mode 100644 index 000000000..472251c84 --- /dev/null +++ b/man/ard_comparison.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ard_comparison.R +\name{ard_comparison} +\alias{ard_comparison} +\alias{ard_ttest} +\title{Comparison ARD Statistics} +\usage{ +ard_ttest(data, by, variable, conf.level = 0.95, ...) +} +\arguments{ +\item{data}{a data frame} + +\item{by}{charcter column name to compare by} + +\item{variable}{charadter column name to be compared} + +\item{...}{arguments passed to method.} +} +\value{ +data frame +} +\description{ +Comparison ARD Statistics +} +\examples{ +ard_ttest(data = mtcars, by = am, variable = hp) +} diff --git a/man/ard_simple.Rd b/man/ard_simple.Rd new file mode 100644 index 000000000..6f5439276 --- /dev/null +++ b/man/ard_simple.Rd @@ -0,0 +1,39 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/ard_simple.R +\name{ard_simple} +\alias{ard_simple} +\alias{ard_continuous} +\alias{ard_categorical} +\title{Simple ARD Statistics} +\usage{ +ard_continuous( + data, + by = dplyr::group_vars(data), + statistics = NULL, + include = everything() +) + +ard_categorical(data, by = dplyr::group_vars(data), include = everything()) +} +\arguments{ +\item{data}{a data frame} + +\item{by}{columns to compute statistics by. Default are the columns +returned by \code{dplyr::group_vars(data)}.} + +\item{statistics}{a named list of functions that return a summary statistic, +e.g. \verb{list(mpg = list(mean = \\(x) mean(x, na.rm = TRUE)))}} + +\item{include}{columns to include in summaries. Default is \code{everything()}.} +} +\value{ +a data frame +} +\description{ +Compute Analysis Results Data (ARD) for simple summary statistics from +continuous and categorical data. +} +\examples{ +ard_continuous(mtcars, by = cyl, include = c(mpg, hp)) +ard_categorical(mtcars, by = cyl, include = c(am, gear)) +} diff --git a/man/reexports.Rd b/man/reexports.Rd new file mode 100644 index 000000000..8ed132f51 --- /dev/null +++ b/man/reexports.Rd @@ -0,0 +1,27 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/reexports.R +\docType{import} +\name{reexports} +\alias{reexports} +\alias{\%>\%} +\alias{starts_with} +\alias{ends_with} +\alias{contains} +\alias{matches} +\alias{num_range} +\alias{all_of} +\alias{any_of} +\alias{everything} +\alias{last_col} +\alias{one_of} +\alias{vars} +\title{Objects exported from other packages} +\keyword{internal} +\description{ +These objects are imported from other packages. Follow the links +below to see their documentation. + +\describe{ + \item{dplyr}{\code{\link[dplyr:reexports]{\%>\%}}, \code{\link[dplyr:reexports]{all_of}}, \code{\link[dplyr:reexports]{any_of}}, \code{\link[dplyr:reexports]{contains}}, \code{\link[dplyr:reexports]{ends_with}}, \code{\link[dplyr:reexports]{everything}}, \code{\link[dplyr:reexports]{last_col}}, \code{\link[dplyr:reexports]{matches}}, \code{\link[dplyr:reexports]{num_range}}, \code{\link[dplyr:reexports]{one_of}}, \code{\link[dplyr:reexports]{starts_with}}, \code{\link[dplyr]{vars}}} +}} +