diff --git a/.Rbuildignore b/.Rbuildignore index f529ba5..706f28a 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -1,10 +1,17 @@ -^.*\.Rproj$ -^\.Rproj\.user$ -^LICENSE\.md$ -^README\.Rmd -^pkgdown\.css -^docs -^_pkgdown\.yml$ -^docs$ -^pkgdown$ -^data-raw$ +^.*\.Rproj$ +^LICENSE\.md$ +^README\.Rmd +^\.Rproj\.user$ +^\.github$ +^\.pre-commit-config\.yaml$ +^_pkgdown\.yml$ +^data-raw$ +^docs +^docs$ +^pkgdown$ +^pkgdown\.css +^renv$ +^renv$ +^renv\.lock$ +^renv\.lock$ +^test-example.R diff --git a/.Rprofile b/.Rprofile new file mode 100644 index 0000000..4be44ff --- /dev/null +++ b/.Rprofile @@ -0,0 +1,3 @@ +# source("renv/activate.R") +options(repos = c(CRAN = "https://p3m.dev/cran/__linux__/manylinux_2_28/latest")) +options(renv.config.pak.enabled = TRUE) diff --git a/.gitignore b/.gitignore index ecb1ef1..e00605f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,10 @@ -.Rproj.user -.Rhistory -.Rdata -.httr-oauth -.DS_Store +.Rproj.user +.Rhistory +.Rdata +.httr-oauth +.DS_Store R/test.R +inst/doc + +/.quarto/ +docs diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..b233962 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,93 @@ +# All available hooks: https://pre-commit.com/hooks.html +# R specific hooks: https://github.com/lorenzwalthert/precommit +repos: + - repo: https://github.com/lorenzwalthert/precommit + rev: v0.4.3.9012 + hooks: + - id: style-files + args: [--style_pkg=styler, --style_fun=tidyverse_style] + - id: roxygenize + # roxygen requires loading pkg -> add dependencies from DESCRIPTION + additional_dependencies: + - ggplot2 + - rlang + - grDevices + - glue + - scales + - ggtext + - ggrepel + - tidyr + - dplyr + - ggalluvial + - viridisLite + - waffle + - stringr + - checkmate + - forcats + + # codemeta must be above use-tidy-description when both are used + # - id: codemeta-description-updated + - id: use-tidy-description + - id: spell-check + exclude: > + (?x)^( + .*\.[rR]| + .*\.feather| + .*\.jpeg| + .*\.pdf| + .*\.png| + .*\.py| + .*\.RData| + .*\.rds| + .*\.Rds| + .*\.Rproj| + .*\.sh| + (.*/|)\.gitignore| + (.*/|)\.gitlab-ci\.yml| + (.*/|)\.lintr| + (.*/|)\.pre-commit-.*| + (.*/|)\.Rbuildignore| + (.*/|)\.Renviron| + (.*/|)\.Rprofile| + (.*/|)\.travis\.yml| + (.*/|)appveyor\.yml| + (.*/|)NAMESPACE| + (.*/|)renv/settings\.dcf| + (.*/|)renv\.lock| + (.*/|)WORDLIST| + \.github/workflows/.*| + data/.*| + )$ + - id: readme-rmd-rendered + - id: parsable-R + - id: no-browser-statement + - id: no-print-statement + - id: no-debug-statement + - id: deps-in-desc + - id: pkgdown + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: check-added-large-files + args: ["--maxkb=200"] + - id: file-contents-sorter + files: '^\.Rbuildignore$' + - id: end-of-file-fixer + exclude: '\.Rd' + - repo: https://github.com/pre-commit-ci/pre-commit-ci-config + rev: v1.6.1 + hooks: + # Only required when https://pre-commit.ci is used for config validation + - id: check-pre-commit-ci-config + - repo: local + hooks: + - id: forbid-to-commit + name: Don't commit common R artifacts + entry: Cannot commit .Rhistory, .RData, .Rds or .rds. + language: fail + files: '\.(Rhistory|RData|Rds|rds)$' + # `exclude: ` to allow committing specific files + +ci: + autoupdate_schedule: monthly + skip: [pkgdown] diff --git a/DESCRIPTION b/DESCRIPTION index 2fed535..f0d7892 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,39 +1,44 @@ -Package: visualizeR Type: Package +Package: visualizeR Title: What a color! What a viz! -Version: 0.8.9000 -Authors@R: c( - person( - 'Noblet', 'Guillaume', - email = 'gnoblet@zaclys.net', - role = c('aut', 'cre') - ) - ) -URL: https://github.com/gnoblet/visualizeR, - https://gnoblet.github.io/visualizeR/ +Version: 1.0 +Authors@R: + person("Noblet", "Guillaume", , "gnoblet@zaclys.net", role = c("aut", "cre")) Maintainer: Guillaume Noblet -Description: It basically provides colors as hex codes, color palettes, and some viz functions (graphs and maps). -Depends: R (>= 4.1.0) +Description: It basically provides colors as hex codes, color palettes, + and some viz functions (graphs and maps). License: GPL (>= 3) -Encoding: UTF-8 -LazyData: true -RoxygenNote: 7.2.3 +URL: https://github.com/gnoblet/visualizeR, + https://gnoblet.github.io/visualizeR/ +Depends: + R (>= 4.1.0) Imports: - ggplot2, - rlang (>= 0.4.11), - grDevices, - glue, - scales, - ggtext, - ggrepel, - tidyr, + checkmate, dplyr, + forcats, ggalluvial, + ggplot2, + ggrepel, + ggtext, + glue, + grDevices, + rlang (>= 0.4.11), + scales, + stringr, + tidyr, viridisLite, waffle Suggests: knitr, + rio, + rmarkdown, roxygen2, - sf, - tmap -VignetteBuilder: knitr + testthat (>= 3.0.0), + vdiffr, + mockery +VignetteBuilder: + knitr +Config/testthat/edition: 3 +Encoding: UTF-8 +LazyData: true +RoxygenNote: 7.3.2 diff --git a/R/alluvial.R b/R/alluvial.R deleted file mode 100644 index 5665585..0000000 --- a/R/alluvial.R +++ /dev/null @@ -1,104 +0,0 @@ -#' @title Simple alluvial chart -#' -#' @param df A data frame. -#' @param from A character column of upstream stratum. -#' @param to A character column of downstream stratum. -#' @param value A numeric column of values. -#' @param group The grouping column to fill the alluvium with. -#' @param alpha Fill transparency. Default to 0.5. -#' @param from_levels Order by given from levels? -#' @param value_title The value/y scale title. Default to NULL. -#' @param group_title The group title. Default to NULL. -#' @param title Plot title. Default to NULL. -#' @param subtitle Plot subtitle. Default to NULL. -#' @param caption Plot caption. Default to NULL. -#' @param rect_color Stratum rectangles' fill color. -#' @param rect_border_color Stratum rectangles' border color. -#' @param rect_text_color Stratum rectangles' text color. -#' @param theme Whatever theme. Default to theme_reach(). -#' -#' @return A donut chart to be used parsimoniously -#' -#' @export -alluvial <- function( - df, - from, - to, - value, - group = NULL, - alpha = 0.5, - from_levels = NULL, - value_title = NULL, - group_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - rect_color = cols_reach("white"), - rect_border_color = cols_reach("main_grey"), - rect_text_color = cols_reach("main_grey"), - theme = theme_reach(axis_y = FALSE, - legend_position = "none") -){ - - if(!is.null(from_levels)) df <- dplyr::mutate(df, "{{from}}" := factor({{ from }}, levels = from_levels)) - - # General mapping - g <- ggplot2::ggplot( - data = df, - mapping = ggplot2::aes( - y = {{ value }}, - axis1 = {{ from }}, - axis3 = {{ to }} - ) - ) - - # Add alluvium - g <- g + - ggalluvial::geom_alluvium( - ggplot2::aes( - fill = {{ group }}, - color = {{ group }} - ), - alpha = alpha) - - # Add stratum - g <- g + - ggalluvial::geom_stratum( - fill = rect_color, - color = rect_border_color - ) - - # Add stratum text - - stratum <- ggalluvial::StatStratum - - g <- g + - ggplot2::geom_text( - stat = stratum, - ggplot2::aes(label = ggplot2::after_stat(!!rlang::sym("stratum"))), - color = cols_reach("main_grey") - ) - - - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - y = value_title, - title = title, - subtitle = subtitle, - caption = caption, - fill = group_title, - color = group_title - ) - - # Remove x-axis - g <- g + ggplot2::theme( - axis.line.x = ggplot2::element_blank(), - axis.ticks.x = ggplot2::element_blank(), - axis.text.x = ggplot2::element_blank(), - axis.title.x = ggplot2::element_blank() - ) - - g <- g + theme - - return(g) -} diff --git a/R/bar.R b/R/bar.R index 895eb92..90519c1 100644 --- a/R/bar.R +++ b/R/bar.R @@ -1,11 +1,34 @@ -#' @title Simple bar chart +#' @rdname bar +#' +#' @inheritParams bar +#' +#' @export +hbar <- function( + ..., + flip = TRUE, + add_text = FALSE, + theme_fun = theme_bar(flip = flip, add_text = add_text) +) { + bar(flip = flip, add_text = add_text, theme_fun = theme_fun, ...) +} + +#' Simple bar chart +#' +#' `bar()` is a simple bar chart with some customization allowed, in particular the `theme_fun` argument for theming. `hbar()` uses `bar()` with sane defaults for a horizontal bar chart. #' #' @param df A data frame. -#' @param x A numeric column. -#' @param y A character column or coercible as a character column. -#' @param group Some grouping categorical column, e.g. administrative areas or population groups. -#' @param flip TRUE or FALSE. Default to TRUE or horizontal bar plot. -#' @param percent TRUE or FALSE. Should the x-labels (and text labels if present) be displayed as percentages? Default to TRUE. +#' @param x A quoted numeric column. +#' @param y A quoted character column or coercible as a character column. +#' @param group Some quoted grouping categorical column, e.g. administrative areas or population groups. +#' @param facet Some quoted grouping categorical column, e.g. administrative areas or population groups. +#' @param x_rm_na Remove NAs in x? +#' @param y_rm_na Remove NAs in y? +#' @param group_rm_na Remove NAs in group? +#' @param facet_rm_na Remove NAs in facet? +#' @param y_expand Multiplier to expand the y axis. +#' @param add_color Add a color to bars (if no grouping). +#' @param add_color_guide Should a legend be added? +#' @param flip TRUE or FALSE (default). Default to TRUE or horizontal bar plot. #' @param wrap Should x-labels be wrapped? Number of characters. #' @param position Should the chart be stacked? Default to "dodge". Can take "dodge" and "stack". #' @param alpha Fill transparency. @@ -15,127 +38,439 @@ #' @param title Plot title. Default to NULL. #' @param subtitle Plot subtitle. Default to NULL. #' @param caption Plot caption. Default to NULL. -#' @param add_text TRUE or FALSE. Add the value as text. +#' @param width Bar width. +#' @param add_text TRUE or FALSE. Add values as text. +#' @param add_text_size Text size. +#' @param add_text_color Text color. +#' @param add_text_font_face Text font_face. +#' @param add_text_threshold_display Minimum value to add the text label. #' @param add_text_suffix If percent is FALSE, should we add a suffix to the text label? -#' @param theme Whatever theme. Default to theme_reach(). +#' @param add_text_expand_limit Default to adding 10\% on top of the bar. +#' @param add_text_round Round the text label. +#' @param theme_fun Whatever theme function. For no custom theme, use theme_fun = NULL. #' -#' @return A bar chart +#' @inheritParams reorder_by +#' +#' @importFrom rlang `:=` #' #' @export -bar <- function(df, x, y, group = NULL, flip = TRUE, percent = TRUE, wrap = NULL, position = "dodge", alpha = 1, x_title = NULL, y_title = NULL, group_title = NULL, title = NULL, subtitle = NULL, caption = NULL, add_text = FALSE, add_text_suffix = "", theme = theme_reach()){ +bar <- function( + df, + x, + y, + group = "", + facet = "", + order = "none", + x_rm_na = TRUE, + y_rm_na = TRUE, + group_rm_na = TRUE, + facet_rm_na = TRUE, + y_expand = 0.1, + add_color = color("cat_5_main_1"), + add_color_guide = TRUE, + flip = FALSE, + wrap = NULL, + position = "dodge", + alpha = 1, + x_title = NULL, + y_title = NULL, + group_title = NULL, + title = NULL, + subtitle = NULL, + caption = NULL, + width = 0.8, + add_text = FALSE, + add_text_size = 4.5, + add_text_color = color("dark_grey"), + add_text_font_face = "bold", + add_text_threshold_display = 0.05, + add_text_suffix = "%", + add_text_expand_limit = 1.2, + add_text_round = 1, + theme_fun = theme_bar( + flip = flip, + add_text = add_text, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5 + ), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() +) { + #------ Checks - # To do : - # - automate bar width and text size, or at least give the flexibility and still center text - # - add facet possibility + # df is a data frame + checkmate::assert_data_frame(df) - # Prepare group, x and y names - # if (is.null(x_title)) x_title <- rlang::as_name(rlang::enquo(x)) - # if (is.null(y_title)) y_title <- rlang::as_name(rlang::enquo(y)) - # if (is.null(group_title)) group_title <- rlang::as_name(rlang::enquo(group)) + # x and y and group are character + checkmate::assert_character(x, len = 1) + checkmate::assert_character(y, len = 1) + checkmate::assert_character(group, len = 1) - # Mapping - g <- ggplot2::ggplot( - df, - mapping = ggplot2::aes(x = {{ x }}, y = {{ y }}, fill = {{ group }}, color = {{ group }} - ) - ) + # x and y are columns in df + checkmate::assert_choice(x, colnames(df)) + checkmate::assert_choice(y, colnames(df)) + if (group != "") { + checkmate::assert_choice(group, colnames(df)) + } - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - x = x_title, - y = y_title, - color = group_title, - fill = group_title + # x_rm_na, y_rm_na and group_rm_na are logical scalar + checkmate::assert_logical(x_rm_na, len = 1) + checkmate::assert_logical(y_rm_na, len = 1) + checkmate::assert_logical(group_rm_na, len = 1) + checkmate::assert_logical(facet_rm_na, len = 1) + + # flip is a logical scalar + checkmate::assert_logical(flip, len = 1) + + # wrap is a numeric scalar or NULL + if (!is.null(wrap)) { + checkmate::assert_numeric(wrap, len = 1, null.ok = TRUE) + } + + # alpha is a numeric scalar between 0 and 1 + checkmate::assert_numeric(alpha, lower = 0, upper = 1, len = 1) + + # add_text is a logical scalar + checkmate::assert_logical(add_text, len = 1) + + # add_text_size is a numeric scalar + checkmate::assert_numeric(add_text_size, len = 1) + + # add_text_font_face is a character scalar in bold plain or italic + checkmate::assert_choice(add_text_font_face, c("bold", "plain", "italic")) + + # add_text_threshold_display is a numeric scalar + checkmate::assert_numeric(add_text_threshold_display, len = 1) + + # add_text_suffix is a character scalar + checkmate::assert_character(add_text_suffix, len = 1) + + # add_text_expand_limit is a numeric scalar + checkmate::assert_numeric(add_text_expand_limit, len = 1) + + # add_text_round is a numeric scalar + checkmate::assert_numeric(add_text_round, len = 1) + + # x and y are numeric or character + if (class(df[[y]]) %notin% c("integer", "numeric")) { + rlang::abort(paste0(y, " must be numeric.")) + } + if (!any(class(df[[x]]) %in% c("character", "factor"))) { + rlang::abort(paste0(x, " must be character or factor")) + } + + # width is a numeric scalar between 0 and 1 + checkmate::assert_numeric(width, lower = 0, upper = 1, len = 1) + + # Check if position is stack or dodge + if (position %notin% c("stack", "dodge")) { + rlang::abort("Position should be either 'stack' or 'dodge'.") + } + + #----- Data wrangling + + # facets over group + if (group != "" && facet != "" && group == facet) { + rlang::warn("'group' and 'facet' are the same identical.") + } + + # remove NAs using base R + if (x_rm_na) { + df <- df[!(is.na(df[[x]])), ] + } + if (y_rm_na) { + df <- df[!(is.na(df[[y]])), ] + } + if (group != "" && group_rm_na) { + df <- df[!(is.na(df[[group]])), ] + } + if (facet != "" && facet_rm_na) { + df <- df[!(is.na(df[[facet]])), ] + } + + # reorder + dir_order <- if (flip && order %in% c("x", "grouped_x")) { + -1 + } else if (!flip && order %in% c("x", "grouped_x")) { + 1 + } else if (flip) { + 1 + } else { + -1 + } + group_order <- if (group != "" || (group == "" && facet == "")) { + group + } else if (group == "" && facet != "") { + facet + } + df <- reorder_by( + df = df, + x = x, + y = y, + group = group_order, + order = order, + dir_order = dir_order ) - width <- 0.5 - dodge_width <- 0.5 - - # Should the graph use position_fill? - if (position == "stack"){ - g <- g + ggplot2::geom_col( - alpha = alpha, - width = width, - position = ggplot2::position_stack() - ) - } else if (position == "dodge"){ - g <- g + ggplot2::geom_col( - alpha = alpha, - width = width, - position = ggplot2::position_dodge2( - width = dodge_width, - preserve = "single") - ) - } else{ - g <- g + ggplot2::geom_col( - alpha = alpha, - width = width - ) - } - # - # Labels to percent and expand scale - if (percent) { - g <- g + ggplot2::scale_y_continuous( - labels = scales::label_percent( - accuracy = 1, - decimal.mark = ",", - suffix = " %"), - expand = c(0.01, 0.1) + # prepare aes + if (group != "") { + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y), + fill = !!rlang::sym(group), + color = !!rlang::sym(group) + ) ) } else { - g <- g + ggplot2::scale_y_continuous(expand = c(0.01, 0.1)) + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y) + ) + ) } + # add title, subtitle, caption, x_title, y_title + g <- g + + ggplot2::labs( + title = title, + subtitle = subtitle, + caption = caption, + x = y_title, + y = x_title, + color = group_title, + fill = group_title + ) + + # width + width <- width + dodge_width <- width + + # facets + if (facet != "") { + if (flip) { + g <- g + + ggplot2::facet_grid( + rows = ggplot2::vars(!!rlang::sym(facet)), + scales = "free", + space = "free_y" + ) + } else { + g <- g + + ggplot2::facet_grid( + cols = ggplot2::vars(!!rlang::sym(facet)), + scales = "free", + space = "free_x" + ) + } + } + + # should the graph use position_fill? + if (group != "") { + if (position == "stack") { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width, + position = ggplot2::position_stack() + ) + } else if (position == "dodge") { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width, + position = ggplot2::position_dodge2( + width = dodge_width, + preserve = "single" + ) + ) + } else { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width + ) + } + } else { + if (position == "stack") { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width, + position = ggplot2::position_stack(), + fill = add_color, + color = add_color + ) + } else if (position == "dodge") { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width, + position = ggplot2::position_dodge2( + width = dodge_width, + preserve = "single" + ), + fill = add_color, + color = add_color + ) + } else { + g <- g + + ggplot2::geom_col( + alpha = alpha, + width = width, + fill = add_color, + color = add_color + ) + } + } + + # wrap labels on the x scale? if (!is.null(wrap)) { g <- g + ggplot2::scale_x_discrete(labels = scales::label_wrap(wrap)) } - # Because a text legend should always be horizontal, especially for an horizontal bar graph - if (flip){ - g <- g + ggplot2::coord_flip() - } - - # Add text to bars - if (flip) hjust_flip <- 1.5 else hjust_flip <- 0.5 - if (flip) vjust_flip <- 0.5 else vjust_flip <- 1.5 - - if (add_text & position != "dodge") { - rlang::abort("Adding text labels and positions different than dodges as not been implemented yet") + # because a text legend should always be horizontal, especially for an horizontal bar graph + if (flip) { + g <- g + ggplot2::coord_flip() + } + # add text to bars + if (flip) { + hjust_flip <- -0.5 + } else { + hjust_flip <- 0.5 + } + if (flip) { + vjust_flip <- 0.5 + } else { + vjust_flip <- -0.5 } - # Add text labels - if (add_text) { - if (percent) { - g <- g + ggplot2::geom_text( - ggplot2::aes( - label = scales::label_percent( - accuracy = 1, - decimal.mark = ",", - suffix = " %")({{ y }}), - group = {{ group }}), - hjust = hjust_flip, - vjust = vjust_flip, - color = "white", - fontface = "bold", - position = ggplot2::position_dodge(width = dodge_width)) + # function for interaction + interaction_f <- function(group, facet, data) { + if (group == "" && facet == "") { + return(NULL) + } else if (group != "" && facet != "") { + return(interaction(data[[group]], data[[facet]])) + } else if (group != "") { + return(data[[group]]) + } else if (facet != "") { + return(data[[facet]]) } else { - g <- g + ggplot2::geom_text( + return(NULL) + } + } + + # add text labels + if (add_text & position == "dodge") { + df <- dplyr::mutate( + df, + "y_threshold" := ifelse( + !!rlang::sym(y) >= add_text_threshold_display, + !!rlang::sym(y), + NA + ) + ) + + # expand limits + g <- g + + ggplot2::geom_blank( + data = df, ggplot2::aes( - label = paste0(round({{ y }}), add_text_suffix), - group = {{ group }}), + x = !!rlang::sym(x), + y = !!rlang::sym(y) * add_text_expand_limit, + group = interaction_f(group, facet, df) + ) + ) + g <- g + + ggplot2::geom_text( + data = df, + ggplot2::aes( + label = ifelse( + is.na(!!rlang::sym("y_threshold")), + NA, + paste0( + round(!!rlang::sym("y_threshold"), add_text_round), + add_text_suffix + ) + ), + group = interaction_f(group, facet, df) + ), hjust = hjust_flip, vjust = vjust_flip, - color = "white", - fontface = "bold", - position = ggplot2::position_dodge(width = dodge_width)) - } + color = add_text_color, + fontface = add_text_font_face, + size = add_text_size, + position = ggplot2::position_dodge2(width = dodge_width) + ) + } else if (add_text & position == "stack") { + df <- dplyr::mutate( + df, + "y_threshold" := ifelse( + !!rlang::sym(y) >= add_text_threshold_display, + !!rlang::sym(y), + NA + ) + ) + + g <- g + + ggplot2::geom_text( + data = df, + ggplot2::aes( + label = ifelse( + is.na(!!rlang::sym("y_threshold")), + NA, + paste0( + round(!!rlang::sym("y_threshold"), add_text_round), + add_text_suffix + ) + ), + group = interaction_f(group, facet, df) + ), + hjust = hjust_flip, + vjust = vjust_flip, + color = add_text_color, + fontface = add_text_font_face, + size = add_text_size, + position = ggplot2::position_dodge2(width = dodge_width) + ) } - # Add theme - g <- g + theme + # y scale tweaks + g <- g + + ggplot2::scale_y_continuous( + # start at 0 + expand = ggplot2::expansion(mult = c(0, y_expand)), + # remove trailing 0 and choose accuracy of y labels + labels = scales::label_number( + accuracy = 0.1, + drop0trailing = TRUE, + big.mark = "", + decimal.mark = "." + ), + ) + + # # remove guides for legend if !add_color_guide + if (!add_color_guide) { + g <- g + ggplot2::guides(fill = "none", color = "none") + } + + # # add theme fun + if (!is.null(theme_fun)) { + g <- g + theme_fun + } + + # # # add scale fun + if (!is.null(scale_fill_fun)) { + g <- g + scale_fill_fun + } + + if (!is.null(scale_color_fun)) { + g <- g + scale_color_fun + } return(g) } diff --git a/R/bbox_buffer.R b/R/bbox_buffer.R deleted file mode 100644 index be11e5a..0000000 --- a/R/bbox_buffer.R +++ /dev/null @@ -1,39 +0,0 @@ -#' @title Bbbox buffer -#' -#' @param sf_obj A `sf` object -#' @param buffer A buffer, either one value or a vector of 4 values (left, bottom, right, top). Default to 0. -#' -#' @return A bbox with a buffer -#' -#' @export -buffer_bbox <- function(sf_obj, buffer = 0){ - - rlang::check_installed("sf", reason = "Package \"sf\" needed for `buffer_bbox()` to work. Please install it.") - - - if (!(length(buffer) %in% c(1,4)) | !is.numeric(buffer)) stop("Please provide a numeric buffer of length 1 or 4.") - - bbox <- sf::st_bbox(sf_obj) - xrange <- bbox$xmax - bbox$xmin # range of x values - yrange <- bbox$ymax - bbox$ymin # range of y values - - - bbox_with_buffer <- if (length(buffer) == 1) { - c( - bbox[1] - (buffer * xrange), # xmin - left - bbox[2] - (buffer * yrange), # ymin - bottom - bbox[3] + (buffer * xrange), # xmax - right - bbox[4] + (buffer * yrange) # ymax - top - ) - } else if (length(buffer) == 4) { - c( - bbox[1] - (buffer[1] * xrange), # xmin - left - bbox[2] - (buffer[2] * yrange), # ymin - bottom - bbox[3] + (buffer[3] * xrange), # xmax - right - bbox[4] + (buffer[4] * yrange) # ymax - top - ) - } else { - print("Missed something while writing the funtion.") - } - -} diff --git a/R/checks.R b/R/checks.R new file mode 100644 index 0000000..e602c02 --- /dev/null +++ b/R/checks.R @@ -0,0 +1,17 @@ +#' @title Check if variables are in data frame +#' +#' @param df A data frame +#' @param vars A vector of variable names +#' +#' @return A stop statement +check_vars_in_df <- function(df, vars) { + vars_nin <- setdiff(vars, colnames(df)) + + if (length(vars_nin) > 0) { + rlang::abort(glue::glue( + "Variables ", + glue::glue_collapse(vars_nin, sep = ", ", last = ", and "), + " not found in data frame." + )) + } +} diff --git a/R/color.R b/R/color.R new file mode 100644 index 0000000..fa3b479 --- /dev/null +++ b/R/color.R @@ -0,0 +1,162 @@ +#' Helpers to extract defined colors as hex codes +#' +#' [color()] returns the requested columns, returns NA if absent. [color_pattern()] returns all colors that start with the pattern. +#' +#' @param ... Character names of colors. If NULL returns all colors. +#' @param unname Boolean. Should the output vector be unnamed? Default to `TRUE`. +#' @section Naming of colors: +#' * All branding colors start with "branding"; +#' * All , categorical colors start with ", cat_"; +#' * All sequential colors start with "seq_"; +#' +#' Then, a number indicates the number of colors that belong to the palettes, a string the name of the palette, and, finally, a number the position of the color. E.g., "seq_5_red_4" would be the 4th color of a continuous palettes of 5 colors in the red band. Exception is made for white, light_grey, dark_grey, and black. +#' +#' +#' @return Hex codes named or unnamed. +#' +#' @export +color <- function(..., unname = TRUE) { + #------ Checks + + # unname is a logical scalar + checkmate::assert_logical(unname, len = 1) + + # all elements in ... are character strings + dots <- list(...) + if (length(dots) > 0) { + # Check each argument is a single character string + for (i in seq_along(dots)) { + checkmate::assert_string(dots[[i]], .var.name = paste0("Argument #", i)) + } + } + + #------ Prep + + # retrieve colors + cols <- c(...) + + # define color vector + colors <- c( + white = "#FFFFFF", + lighter_grey = "#F5F5F5", + light_grey = "#E3E3E3", + dark_grey = "#464647", + light_blue_grey = "#B3C6D1", + grey = "#71716F", + black = "#000000", + cat_2_yellow_1 = "#ffc20a", + cat_2_yellow_2 = "#0c7bdc", + cat_2_light_1 = "#fefe62", + cat_2_light_2 = "#d35fb7", + cat_2_green_1 = "#1aff1a", + cat_2_green_2 = "#4b0092", + cat_2_blue_1 = "#1a85ff", + cat_2_blue_2 = "#d41159", + cat_5_main_1 = "#083d77", # yale blue + cat_5_main_2 = "#4ecdc4", # robin egg blue + cat_5_main_3 = "#f4c095", # peach + cat_5_main_4 = "#b47eb3", # african violet + cat_5_main_5 = "#ffd5ff", # mimi pink + seq_5_main_1 = "#083d77", # yale blue + seq_5_main_2 = "##396492", + seq_5_main_3 = "#6b8bad", + seq_5_main_4 = "#9cb1c9", + seq_5_main_5 = "#ced8e4", + cat_5_ibm_1 = "#648fff", + cat_5_ibm_2 = "#785ef0", + cat_5_ibm_3 = "#dc267f", + cat_5_ibm_4 = "#fe6100", + cat_5_ibm_5 = "#ffb000", + cat_3_aquamarine_1 = "aquamarine2", + cat_3_aquamarine_2 = "cornflowerblue", + cat_3_aquamarine_3 = "brown1", + cat_3_tol_high_contrast_1 = "#215589", + cat_3_tol_high_contrast_2 = "#cfaa34", + cat_3_tol_high_contrast_3 = "#a35364", + cat_8_tol_adapted_1 = "#332e86", + cat_8_tol_adapted_2 = "#50504f", + cat_8_tol_adapted_3 = "#3dab9a", + cat_8_tol_adapted_4 = "#86ccee", + cat_8_tol_adapted_5 = "#ddcb77", + cat_8_tol_adapted_6 = "#ee5859", + cat_8_tol_adapted_7 = "#aa4599", + cat_8_tol_adapted_8 = "#721220", + div_5_orange_blue_1 = "#c85200", + div_5_orange_blue_2 = "#e48646", + div_5_orange_blue_3 = "#cccccc", + div_5_orange_blue_4 = "#6b8ea4", + div_5_orange_blue_5 = "#366785", + div_5_green_purple_1 = "#c85200", + div_5_green_purple_2 = "#e48646", + div_5_green_purple_3 = "#cccccc", + div_5_green_purple_4 = "#6b8ea4", + div_5_green_purple_5 = "#366785" + ) + + #------ Checks + + # Check that if ... is not null, all colors are defined + if (!is.null(cols)) { + if (cols %notallin% names(colors)) { + rlang::abort(c( + "Some colors not defined", + "*" = glue::glue_collapse( + ...[which(!... %in% names(cols))], + sep = ", ", + last = ", and " + ), + "i" = "Use `color(unname = FALSE)` to see all named available colors." + )) + } + } + + # ------ Return + + if (is.null(cols)) { + cols_to_return <- colors + } else { + cols_to_return <- colors[cols] + } + + if (unname) { + cols_to_return <- unname(cols_to_return) + } + + return(cols_to_return) +} + +#' @rdname color +#' +#' @param pattern Pattern of the start of colors' name. +#' +#' @export +color_pattern <- function(pattern, unname = TRUE) { + #------ Checks + + # Check that pattern is a character scalar + checkmate::assert_character(pattern, len = 1) + + # Check that unname is a logical scalar + checkmate::assert_logical(unname, len = 1) + + #------ Get colors + + # Get colors + col <- color(unname = FALSE) + col <- col[startsWith(names(col), pattern)] + + if (unname) { + col <- unname(col) + } + + # If col is of length 0, warn + if (length(col) == 0) { + rlang::warn(c( + "No colors match the pattern", + "*" = glue::glue("Pattern used is:'{pattern}'"), + "i" = "Use `color(unname = FALSE)` to see all named available colors." + )) + } + + return(col) +} diff --git a/R/cols_agora.R b/R/cols_agora.R deleted file mode 100644 index 5b2333f..0000000 --- a/R/cols_agora.R +++ /dev/null @@ -1,32 +0,0 @@ -#' @title Function to extract AGORA colors as hex codes -#' -#' @param ... Character names of reach colors. If NULL returns all colors -#' @param unnamed Should the output vector be unnamed? Default to `TRUE` -#' -#' @return An hex code or hex codes named or unnamed -#' -#' @details This function needs to be modified to add colors -#' -#' @export -cols_agora <- function(..., unnamed = TRUE) { - cols <- c(...) - - colors_agora <- c(white = "#FFFFFF", - black = "#000000", - main_bordeaux = "#581522", - main_lt_beige = "#DDD8C4", - main_dk_beige = "#B7AD99", - main_lt_grey = "#BCB8B1") - - if (is.null(cols)) { - cols_to_return <- colors_agora - } else { - cols_to_return <- colors_agora[cols] - } - - if(unnamed){ - cols_to_return <- unname(cols_to_return) - } - - return(cols_to_return) -} diff --git a/R/cols_impact.R b/R/cols_impact.R deleted file mode 100644 index c74bdaf..0000000 --- a/R/cols_impact.R +++ /dev/null @@ -1,30 +0,0 @@ -#' @title Function to extract IMPACT colors as hex codes -#' -#' @param ... Character names of reach colors. If NULL returns all colors -#' @param unnamed Should the output vector be unnamed? Default to `TRUE` -#' -#' @return An hex code or hex codes named or unnamed -#' -#' @details This function needs to be modified to add colors -#' -#' @export -cols_impact <- function(..., unnamed = TRUE) { - cols <- c(...) - - colors_impact <- c(white = "#FFFFFF", - black = "#000000", - main_blue = "#315975", - main_gray = "#58585A") - - if (is.null(cols)) { - cols_to_return <- colors_impact - } else { - cols_to_return <- colors_impact[cols] - } - - if(unnamed){ - cols_to_return <- unname(cols_to_return) - } - - return(cols_to_return) -} diff --git a/R/cols_reach.R b/R/cols_reach.R deleted file mode 100644 index efb1c54..0000000 --- a/R/cols_reach.R +++ /dev/null @@ -1,168 +0,0 @@ -#' @title Function to extract REACH colors as hex codes -#' -#' @param ... Character names of reach colors. If NULL returns all colors -#' @param unnamed Should the output vector be unnamed? Default to `TRUE` -#' -#' @return An hex code or hex codes named or unnamed -#' -#' @details This function needs to be modified to add colors -#' -#' @export -cols_reach <- function(..., unnamed = TRUE) { - cols <- c(...) - - colors_reach <- c( - white = "#FFFFFF", - black = "#000000", - main_grey = "#58585A", - main_red = "#EE5859", - main_lt_grey = "#C7C8CA", - main_beige = "#D2CBB8", - iroise_1 = "#DFECEF", - iroise_2 = "#B1D7E0", - iroise_3 = "#699DA3", - iroise_4 = "#236A7A", - iroise_5 = "#0C3842", - red_main_1 = "#AE2829", - red_main_2 = "#D05E5F", - red_main_3 = "#DB9797", - red_main_4 = "#EBC7C8", - red_main_5 = "#FAF2F2", - red_alt_1 = "#792a2e", - red_alt_2 = "#c0474a", - red_alt_3 = "#ee5859", - red_alt_4 = "#f49695", - red_alt_5 = "#f8d6d6", - red_alt_na = "#f8f4f4", - lt_grey_1 = "#C6C6C6", - lt_grey_2 = "#818183", - grey3 = "#E3E3E3", - dk_grey = "#464647", - two_dots_1 = "#706441", - two_dots_2 = "#56b4e9", - two_dots_flashy_1 = "gold1", - two_dots_flashy_2 = "blue2", - three_dots_1 = "aquamarine2", - three_dots_2 = "cornflowerblue", - three_dots_3 = "brown1", - orpink = "#f8aa9b", - pink = "#f5a6a7", - lt_pink = "#F9C6C7", - hot_pink = "#ef6d6f", - mddk_red = "#bf4749", - dk_red = "#782c2e", - orange = "#F69E61", - lt_green = "#B0CFAC", - green = "#84A181", - dk_green = "#526450", - red_less_4_1 = "#f6e3e3", - red_less_4_2 = "#f3b5b6", - red_less_4_3 = "#ee5a59", - red_less_4_4 = "#9d393c", - red_5_1 = "#f6e3e3", - red_5_2 = "#f3b5b6", - red_5_3 = "#ee5a59", - red_5_4 = "#c0474a", - red_5_5 = "#792a2e", - red_less_7_1 = "#f8f4f4", - red_less_7_2 = "#f8d6d6", - red_less_7_3 = "#f49695", - red_less_7_4 = "#ee5a59", - red_less_7_5 = "#c0474a", - red_less_7_6 = "#792a2e", - red_less_7_7 = "#471119", - green_2_1 = "#cce5c9", - green_2_2 = "#55a065", - green_3_1 = "#e6f2e0", - green_3_2 = "#7ebf85", - green_3_3 = "#2d8246", - green_4_1 = "#e6f2e1", - green_4_2 = "#b0d3ab", - green_4_3 = "#4bab5e", - green_4_4 = "#0c592e", - green_5_1 = "#e6f2e1", - green_5_2 = "#b0d3ab", - green_5_3 = "#6bb26a", - green_5_4 = "#229346", - green_5_5 = "#0c592e", - green_6_1 = "#e6f2e0", - green_6_2 = "#b0d3ab", - green_6_3 = "#75c376", - green_6_4 = "#086d38", - green_6_5 = "#0c592e", - green_6_6 = "#0d4420", - green_7_1 = "#fafafa", - green_7_2 = "#e6f2e0", - green_7_3 = "#b0d3ab", - green_7_4 = "#75c376", - green_7_5 = "#40ab5d", - green_7_6 = "#086d38", - green_7_7 = "#0d4420", - artichoke_2_1 = "#b6c8b1", - artichoke_2_2 = "#53755f", - artichoke_3_1 = "#e4f1db", - artichoke_3_2 = "#89a087", - artichoke_3_3 = "#455843", - artichoke_4_1 = "#e4f1db", - artichoke_4_2 = "#b5ceb2", - artichoke_4_3 = "#89a087", - artichoke_4_4 = "#465944", - artichoke_5_1 = "#e4f1db", - artichoke_5_2 = "#b5ceb2", - artichoke_5_3 = "#89a087", - artichoke_5_4 = "#60755f", - artichoke_5_5 = "#465944", - artichoke_6_1 = "#fafafa", - artichoke_6_2 = "#e4f1db", - artichoke_6_3 = "#b5ceb2", - artichoke_6_4 = "#89a087", - artichoke_6_5 = "#60755f", - artichoke_6_6 = "#455843", - artichoke_7_1 = "#fafafa", - artichoke_7_2 = "#e4f1db", - artichoke_7_3 = "#b5ceb2", - artichoke_7_4 = "#9fb89c", - artichoke_7_5 = "#89a087", - artichoke_7_6 = "#60755f", - artichoke_7_7 = "#455843", - blue_2_1 = "#7cb6c4", - blue_2_2 = "#286877 ", - blue_3_1 = "#b9d7de", - blue_3_2 = "#5ca4b4", - blue_3_3 = "#286877", - blue_4_1 = "#dfecef", - blue_4_2 = "#8fc1cc", - blue_4_3 = "#3f96aa", - blue_4_4 = "#286877", - blue_5_1 = "#dfecef", - blue_5_2 = "#8fc1cc", - blue_5_3 = "#3f96aa", - blue_5_4 = "#256a7a", - blue_5_5 = "#0c3842", - blue_6_1 = "#f4fbfe", - blue_6_2 = "#cfe4e9", - blue_6_3 = "#77b2bf", - blue_6_4 = "#4096aa", - blue_6_5 = "#256a7a", - blue_6_6 = "#0c3842", - blue_7_1 = "#f4fbfe", - blue_7_2 = "#b3d5de", - blue_7_3 = "#77b2bf", - blue_7_4 = "#4096aa", - blue_7_5 = "#27768a", - blue_7_6 = "#0c596b", - blue_7_7 = "#0c3842" - ) - - if (is.null(cols)) { - cols_to_return <- colors_reach - } else { - cols_to_return <- colors_reach[cols] - } - - if (unnamed) { - cols_to_return <- unname(cols_to_return) - } - - return(cols_to_return) -} diff --git a/R/data.R b/R/data.R deleted file mode 100644 index 8101ff4..0000000 --- a/R/data.R +++ /dev/null @@ -1,93 +0,0 @@ -#' Haïti admin 1 centroids shapefile. -#' -#' A multipoint shapefile of Haiti's admin 1. -#' -#' @format A sf multipoint object with 10 features and 9 fields: -#' \describe{ -#' \item{ADM1_PC}{Admin 1 postal code.} -#' \item{ADM1_EN}{Full name in English.} -#' \item{ADM1_FR}{Full name in French.} -#' \item{ADM1_HT}{Full name in Haitian Creole.} -#' \item{ADM0_EN}{Country name in English.} -#' \item{ADM0_FR}{Country name in French.} -#' \item{ADM0_HT}{Country name in Haitian Creole.} -#' \item{ADM0_PC}{Country postal code.} -#' \item{ADM1_FR_UPPER}{Admin 1 French name - uppercase.} -#' \item{geometry}{Multipoint geometry.} -#' } -"centroid_admin1" - - -#' Indicator admin 1 polygons shapefile. -#' -#' A multipolygon shapefile of Haiti's admin 1 with an indicator column 'opn_dfc'. -#' -#' @format A sf multipoint object with 10 features and 10 fields: -#' \describe{ -#' \item{ADM1_PC}{Admin 1 postal code.} -#' \item{admin1}{Admin 1 unique id.} -#' \item{opn_dfc}{Proportion of HHs that reported open defecation as sanitation facility.} -#' \item{ADM1_EN}{Full name in English.} -#' \item{ADM1_FR}{Full name in French.} -#' \item{ADM1_HT}{Full name in Haitian Creole.} -#' \item{ADM0_EN}{Country name in English.} -#' \item{ADM0_FR}{Country name in French.} -#' \item{ADM0_HT}{Country name in Haitian Creole.} -#' \item{ADM0_PC}{Country postal code.} -#' \item{geometry}{Multipolygon geometry.} -#' } -"indicator_admin1" - - -#' Haïti admin 1 lines shapefile. -#' -#' A multiline shapefile of Haiti's admin 1. -#' -#' @format A sf multiline object with 10 features and 8 fields: -#' \describe{ -#' \item{ADM1_EN}{Full name in English.} -#' \item{ADM1_FR}{Full name in French.} -#' \item{ADM1_HT}{Full name in Haitian Creole.} -#' \item{ADM0_EN}{Country name in English.} -#' \item{ADM0_FR}{Country name in French.} -#' \item{ADM0_HT}{Country name in Haitian Creole.} -#' \item{ADM0_PCODE}{Country postal code.} -#' \item{geometry}{Multiline geometry.} -#' } -"line_admin1" - - -#' Haïti border. -#' -#' A multiline shapefile of Haiti's border. -#' -#' @format A sf multiline objet with 1 feature and 6 fields: -#' \describe{ -#' \item{fid_1}{fid_1} -#' \item{uno}{uno} -#' \item{count}{count} -#' \item{x_coord}{x_coord} -#' \item{y_coord}{y_coord} -#' \item{area}{area} -#' \item{geometry}{Multiline geometry.} -#' } -"border_admin0" - - -#' Haïti frontier with Dominican Republic. -#' -#' A multiline shapefile of Haiti's frontier with Dominican Republic. -#' -#' @format A sf multipoint objet with 4 features and 8 fields: -#' \describe{ -#' \item{fid_1}{fid_1} -#' \item{objectid}{objectid} -#' \item{id}{id} -#' \item{fromnode}{fromnode} -#' \item{tonode}{tonode} -#' \item{leftpolygo}{leftpolygo} -#' \item{rightpolygo}{rightpolygo} -#' \item{shape_leng}{shape_leng} -#' \item{geometry}{Multiline geometry.} -#' } -"frontier_admin0" diff --git a/R/donut.R b/R/donut.R deleted file mode 100644 index 0c1cd93..0000000 --- a/R/donut.R +++ /dev/null @@ -1,107 +0,0 @@ -#' @title Simple donut chart (to be used parsimoniously), can be a pie chart -#' -#' @param df A data frame. -#' @param x A character column or coercible as a character column. Will give the donut's fill color. -#' @param y A numeric column. -#' @param alpha Fill transparency. -#' @param x_title The x scale title. Default to NULL. -#' @param title Plot title. Default to NULL. -#' @param subtitle Plot subtitle. Default to NULL. -#' @param caption Plot caption. Default to NULL. -#' @param arrange TRUE or FALSE. Arrange by highest percentage first. -#' @param hole_size Hole size. Default to 3. If less than 2, back to a pie chart. -#' @param add_text TRUE or FALSE. Add the value as text. -#' @param add_text_treshold_display Minimum value to add the text label. -#' @param add_text_color Text color. -#' @param add_text_suffix If percent is FALSE, should we add a suffix to the text label? -#' @param theme Whatever theme. Default to theme_reach(). -#' -#' @return A donut chart to be used parsimoniously -#' -#' @export -donut <- function(df, - x, - y, - alpha = 1, - x_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - arrange = TRUE, - hole_size = 3, - add_text = TRUE, - add_text_treshold_display = 5, add_text_color = "white", add_text_suffix = "", theme = theme_reach(legend_reverse = TRUE)){ - - # Arrange by biggest prop first ? - if (arrange) df <- dplyr::arrange( - df, - {{ y }} - ) - - # Get levels for scaling - lev <- dplyr::pull(df, {{ x }}) - df <- dplyr::mutate(df, "{{x}}" := factor({{ x }}, levels = lev)) - - # Mapping - g <- ggplot2::ggplot( - df, - mapping = ggplot2::aes( - x = hole_size, - y = {{ y }}, - fill = {{ x }}, - color = {{ x }} - ) - ) - - # Add rect - g <- g + ggplot2::geom_col(alpha = alpha) - - - # Add text labels - if (add_text) { - - df <- dplyr::mutate(df, y_treshold = ifelse({{ y }} >= add_text_treshold_display, {{ y }}, NA )) - - g <- g + - ggplot2::geom_text( - data = df, - ggplot2::aes( - x = hole_size, - y = !!rlang::sym("y_treshold"), - label = paste0({{ y }}, add_text_suffix)), - color = add_text_color, - position = ggplot2::position_stack(vjust = 0.5)) - } - - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - fill = x_title, - color = x_title - ) - - # Transform to polar coordinates and adjust hole - g <- g + - ggplot2::coord_polar( - theta = "y" - ) - - if (hole_size >= 2) g <- g + ggplot2::xlim(c(1, hole_size + 0.5)) # Try to remove that to see how to make a pie chart - - # Add theme - g <- g + theme - - # No axis - g <- g + ggplot2::theme( - axis.text = ggplot2::element_blank(), - axis.line = ggplot2::element_blank(), - axis.ticks = ggplot2::element_blank(), - axis.title = ggplot2::element_blank() - ) - - - return(g) - -} diff --git a/R/dumbbell.R b/R/dumbbell.R index 18f0e9a..e38acda 100644 --- a/R/dumbbell.R +++ b/R/dumbbell.R @@ -22,88 +22,134 @@ #' @param add_text_vjust Vertical adjustment. #' @param add_text_size Text size. #' @param add_text_color Text color. -#' @param theme A ggplot2 theme, default to `theme_reach()` +#' @param theme_fun A ggplot2 theme, default to `theme_dumbbell()` +#' @param scale_fill_fun A ggplot2 scale_fill function, default to `scale_fill_visualizer_discrete()` +#' @param scale_color_fun A ggplot2 scale_color function, default to `scale_color_visualizer_discrete()` #' #' @return A dumbbell chart. #' @export #' -dumbbell <- function(df, - col, - group_x, - group_y, - point_size = 5, - point_alpha = 1, - segment_size = 2.5, - segment_color = cols_reach("main_lt_grey"), - group_x_title = NULL, - group_y_title = NULL, - x_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - line_to_y_axis = TRUE, - line_to_y_axis_type = 3, - line_to_y_axis_width = 0.5, - line_to_y_axis_color = cols_reach("main_grey"), - add_text = TRUE, - add_text_vjust = 2, - add_text_size = 3.5, - add_text_color = cols_reach("main_grey"), - theme = theme_reach(palette = "primary")){ +dumbbell <- function( + df, + col, + group_x, + group_y, + point_size = 5, + point_alpha = 1, + segment_size = 2.5, + segment_color = color("light_blue_grey"), + group_x_title = NULL, + group_y_title = NULL, + x_title = NULL, + title = NULL, + subtitle = NULL, + caption = NULL, + line_to_y_axis = FALSE, + line_to_y_axis_type = 3, + line_to_y_axis_width = 0.5, + line_to_y_axis_color = color("dark_grey"), + add_text = FALSE, + add_text_vjust = 2, + add_text_size = 3.5, + add_text_color = color("dark_grey"), + theme_fun = theme_dumbbell(), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() +) { + #------ Checks + + # df is a data frame + checkmate::assert_data_frame(df) + + # col, group_x, group_y are character + checkmate::assert_character(col, len = 1) + checkmate::assert_character(group_x, len = 1) + checkmate::assert_character(group_y, len = 1) + + # col, group_x, group_y are columns in df + checkmate::assert_choice(col, colnames(df)) + checkmate::assert_choice(group_x, colnames(df)) + checkmate::assert_choice(group_y, colnames(df)) + + # Check numeric/logical values + checkmate::assert_numeric(point_size, len = 1) + checkmate::assert_numeric(point_alpha, lower = 0, upper = 1, len = 1) + checkmate::assert_numeric(segment_size, len = 1) + checkmate::assert_logical(line_to_y_axis, len = 1) + checkmate::assert_numeric(line_to_y_axis_type, len = 1) + checkmate::assert_numeric(line_to_y_axis_width, len = 1) + checkmate::assert_logical(add_text, len = 1) + checkmate::assert_numeric(add_text_vjust, len = 1) + checkmate::assert_numeric(add_text_size, len = 1) # Get group keys group_x_keys <- df |> - dplyr::group_by({{ group_x }}) |> + dplyr::group_by(!!rlang::sym(group_x)) |> dplyr::group_keys() |> dplyr::pull() # Check if only two groups - if (length(group_x_keys) > 2) rlang::abort("Cannot draw a dumbbell plot for `group_x` with more than 2 groups") + if (length(group_x_keys) > 2) { + rlang::abort( + "Cannot draw a dumbbell plot for `group_x` with more than 2 groups" + ) + } # Pivot long data df_pivot <- df |> tidyr::pivot_wider( - id_cols = c({{ group_y}}), - values_from = {{ col }}, - names_from = {{ group_x }} + id_cols = c(!!rlang::sym(group_y)), + values_from = !!rlang::sym(col), + names_from = !!rlang::sym(group_x) ) df_pivot <- df_pivot |> dplyr::rowwise() |> dplyr::mutate( - min = min(!!rlang::sym(group_x_keys[[1]]), !!rlang::sym(group_x_keys[[2]]), na.rm = T), - max = max(!!rlang::sym(group_x_keys[[1]]), !!rlang::sym(group_x_keys[[2]]), na.rm = T)) |> + min = min( + !!rlang::sym(group_x_keys[[1]]), + !!rlang::sym(group_x_keys[[2]]), + na.rm = T + ), + max = max( + !!rlang::sym(group_x_keys[[1]]), + !!rlang::sym(group_x_keys[[2]]), + na.rm = T + ) + ) |> dplyr::ungroup() |> dplyr::mutate(diff = max - min) g <- ggplot2::ggplot(df_pivot) # Add line - if(line_to_y_axis) { - - xend <- min(dplyr::pull(df, {{ col }})) + if (line_to_y_axis) { + xend <- min(dplyr::pull(df, !!rlang::sym(col))) g <- g + ggplot2::geom_segment( ggplot2::aes( x = min, - y = {{ group_y }}, - yend = {{ group_y }}), + y = !!rlang::sym(group_y), + yend = !!rlang::sym(group_y) + ), xend = xend, linetype = line_to_y_axis_type, - size = line_to_y_axis_width, - color = line_to_y_axis_color) + linewidth = line_to_y_axis_width, + color = line_to_y_axis_color + ) } # Add segment - g <- g + + g <- g + ggplot2::geom_segment( ggplot2::aes( x = !!rlang::sym(group_x_keys[[1]]), - y = {{ group_y }}, + y = !!rlang::sym(group_y), xend = !!rlang::sym(group_x_keys[[2]]), - yend = {{ group_y }}), - size = segment_size, + yend = !!rlang::sym(group_y) + ), + linewidth = segment_size, color = segment_color ) @@ -112,50 +158,54 @@ dumbbell <- function(df, ggplot2::geom_point( data = df, ggplot2::aes( - x = {{ col }}, - y = {{ group_y }}, - color = {{ group_x }}, - fill = {{ group_x }} + x = !!rlang::sym(col), + y = !!rlang::sym(group_y), + color = !!rlang::sym(group_x), + fill = !!rlang::sym(group_x) ), size = point_size, alpha = point_alpha ) # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - x = x_title, - y = group_y_title, - color = group_x_title, - fill = group_x_title - ) - - # Add stat labels to points - if(add_text) g <- g + - ggrepel::geom_text_repel( - data = df, - ggplot2::aes( - x = {{ col }}, - y = {{ group_y}}, - label = {{ col }} - ), - vjust = add_text_vjust, - size = add_text_size, - color = add_text_color + g <- g + + ggplot2::labs( + title = title, + subtitle = subtitle, + caption = caption, + x = x_title, + y = group_y_title, + color = group_x_title, + fill = group_x_title ) - # Expan y axis - # g <- g + - # ggplot2::scale_y_discrete( - # group_y_title, - # expand = c(0, 0)) - + # Add stat labels to points + if (add_text) { + g <- g + + ggrepel::geom_text_repel( + data = df, + ggplot2::aes( + x = !!rlang::sym(col), + y = !!rlang::sym(group_y), + label = !!rlang::sym(col) + ), + vjust = add_text_vjust, + size = add_text_size, + color = add_text_color + ) + } # Add theme - g <- g + theme + g <- g + theme_fun + + # Add scale fun + if (!is.null(scale_fill_fun)) { + g <- g + scale_fill_fun + } + + if (!is.null(scale_color_fun)) { + g <- g + scale_color_fun + } return(g) - } diff --git a/R/internals.R b/R/internals.R index 0f145b5..4856c41 100644 --- a/R/internals.R +++ b/R/internals.R @@ -1,95 +1,15 @@ -#' @title Abord bad argument -#' -#' @param arg An argument -#' @param must What arg must be -#' @param not Optional. What arg must not be. -#' -#' @return A stop statement -abort_bad_argument <- function(arg, must, not = NULL) { - msg <- glue::glue("`{arg}` must {must}") - if (!is.null(not)) { - not <- typeof(not) - msg <- glue::glue("{msg}; not {not}.") - } - - rlang::abort("error_bad_argument", - message = msg, - arg = arg, - must = must, - not = not - ) +# not in +`%notin%` <- function(a, b) { + !(a %in% b) } - - -#' @title Stop statement "If not in colnames" with colnames -#' -#' @param .tbl A tibble -#' @param cols A vector of column names (quoted) -#' @param df Provide the tibble name as a character string -#' @param arg Default to NULL. -#' -#' @return A stop statement -if_not_in_stop <- function(.tbl, cols, df, arg = NULL){ - if (is.null(arg)) { - msg <- glue::glue("The following column/s is/are missing in `{df}`:") - } - else { - msg <- glue::glue("The following column/s from `{arg}` is/are missing in `{df}`:") - } - if (!all(cols %in% colnames(.tbl))) { - rlang::abort( - c("Missing columns", - "*" = - paste( - msg, - paste( - subvec_not_in(cols, colnames(.tbl)), - collapse = ", ") - ) - ) - ) - } +# not all in +`%notallin%` <- function(a, b) { + !(all(a %in% b)) } - - -#' @title Stop statement "If not in vector" -#' -#' @param vec A vector of character strings -#' @param cols A set of character strings -#' @param vec_name Provide the vector name as a character string -#' @param arg Default to NULL. -#' -#' @return A stop statement if some elements of vec are not in cols -if_vec_not_in_stop <- function(vec, cols, vec_name, arg = NULL){ - if (is.null(arg)) { - msg <- glue::glue("The following element/s is/are missing in `{vec_name}`:") - } - else { - msg <- glue::glue("The following element/s from `{arg}` is/are missing in `{vec_name}`:") - } - if (!all(cols %in% vec)) { - rlang::abort( - c("Missing elements", - "*" = - paste( - msg, - paste( - subvec_not_in(cols, vec), - collapse = ", ") - ) - ) - ) - } -} - -#' @title Subvec not in -#' -#' @param vector A vector to subset -#' @param set A set-vector -#' -#' @return A subset of vector not in set -subvec_not_in <- function(vector, set){ - vector[!(vector %in% set)] +# infix for null replacement +#' @importFrom rlang `%||%` +`%ifnullrep%` <- function(a, b) { + a %||% b } diff --git a/R/lollipop.R b/R/lollipop.R index 60de655..1a5455f 100644 --- a/R/lollipop.R +++ b/R/lollipop.R @@ -1,121 +1,326 @@ -#' @title Simple bar chart +#' @rdname lollipop +#' +#' @inheritParams lollipop +#' +#' @export +hlollipop <- function( + ..., + flip = TRUE, + theme_fun = theme_lollipop(flip = flip)) { + lollipop(flip = flip, theme_fun = theme_fun, ...) +} + +#' Simple lollipop chart +#' +#' `lollipop()` is a simple lollipop chart (dots connected to the baseline by a segment) with some customization allowed. +#' `hlollipop()` uses `lollipop()` with sane defaults for a horizontal lollipop chart. #' #' @param df A data frame. -#' @param x A numeric column. -#' @param y A character column or coercible as a character column. -#' @param flip TRUE or FALSE. Default to TRUE or horizontal lollipop plot. +#' @param x A quoted character column or coercible as a character column. +#' @param y A quoted numeric column. +#' @param group Some quoted grouping categorical column, e.g. administrative areas or population groups. +#' @param facet Some quoted grouping categorical column, e.g. administrative areas or population groups. +#' @param x_rm_na Remove NAs in x? +#' @param y_rm_na Remove NAs in y? +#' @param group_rm_na Remove NAs in group? +#' @param facet_rm_na Remove NAs in facet? +#' @param y_expand Multiplier to expand the y axis. +#' @param add_color Add a color to dots (if no grouping). +#' @param add_color_guide Should a legend be added? +#' @param flip TRUE or FALSE (default). Default to TRUE or horizontal lollipop plot. #' @param wrap Should x-labels be wrapped? Number of characters. -#' @param arrange TRUE or FALSE. Arrange by highest percentage first. -#' @param point_size Point size. -#' @param point_color Point color. -#' @param point_alpha Point alpha. -#' @param segment_size Segment size. -#' @param segment_color Segment color. -#' @param segment_alpha Segment alpha. -#' @param alpha Fill transparency. +#' @param alpha Fill transparency for dots. #' @param x_title The x scale title. Default to NULL. #' @param y_title The y scale title. Default to NULL. +#' @param group_title The group legend title. Default to NULL. #' @param title Plot title. Default to NULL. #' @param subtitle Plot subtitle. Default to NULL. #' @param caption Plot caption. Default to NULL. -#' @param add_text TRUE or FALSE. Add the y value as text within the bubble. -#' @param add_text_size Text size. -#' @param add_text_suffix If percent is FALSE, should we add a suffix to the text label? -#' @param add_text_color Added text color. Default to white. -#' @param add_text_fontface Added text font face. Default to "bold". -#' @param theme Whatever theme. Default to theme_reach(). +#' @param dot_size The size of the dots. +#' @param line_size The size/width of the line connecting dots to the baseline. +#' @param line_color The color of the line connecting dots to the baseline. +#' @param dodge_width Width for position dodge when using groups (controls space between grouped lollipops). +#' @param theme_fun Whatever theme function. For no custom theme, use theme_fun = NULL. +#' @param scale_fill_fun Scale fill function. +#' @param scale_color_fun Scale color function. #' -#' @return A bar chart +#' @inheritParams reorder_by +#' +#' @importFrom rlang `:=` #' #' @export -lollipop <- function(df, - x, - y, - flip = TRUE, - wrap = NULL, - arrange = TRUE, - point_size = 3, - point_color = cols_reach("main_red"), - point_alpha = 1, - segment_size = 1, - segment_color = cols_reach("main_grey"), - segment_alpha = 1, - alpha = 1, - x_title = NULL, - y_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - add_text = FALSE, - add_text_size = 3, - add_text_suffix = "", - add_text_color = "white", - add_text_fontface = "bold", - theme = theme_reach()){ - - - # Arrange by biggest prop first ? - if (arrange) df <- dplyr::arrange( +lollipop <- function( df, - {{ y }} + x, + y, + group = "", + facet = "", + order = "y", + x_rm_na = TRUE, + y_rm_na = TRUE, + group_rm_na = TRUE, + facet_rm_na = TRUE, + y_expand = 0.1, + add_color = color("cat_5_main_1"), + add_color_guide = TRUE, + flip = FALSE, + wrap = NULL, + alpha = 1, + x_title = NULL, + y_title = NULL, + group_title = NULL, + title = NULL, + subtitle = NULL, + caption = NULL, + dot_size = 4, + line_size = 0.8, + line_color = color("dark_grey"), + dodge_width = 0.9, + theme_fun = theme_lollipop( + flip = flip, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5 + ), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete()) { + #------ Checks + + # df is a data frame + checkmate::assert_data_frame(df) + + # x and y and group are character + checkmate::assert_character(x, len = 1) + checkmate::assert_character(y, len = 1) + checkmate::assert_character(group, len = 1) + checkmate::assert_character(facet, len = 1) + + # x and y are columns in df + checkmate::assert_choice(x, colnames(df)) + checkmate::assert_choice(y, colnames(df)) + if (group != "") { + checkmate::assert_choice(group, colnames(df)) + } + if (facet != "") { + checkmate::assert_choice(facet, colnames(df)) + } + + # x_rm_na, y_rm_na and group_rm_na are logical scalar + checkmate::assert_logical(x_rm_na, len = 1) + checkmate::assert_logical(y_rm_na, len = 1) + checkmate::assert_logical(group_rm_na, len = 1) + checkmate::assert_logical(facet_rm_na, len = 1) + + # flip is a logical scalar + checkmate::assert_logical(flip, len = 1) + + # dodge_width is a numeric scalar + checkmate::assert_numeric(dodge_width, len = 1, lower = 0) + + # wrap is a numeric scalar or NULL + if (!is.null(wrap)) { + checkmate::assert_numeric(wrap, len = 1, null.ok = TRUE) + } + + # alpha is a numeric scalar between 0 and 1 + checkmate::assert_numeric(alpha, lower = 0, upper = 1, len = 1) + + # dot_size is a numeric scalar + checkmate::assert_numeric(dot_size, len = 1) + + # line_size is a numeric scalar + checkmate::assert_numeric(line_size, len = 1) + + # order is a character scalar in valid choices + checkmate::assert_choice(order, c("none", "y", "grouped_y", "x", "grouped_x")) + + # x and y are numeric or character + if (class(df[[y]]) %notin% c("integer", "numeric")) { + rlang::abort(paste0(y, " must be numeric.")) + } + if (!any(class(df[[x]]) %in% c("character", "factor"))) { + rlang::abort(paste0(x, " must be character or factor")) + } + + #----- Data wrangling + + # facets over group + if (group != "" && facet != "" && group == facet) { + rlang::warn("'group' and 'facet' are the same identical.") + } + + # remove NAs using base R + if (x_rm_na) { + df <- df[!(is.na(df[[x]])), ] + } + if (y_rm_na) { + df <- df[!(is.na(df[[y]])), ] + } + if (group != "" && group_rm_na) { + df <- df[!(is.na(df[[group]])), ] + } + if (facet != "" && facet_rm_na) { + df <- df[!(is.na(df[[facet]])), ] + } + + # reorder + dir_order <- if (flip && order %in% c("x", "grouped_x")) { + -1 + } else if (!flip && order %in% c("x", "grouped_x")) { + 1 + } else if (flip) { + 1 + } else { + -1 + } + group_order <- if (group != "" || (group == "" && facet == "")) { + group + } else if (group == "" && facet != "") { + facet + } + df <- reorder_by( + df = df, + x = x, + y = y, + group = group_order, + order = order, + dir_order = dir_order ) - # Get levels for scaling - lev <- dplyr::pull(df, {{ x }}) - df <- dplyr::mutate(df, "{{x}}" := factor({{ x }}, levels = lev)) + # prepare aes + if (group != "") { + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y), + fill = !!rlang::sym(group), + color = !!rlang::sym(group) + ) + ) + } else { + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y) + ) + ) + } - # Mapping - g <- ggplot2::ggplot( - df, - mapping = ggplot2::aes(x = {{ x }}, y = {{ y }}, xend = {{ x }}, yend = 0) - ) + # add title, subtitle, caption, x_title, y_title + g <- g + + ggplot2::labs( + title = title, + subtitle = subtitle, + caption = caption, + x = y_title, + y = x_title, + color = group_title, + fill = group_title + ) - # Add segment - g <- g + ggplot2::geom_segment( - linewidth = segment_size, - alpha = segment_alpha, - color = segment_color - ) + # facets + if (facet != "") { + if (flip) { + g <- g + + ggplot2::facet_grid( + rows = ggplot2::vars(!!rlang::sym(facet)), + scales = "free", + space = "free_y" + ) + } else { + g <- g + + ggplot2::facet_grid( + cols = ggplot2::vars(!!rlang::sym(facet)), + scales = "free", + space = "free_x" + ) + } + } - g <- g + ggplot2::geom_point( - size = point_size, - alpha = point_alpha, - color = point_color - ) + # Add segments and points + if (group != "") { + # With grouping - use position_dodge for side-by-side display + position_dodge_obj <- ggplot2::position_dodge(width = dodge_width) + g <- g + + ggplot2::geom_linerange( + mapping = ggplot2::aes( + ymin = 0, + ymax = !!rlang::sym(y), + group = !!rlang::sym(group) + ), + position = position_dodge_obj, + color = line_color, + linewidth = line_size + ) + + ggplot2::geom_point( + position = position_dodge_obj, + size = dot_size, + alpha = alpha + ) + } else { + # Without grouping + g <- g + + ggplot2::geom_linerange( + mapping = ggplot2::aes( + ymin = 0, + ymax = !!rlang::sym(y) + ), + color = line_color, + linewidth = line_size + ) + + ggplot2::geom_point( + size = dot_size, + alpha = alpha, + color = add_color, + fill = add_color + ) + } + + # wrap labels on the x scale? if (!is.null(wrap)) { g <- g + ggplot2::scale_x_discrete(labels = scales::label_wrap(wrap)) } - # Because a text legend should always be horizontal, especially for an horizontal bar graph - if (flip){ + # flip coordinates if needed + if (flip) { g <- g + ggplot2::coord_flip() } - # Add text labels - if (add_text) { - g <- g + ggplot2::geom_text( - ggplot2::aes( - label = paste0({{ y }}, add_text_suffix)), - size = add_text_size, - color = add_text_color, - fontface = add_text_fontface) - } + # y scale tweaks + g <- g + + ggplot2::scale_y_continuous( + # start at 0 + expand = ggplot2::expansion(mult = c(0, y_expand)), + # remove trailing 0 and choose accuracy of y labels + labels = scales::label_number( + accuracy = 0.1, + drop0trailing = TRUE, + big.mark = "", + decimal.mark = "." + ), + ) - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - x = x_title, - y = y_title, - ) + # remove guides for legend if !add_color_guide + if (!add_color_guide) { + g <- g + ggplot2::guides(fill = "none", color = "none") + } + # add theme fun + if (!is.null(theme_fun)) { + g <- g + theme_fun + } - # Add theme - g <- g + theme + # add scale fun + if (!is.null(scale_fill_fun)) { + g <- g + scale_fill_fun + } + + if (!is.null(scale_color_fun)) { + g <- g + scale_color_fun + } return(g) - } - diff --git a/R/map.R b/R/map.R deleted file mode 100644 index 3e9ac1b..0000000 --- a/R/map.R +++ /dev/null @@ -1,354 +0,0 @@ - - -#' Wrapper around `tmap::tm_polygons()` with sane defaults for plotting indicator values -#' -#' @param poly Multipolygon shape defined by sf package. -#' @param col Numeric attribute to map. -#' @param buffer A buffer, either one value or a vector of 4 values (left, bottom, right, top). -#' @param n The desire number of classes. -#' @param style Method to process the color scale for continuous numerical variables. See `classInt::classIntervals()` for details. -#' @param palette Vector of fill colors as hexadecimal values. For REACH color palettes, it is possible to use `pal_reach()`. For now,'palette' must be changed manually, accordingly to the number of drawn classes. -#' @param as_count Boolean. When col is a numeric variable, should it be processed as a count variable? For instance, 0, 1-10, 11-20. -#' @param color_na Fill color for missing data. -#' @param text_na Legend text for missing data. -#' @param legend_title Legend title. -#' @param legend_text_separator Text separator for classes. E.g. " to " will give 0, 1 to 10, 11 to 20. -#' @param border_alpha Transparency of the border. -#' @param border_col Color of the border. -#' @param lwd Linewidth of the border. -#' @param ... Other arguments to pass to `tmap::tm_polygons()`. -#' -#' @return A tmap layer. -#' @export -#' -add_indicator_layer <- function( - poly, - col, - buffer = NULL, - n = 5, - style = "pretty", - palette = pal_reach("red_5"), - as_count = TRUE, - color_na = cols_reach("white"), - text_na = "Missing data", - legend_title = "Proportion (%)", - legend_text_separator = " - ", - border_alpha = 1, - border_col = cols_reach("lt_grey_1"), - lwd = 1, - ...){ - - #------ Checks and make valid - - rlang::check_installed("tmap", reason = "Package \"tmap\" needed for `add_indicator_layer()` to work. Please install it.") - - poly <- sf::st_make_valid(poly) - - #------ Other checks - - col_name <- rlang::as_name(rlang::enquo(col)) - if_not_in_stop(poly, col_name, "poly", "col") - - if (!is.numeric(poly[[col_name]])) rlang::abort(glue::glue("{col_name} is not numeric.")) - - - #------ Prepare data - - if(!is.null(buffer)){ buffer <- buffer_bbox(poly, buffer) } else { buffer <- NULL } - - - #------ Polygon layer - - layer <- tmap::tm_shape( - poly, - bbox = buffer - ) + - tmap::tm_polygons( - col = col_name, - n = n, - style = style, - palette = palette, - as.count = as_count, - colorNA = color_na, - textNA = text_na, - title = legend_title, - legend.format = list(text.separator = legend_text_separator), - borderl.col = border_col, - border.alpha = border_alpha, - lwd = lwd, - ... - ) - - return(layer) - -} - - - - -#' Add admin boundaries (lines) and the legend -#' -#' @param lines List of multiline shape defined by sf package. -#' @param colors Vector of hexadecimal codes. Same order as lines. -#' @param labels Vector of labels in the legend. Same order as lines. -#' @param lwds Vector of line widths. Same order as lines. -#' @param title Legend title. -#' @param buffer A buffer, either one value or a vector of 4 values (left, bottom, right, top). -#' @param ... Other arguments to pass to each shape in `tmap::tm_lines()`. -#' -#' @return A tmap layer. -#' @export -#' -add_admin_boundaries <- function(lines, colors, labels, lwds, title = "", buffer = NULL, ...){ - - - #------ Package check - - rlang::check_installed("tmap", reason = "Package \"tmap\" needed for `add_admin_boundaries()` to work. Please install it.") - - - #------ Check that the length of vectors is identical between arguments - - if(!inherits(lines, "list")) rlang::abort("Please provide a list for lines.") - - ll <- list(lines, colors, labels, lwds) - if (!all(sapply(ll,length) == length(ll[[1]]))) rlang::abort("lines, colors, labels, lwds do not all have the same length.") - - - #------ Make valid - - lines <- lapply(lines, \(x) sf::st_make_valid(x)) - - - #------ Prepare legend - legend_lines <- tmap::tm_add_legend("line", - title = title, - col = colors, - lwd = lwds, - labels = labels) - - - #------ Let's go with all line shapes - - if(!is.null(buffer)){ buffer <- buffer_bbox(lines[[1]], buffer) } else { buffer <- NULL } - - - layers <- tmap::tm_shape(lines[[1]], bbox = buffer) + - tmap::tm_lines(lwd = lwds[[1]], col = colors[[1]], ...) - - if (length(lines) == 1) { - - layers <- layers + legend_lines - - return(layers) - - } else { - - for(i in 2:length(lines)){ - - layers <- layers + tmap::tm_shape(shp = lines[[i]]) + tmap::tm_lines(lwd = lwds[[i]], col = colors[[i]], ...) - } - - layers <- layers + legend_lines - - return(layers) - - } -} - - - - -#' Basic defaults based on `tmap::tm_layout()` -#' -#' @param title Map title. -#' @param legend_position Legend position. Not above the map is a good start. -#' @param frame Boolean. Legend frame? -#' @param legend_frame Legend frame color. -#' @param legend_text_size Legend text size in 'pt'. -#' @param legend_title_size Legend title size in 'pt'. -#' @param title_size Title text size in 'pt'. -#' @param title_fontface Title fontface. Bold if you wanna exemplify a lot what it is about. -#' @param title_color Title font color. -#' @param fontfamily Overall fontfamily. Leelawadee is your precious. -#' @param ... Other arguments to pass to `tmap::tm_layout()`. -#' -#' @return A tmap layer. -#' @export -#' -add_layout <- function( - title = NULL, - legend_position = c(0.02, 0.5), - frame = FALSE, - legend_frame = cols_reach("main_grey"), - legend_text_size = 0.6, - legend_title_size = 0.8, - title_size = 0.9, - title_fontface = "bold", - title_color = cols_reach("main_grey"), - # check.and.fix = TRUE, - fontfamily = "Leelawadee", - ...){ - - layout <- tmap::tm_layout( - title = title, - legend.position = legend_position, - legend.frame = legend_frame, - frame = FALSE, - legend.text.size = legend_text_size, - legend.title.size = legend_title_size, - title.size = title_size, - title.fontface = title_fontface, - title.color = title_color, - fontfamily = fontfamily, - ...) - - return(layout) - - } - - - - -#' Wrapper around `tmap::tm_text()` with sane defaults for plotting admin labels. -#' -#' @param point Multipoint shape defined by sf package. -#' @param text Text labels column. -#' @param size Relative size of the text labels. -#' @param fontface Fontface. -#' @param fontfamily Fontfamily. Leelawadee is your precious. -#' @param shadow Boolean. Add a shadow around text labels. Issue opened on Github to request. -#' @param auto_placement Logical that determines whether the labels are placed automatically. -#' @param remove_overlap Logical that determines whether the overlapping labels are removed. -#' @param ... Other arguments to pass to `tmap::tm_text()`. -#' -#' @return A tmap layer. -#' @export -#' -add_admin_labels <- function(point, - text, - size = 0.5, - fontface = "bold", - fontfamily = "Leelawadee", - shadow = TRUE, - auto_placement = FALSE, - remove_overlap = FALSE, - ...){ - - - #------ Restrictive sf checks (might not be necessary depending on the desired behaviour) - - rlang::check_installed("tmap", reason = "Package \"tmap\" needed for `add_indicator_layer()` to work. Please install it.") - - point <- sf::st_make_valid(point) - - #------ Other checks - - text_name <- rlang::as_name(rlang::enquo(text)) - if_not_in_stop(point, text_name, "point", "text") - - #------ Point text layer - - layer <- tmap::tm_shape(point) + - tmap::tm_text(text = text_name, - size = size, - fontface = fontface, - fontfamily = fontfamily, - shadow = shadow, - auto.placement = auto_placement, - remove.overlap = remove_overlap, - ...) - - return(layer) - -} - - - - -#' Add a compass -#' -#' @param text_size Relative font size. -#' @param position Position of the compass. Vector of two values, specifying the x and y coordinates. -#' @param color_dark Color of the dark parts of the compass. -#' @param text_color color of the text. -#' @param type Compass type, one of: "arrow", "4star", "8star", "radar", "rose". -#' @param ... Other arguments to pass to `tmap::tm_compass()`. -#' -#' @return A tmap layer. -#' @export -#' -add_compass <- function(text_size = 0.6, - position = c("right", 0.8), - color_dark = cols_reach("black"), - text_color = cols_reach("black"), - type = "4star", - ...){ - - compass <- tmap::tm_compass( - text.size = text_size, - position = position, - color.dark = color_dark, - type = type, - text.color = text_color - ) - - return(compass) - -} - - - - -#' Add a scale bar -#' -#' @param text_size Relative font size. -#' @param position Position of the compass. Vector of two values, specifying the x and y coordinates. -#' @param color_dark Color of the dark parts of the compass. -#' @param breaks Breaks of the scale bar. If not specified, breaks will be automatically be chosen given the prefered width of the scale bar. Example: c(0, 50, 100). -#' @param ... Other arguments to pass to `tmap::tm_compass()`. -#' -#' @return A tmap layer. -#' @export -#' -add_scale_bar <- function(text_size = 0.6, - position = c("left", 0.01), - color_dark = cols_reach("black"), - breaks = c(0, 50, 100), - ...){ - - scale_bar <- tmap::tm_scale_bar( - text.size = text_size, - position = position, - color.dark = color_dark, - breaks = breaks, - ... - ) - - return(scale_bar) - -} - - - - -#' Do you want to credit someone or some institution? -#' -#' @param text Text. -#' @param size Relative text size. -#' @param bg_color Background color. -#' @param position Position. Vector of two coordinates. Usually somewhere down. -#' @param ... Other arguments to pass to `tmap::tm_credits()`. -#' -#' @return A tmap layer. -#' @export -#' -add_credits <- function(text, size = 0.4, bg_color = NA, position = c(0.75, 0.02), ...){ - - tmap::tm_credits(text, - size = size, - bg.color = bg_color, - position = position, - ...) -} - diff --git a/R/pal_agora.R b/R/pal_agora.R deleted file mode 100644 index 756e9d8..0000000 --- a/R/pal_agora.R +++ /dev/null @@ -1,34 +0,0 @@ -#' @title Return function to interpolate an AGORA color palette -#' -#' @param palette Character name of a palette in AGORA palettes -#' @param reverse Boolean indicating whether the palette should be reversed -#' @param color_ramp_palette Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE` -#' @param show_palettes Should the ouput be the set of palettes names to pick from? Default to `FALSE` -#' @param ... Additional arguments to pass to colorRampPalette() -#' -#' @return A color palette -#' -#' @export -pal_agora <- function(palette = "main", reverse = FALSE, color_ramp_palette = FALSE, show_palettes = FALSE, ...) { - - - palettes_agora <- list( - `main` = cols_agora("main_bordeaux", "main_dk_beige", "main_lt_grey", "main_lt_beige"), - `primary` = cols_agora("main_bordeaux", "main_dk_beige"), - `secondary` = cols_agora( "main_lt_grey", "main_lt_beige") - ) - - if (show_palettes) return(names(palettes_agora)) - - pal <- palettes_agora[[palette]] - - if (reverse) pal <- rev(pal) - - if (color_ramp_palette) { - rlang::check_installed("grDevices", reason = "Package \"grDevices\" needed for `pal_agora()` woth 'color_ramp_palette' set to `TRUE` to work. Please install it.") - - pal <- grDevices::colorRampPalette(pal, ...) - } - - return(pal) -} diff --git a/R/pal_fallback.R b/R/pal_fallback.R deleted file mode 100644 index 0fb7b23..0000000 --- a/R/pal_fallback.R +++ /dev/null @@ -1,30 +0,0 @@ -#' @title Return function to interpolate a fallback palette base on viridis::magma() -#' -#' @param reverse Boolean indicating whether the palette should be reversed -#' @param color_ramp_palette Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the latter with `FALSE` -#' @param discrete Boolean. Discrete or not? Default to FALSE. -#' @param n Number of colors in the palette. Default to 5. Passe to `viridis::magma()` -#' @param ... Other parameters to pass to `grDevices::colorRampPalette()` -#' -#' @return A color palette -#' -#' @export -pal_fallback <- function(reverse = FALSE, - color_ramp_palette = FALSE, - discrete = FALSE, - n = 5, - ...){ - - pal <- if(discrete) { viridisLite::viridis(n) } else {viridisLite::magma(n)} - - if (reverse) pal <- rev(pal) - - if (color_ramp_palette) { - rlang::check_installed("grDevices", reason = "Package \"grDevices\" needed for `pal_fallback()` with 'color_ramp_palette' set to `TRUE` to work. Please install it.") - - pal <- grDevices::colorRampPalette(pal, ...) - } - - return(pal) - -} diff --git a/R/pal_impact.R b/R/pal_impact.R deleted file mode 100644 index ff9b561..0000000 --- a/R/pal_impact.R +++ /dev/null @@ -1,34 +0,0 @@ -#' @title Return function to interpolate an IMPACT color palette -#' -#' @param palette Character name of a palette in IMPACT palettes -#' @param reverse Boolean indicating whether the palette should be reversed -#' @param color_ramp_palette Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE` -#' @param show_palettes Should the ouput be the set of palettes names to pick from? Default to `FALSE` -#' @param ... Additional arguments to pass to colorRampPalette() -#' -#' @return A color palette -#' -#' @export -pal_impact <- function(palette = "main", reverse = FALSE, color_ramp_palette = FALSE, show_palettes = FALSE, ...) { - - - palettes_impact <- list( - `main` = cols_impact("black", "white", "main_blue", "main_grey"), - `primary` = cols_impact("black", "white"), - `secondary` = cols_impact("main_blue", "main_grey") - ) - - if (show_palettes) return(names(palettes_impact)) - - pal <- palettes_impact[[palette]] - - if (reverse) pal <- rev(pal) - - if (color_ramp_palette) { - rlang::check_installed("grDevices", reason = "Package \"grDevices\" needed for `pal_impact()` woth 'color_ramp_palette' set to `TRUE` to work. Please install it.") - - pal <- grDevices::colorRampPalette(pal, ...) - } - - return(pal) -} diff --git a/R/pal_reach.R b/R/pal_reach.R deleted file mode 100644 index 7472c08..0000000 --- a/R/pal_reach.R +++ /dev/null @@ -1,66 +0,0 @@ -#' @title Return function to interpolate a REACH color palette -#' -#' @param palette Character name of a palette in REACH palettes -#' @param reverse Boolean indicating whether the palette should be reversed -#' @param color_ramp_palette Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE` -#' @param show_palettes Should the ouput be the set of palettes names to pick from? Default to `FALSE` -#' @param ... Additional arguments to pass to colorRampPalette() -#' -#' @return A color palette -#' -#' @export -pal_reach <- function(palette = "main", reverse = FALSE, color_ramp_palette = FALSE, show_palettes = FALSE, ...) { - - palettes_reach <- list( - `main` = cols_reach("main_grey", "main_red", "main_lt_grey", "main_beige"), - `primary` = cols_reach("main_grey", "main_red"), - `secondary` = cols_reach("main_lt_grey", "main_beige"), - `two_dots` = cols_reach("two_dots_1", "two_dots_2"), - `two_dots_flashy` = cols_reach("two_dots_flashy_1", "two_dots_flashy_2"), - `red_main` = cols_reach("red_main_1", "red_main_2", "red_main_3", "red_main_4", "red_main_5"), - `red_main_5` = cols_reach("red_main_1", "red_main_2", "red_main_3", "red_main_4", "red_main_5"), - `red_alt` = cols_reach("red_alt_1", "red_alt_2", "red_alt_3", "red_alt_4", "red_alt_5"), - `red_alt_5` = cols_reach("red_alt_1", "red_alt_2", "red_alt_3", "red_alt_4", "red_alt_5"), - `iroise` = cols_reach("iroise_1", "iroise_2", "iroise_3", "iroise_4", "iroise_5"), - `iroise_5` = cols_reach("iroise_1", "iroise_2", "iroise_3", "iroise_4", "iroise_5"), - `discrete_6` = cols_reach("dk_grey", "red_main_1", "main_beige", "red_main_2", "lt_grey_2", "red_4"), - `red_2` = cols_reach("red_less_4_1", "red_less_4_3"), - `red_3` = cols_reach("red_less_4_1", "red_less_4_2", "red_less_4_3"), - `red_4` = cols_reach("red_less_4_1", "red_less_4_2", "red_less_4_3", "red_less_4_4"), - `red_5` = cols_reach("red_5_1", "red_5_2", "red_5_3", "red_5_4", "red_5_5"), - `red_6` = cols_reach("red_less_7_1", "red_less_2", "red_less_7_3", "red_less_7_4", "red_less_7_5", "red_less_7_6"), - `red_7` = cols_reach("red_less_7_1", "red_less_7_2", "red_less_7_3", "red_less_7_4", "red_less_7_5", "red_less_7_6", "red_less_7_7"), - `green_2` = cols_reach("green_2_1", "green_2_2"), - `green_3` = cols_reach("green_3_1", "green_3_2", "green_3_3"), - `green_4` = cols_reach("green_4_1", "green_4_2", "green_4_3", "green_4_4"), - `green_5` = cols_reach("green_5_1", "green_5_2", "green_5_3", "green_5_4", "green_5_5"), - `green_6` = cols_reach("green_6_1", "green_6_2", "green_6_3", "green_6_4", "green_6_5", "green_6_6"), - `green_7` = cols_reach("green_7_1", "green_7_2", "green_7_3", "green_7_4", "green_7_5", "green_7_6", "green_7_7"), - `artichoke_2` = cols_reach("artichoke_2_1", "artichoke_2_2"), - `artichoke_3` = cols_reach("artichoke_3_1", "artichoke_3_2", "artichoke_3_3"), - `artichoke_4` = cols_reach("artichoke_4_1", "artichoke_4_2", "artichoke_4_3", "artichoke_4_4"), - `artichoke_5` = cols_reach("artichoke_5_1", "artichoke_5_2", "artichoke_5_3", "artichoke_5_4", "artichoke_5_5"), - `artichoke_6` = cols_reach("artichoke_6_1", "artichoke_6_2", "artichoke_6_3", "artichoke_6_4", "artichoke_6_5", "artichoke_6_6"), - `artichoke_7` = cols_reach("artichoke_7_1", "artichoke_7_2", "artichoke_7_3", "artichoke_7_4", "artichoke_7_5", "artichoke_7_6", "artichoke_7_7"), - `blue_2` = cols_reach("blue_2_1", "blue_2_2"), - `blue_3` = cols_reach("blue_3_1", "blue_3_2", "blue_3_3"), - `blue_4` = cols_reach("blue_4_1", "blue_4_2", "blue_4_3", "blue_4_4"), - `blue_5` = cols_reach("blue_5_1", "blue_5_2", "blue_5_3", "blue_5_4", "blue_5_5"), - `blue_6` = cols_reach("blue_6_1", "blue_6_2", "blue_6_3", "blue_6_4", "blue_6_5", "blue_6_6"), - `blue_7` = cols_reach("blue_7_1", "blue_7_2", "blue_7_3", "blue_7_4", "blue_7_5", "blue_7_6", "blue_7_7") - ) - - if (show_palettes) return(names(palettes_reach)) - - pal <- palettes_reach[[palette]] - - if (reverse) pal <- rev(pal) - - if (color_ramp_palette) { - rlang::check_installed("grDevices", reason = "Package \"grDevices\" needed for `pal_reach()` with 'color_ramp_palette' set to `TRUE` to work. Please install it.") - - pal <- grDevices::colorRampPalette(pal, ...) - } - - return(pal) -} diff --git a/R/palette.R b/R/palette.R new file mode 100644 index 0000000..9ff3184 --- /dev/null +++ b/R/palette.R @@ -0,0 +1,81 @@ +#' @title Interpolate a color palette +#' +#' @param palette Character name of a palette in palettes +#' @param reverse Boolean indicating whether the palette should be reversed +#' @param show_palettes Should the ouput be the set of palettes names to pick from? Default to `FALSE` +#' @param ... Additional arguments to pass to colorRampPalette() +#' +#' @return A color palette +#' +#' @export +palette <- function( + palette = "cat_5_main", + reverse = FALSE, + show_palettes = FALSE, + ... +) { + #------ Checks + + # palette is a character scalar + checkmate::assert_character(palette, len = 1) + + # reverse is a logical scalar + checkmate::assert_logical(reverse, len = 1) + + # show_palettes is a logical scalar + checkmate::assert_logical(show_palettes, len = 1) + + #------ Get colors + + # Define palettes + pals <- list( + cat_2_yellow = color_pattern("cat_2_yellow"), + cat_2_light = color_pattern("cat_2_light"), + cat_2_green = color_pattern("cat_2_green"), + cat_2_blue = color_pattern("cat_2_blue"), + cat_5_main = color_pattern("cat_5_main"), + cat_5_ibm = color_pattern("cat_5_ibm"), + cat_3_aquamarine = color_pattern("cat_3_aquamarine"), + cat_3_tol_high_contrast = color_pattern("cat_3_tol_high_contrast"), + cat_8_tol_adapted = color_pattern("cat_8_tol_adapted"), + cat_3_custom_1 = c("#003F5C", "#58508D", "#FFA600"), + cat_4_custom_1 = c("#003F5C", "#7a5195", "#ef5675", "#ffa600"), + cat_5_custom_1 = c("#003F5C", "#58508d", "#bc5090", "#ff6361", "#ffa600"), + cat_6_custom_1 = c( + "#003F5C", + "#444e86", + "#955196", + "#dd5182", + "#ff6e54", + "#ffa600" + ), + div_5_orange_blue = color_pattern("div_5_orange_blue"), + div_5_green_purple = color_pattern("div_5_green_purple") + ) + + # Return if show palettes + if (show_palettes) { + return(names(pals)) + } + + # palette is in pals + if (palette %notin% names(pals)) { + rlang::abort(c( + "Palette not defined", + "*" = glue::glue( + "Palette `{palette}` is not defined in the `palettes` list." + ), + "i" = "Use `palette(show_palettes = TRUE)` to see all available palettes." + )) + } + + #------ Get palette + + pal <- pals[[palette]] + + if (reverse) { + pal <- rev(pal) + } + + return(pal) +} diff --git a/R/palette_gen.R b/R/palette_gen.R new file mode 100644 index 0000000..dcbffe9 --- /dev/null +++ b/R/palette_gen.R @@ -0,0 +1,79 @@ +#' Generate color palettes +#' +#' [palette_gen()] generates a color palette and let you choose whether continuous or discrete. [palette_gen_categorical()] and [palette_gen_sequential()] generates respectively discrete and continuous palettes. +#' +#' @param palette Palette name from [palette()]. +#' @param type "categorical" or "sequential" or "divergent". +#' @param direction 1 or -1; should the order of colors be reversed? +#' @param ... Additional arguments to pass to [colorRampPalette()] when type is "continuous". +#' +#' @export +palette_gen <- function(palette, type, direction = 1, ...) { + #------ Checks + + checkmate::assert_string(palette) + checkmate::assert_choice(type, c("categorical", "sequential", "divergent")) + checkmate::assert_number(direction, lower = -1, upper = 1) + checkmate::assert_true(abs(direction) == 1) + + if (type == "categorical") { + return(palette_gen_categorical(palette = palette, direction = direction)) + } + + if (type %in% c("sequential", "divergent")) { + return(palette_gen_sequential( + palette = palette, + direction = direction, + ... + )) + } +} + + +#' @rdname palette_gen +#' +#' @export +palette_gen_categorical <- function(palette = "cat_5_main", direction = 1) { + #------ Checks + + checkmate::assert_string(palette) + checkmate::assert_number(direction, lower = -1, upper = 1) + checkmate::assert_true(abs(direction) == 1) + + pal <- palette(palette) + + f <- function(n) { + if (is.null(n)) { + n <- length(pal) + } + + if (n > length(pal)) { + rlang::warn("Not enough colors in this palette!") + } + + pal <- if (direction == 1) pal else rev(pal) + + pal <- pal[1:n] + + return(pal) + } + + return(f) +} + +#' @rdname palette_gen +#' +#' @export +palette_gen_sequential <- function(palette = "cat_5_main", direction = 1, ...) { + #------ Checks + + checkmate::assert_string(palette) + checkmate::assert_number(direction, lower = -1, upper = 1) + checkmate::assert_true(abs(direction) == 1) + + pal <- palette(palette) + + pal <- if (direction == 1) pal else rev(pal) + + grDevices::colorRampPalette(pal, ...) +} diff --git a/R/point.R b/R/point.R index 9dae4bf..e4dab31 100644 --- a/R/point.R +++ b/R/point.R @@ -1,10 +1,18 @@ -#' @title Simple point chart +#' @title Simple scatterplot #' #' @param df A data frame. -#' @param x A numeric column. -#' @param y A character column or coercible as a character column. -#' @param group Some grouping categorical column, e.g. administrative areas or population groups. -#' @param flip TRUE or FALSE. Default to TRUE or horizontal bar plot. +#' @param x A quoted numeric column. +#' @param y A quoted numeric column. +#' @param group Some quoted grouping categorical column, e.g. administrative areas or population groups. +#' @param facet Some quoted grouping categorical column. +#' @param facet_scales Character. Either "free" (default) or "fixed" for facet scales. +#' @param x_rm_na Remove NAs in x? +#' @param y_rm_na Remove NAs in y? +#' @param group_rm_na Remove NAs in group? +#' @param facet_rm_na Remove NAs in facet? +#' @param add_color Add a color to points (if no grouping). +#' @param add_color_guide Should a legend be added? +#' @param flip TRUE or FALSE. #' @param alpha Fill transparency. #' @param size Point size. #' @param x_title The x scale title. Default to NULL. @@ -13,69 +21,192 @@ #' @param title Plot title. Default to NULL. #' @param subtitle Plot subtitle. Default to NULL. #' @param caption Plot caption. Default to NULL. -#' @param theme Whatever theme. Default to theme_reach(). +#' @param theme_fun Whatever theme. Default to theme_point(). NULL if no theming needed. #' -#' @return A bar chart +#' @inheritParams scale_color_visualizer_discrete #' #' @export -point <- function(df, x, y, group = NULL, flip = TRUE, alpha = 1, size = 1, x_title = NULL, y_title = NULL, group_title = NULL, title = NULL, subtitle = NULL, caption = NULL, theme = theme_reach()){ +point <- function( + df, + x, + y, + group = "", + facet = "", + facet_scales = "free", + x_rm_na = TRUE, + y_rm_na = TRUE, + group_rm_na = TRUE, + facet_rm_na = TRUE, + add_color = color("cat_5_main_1"), + add_color_guide = TRUE, + flip = TRUE, + alpha = 1, + size = 2, + x_title = NULL, + y_title = NULL, + group_title = NULL, + title = NULL, + subtitle = NULL, + caption = NULL, + theme_fun = theme_point(), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() +) { + #------ Checks - # To do : - # - automate bar width and text size, or at least give the flexibility and still center text - # - add facet possibility + # df is a data frame + checkmate::assert_data_frame(df) - # Prepare group, x and y names - # if (is.null(x_title)) x_title <- rlang::as_name(rlang::enquo(x)) - # if (is.null(y_title)) y_title <- rlang::as_name(rlang::enquo(y)) - # if (is.null(group_title)) group_title <- rlang::as_name(rlang::enquo(group)) + # x and y and group are character + checkmate::assert_character(x, len = 1) + checkmate::assert_character(y, len = 1) + checkmate::assert_character(group, len = 1) - # Mapping - g <- ggplot2::ggplot( - df, - mapping = ggplot2::aes(x = {{ x }}, y = {{ y }}, fill = {{ group }}, color = {{ group }} + # x and y are columns in df + checkmate::assert_choice(x, colnames(df)) + checkmate::assert_choice(y, colnames(df)) + if (group != "") { + checkmate::assert_choice(group, colnames(df)) + } + + # x_rm_na, y_rm_na and group_rm_na are logical scalar + checkmate::assert_logical(x_rm_na, len = 1) + checkmate::assert_logical(y_rm_na, len = 1) + checkmate::assert_logical(group_rm_na, len = 1) + checkmate::assert_logical(facet_rm_na, len = 1) + + # facet_scales is a character scalar in c("free", "fixed") + checkmate::assert_choice(facet_scales, c("free", "fixed")) + + # flip is a logical scalar + checkmate::assert_logical(flip, len = 1) + + # alpha is a numeric scalar between 0 and 1 + checkmate::assert_numeric(alpha, lower = 0, upper = 1, len = 1) + + # size is a numeric scalar + checkmate::assert_numeric(size, len = 1) + + # x and y are numeric + if (!any(c("numeric", "integer") %in% class(df[[x]]))) { + rlang::abort(paste0(x, " must be numeric.")) + } + if (!any(c("numeric", "integer") %in% class(df[[y]]))) { + rlang::abort(paste0(y, " must be numeric.")) + } + + #----- Data wrangling + + # facets over group + if (group != "" && facet != "" && group == facet) { + rlang::warn("'group' and 'facet' are the same identical.") + } + + # remove NAs using base R + if (x_rm_na) { + df <- df[!(is.na(df[[x]])), ] + } + if (y_rm_na) { + df <- df[!(is.na(df[[y]])), ] + } + if (group != "" && group_rm_na) { + df <- df[!(is.na(df[[group]])), ] + } + if (facet != "" && facet_rm_na) { + df <- df[!(is.na(df[[facet]])), ] + } + + # prepare aes + if (group != "") { + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y), + fill = !!rlang::sym(group), + color = !!rlang::sym(group) + ) ) - ) + } else { + g <- ggplot2::ggplot( + df, + mapping = ggplot2::aes( + x = !!rlang::sym(x), + y = !!rlang::sym(y) + ) + ) + } - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - x = x_title, - y = y_title, - color = group_title, - fill = group_title - ) + # add title, subtitle, caption, x_title, y_title + g <- g + + ggplot2::labs( + title = title, + subtitle = subtitle, + caption = caption, + x = x_title, + y = y_title, + color = group_title, + fill = group_title + ) - width <- 0.5 - dodge_width <- 0.5 + # facets + # facets + if (facet != "") { + if (flip) { + g <- g + + ggplot2::facet_grid( + rows = ggplot2::vars(!!rlang::sym(facet)), + scales = facet_scales, + space = if (facet_scales == "free") "free_y" else "fixed" + ) + } else { + g <- g + + ggplot2::facet_grid( + cols = ggplot2::vars(!!rlang::sym(facet)), + scales = facet_scales, + space = if (facet_scales == "free") "free_x" else "fixed" + ) + } + } # Should the graph use position_fill? - g <- g + ggplot2::geom_point( - alpha = alpha, - size = size - ) + if (group != "") { + g <- g + + ggplot2::geom_point( + alpha = alpha, + size = size + ) + } else { + g <- g + + ggplot2::geom_point( + alpha = alpha, + size = size, + color = add_color + ) + } - # Labels to percent and expand scale - # if (percent) { - # g <- g + ggplot2::scale_y_continuous( - # labels = scales::label_percent( - # accuracy = 1, - # decimal.mark = ",", - # suffix = " %"), - # expand = c(0.01, 0.1) - # ) - # } else { - # g <- g + ggplot2::scale_y_continuous(expand = c(0.01, 0.1)) - # } - - # # Because a text legend should always be horizontal, especially for an horizontal bar graph - if (flip){ + if (flip) { g <- g + ggplot2::coord_flip() } + # Remove guides for legend if !add_color_guide + if (!add_color_guide) { + g <- g + ggplot2::guides(fill = "none", color = "none") + } + # Add theme - g <- g + theme + if (!is.null(theme_fun)) { + g <- g + theme_fun + } + + # Add scale fun + if (!is.null(scale_fill_fun)) { + g <- g + scale_fill_fun + } + + if (!is.null(scale_color_fun)) { + g <- g + scale_color_fun + } return(g) } diff --git a/R/reorder_by.R b/R/reorder_by.R new file mode 100644 index 0000000..f918cc7 --- /dev/null +++ b/R/reorder_by.R @@ -0,0 +1,108 @@ +#' Reorder a Data Frame +#' +#' @param df A data frame to be reordered. +#' @param x A character scalar specifying the column to be reordered. +#' @param y A character scalar specifying the column to order by if ordering by values. +#' @param group A character scalar specifying the grouping column (optional). +#' @param order A character scalar specifying the order type (one of "none", "y", "grouped"). See details. +#' @param dir_order A logical scalar specifying whether to flip the order. +#' +#' @details Ordering takes the following possible values: +#' +#' * "none": No reordering. +#' * "y": Order by values of y. +#' * "grouped_y": Order by values of y and group. +#' * "x": Order alphabetically by x. +#' * "grouped_x": Order alphabetically by x and group. +#' +#' +#' @return The reordered data frame. +#' +#' @examples +#' # Example usage +#' df <- data.frame(col1 = c("b", "a", "c"), col2 = c(10, 25, 3)) +#' reorder_by(df, "col1", "col2") +#' +#' @export +reorder_by <- function(df, x, y, group = "", order = "y", dir_order = 1) { + #------ Checks + + # df is a data frame + checkmate::assert_data_frame(df) + + # x and y are character scalar and in df + checkmate::assert_character(x, len = 1) + checkmate::assert_character(y, len = 1) + checkmate::assert_subset(x, colnames(df)) + checkmate::assert_subset(y, colnames(df)) + + # group is character scalar and in df if not empty + checkmate::assert_character(group, len = 1) + if (group != "") { + checkmate::assert_subset(group, colnames(df)) + } + + # order is a character scalar in c("none", "y", "grouped") + checkmate::assert_choice(order, c("none", "y", "grouped_y", "x", "grouped_x")) + + # dir_order is 1 or -1 (numeric scalar) + checkmate::assert_subset(dir_order, c(1, -1)) + + # Convert dir_order to decreasing logical flag + dir_order_lgl <- (dir_order == -1) + + #------ Reorder + + # droplevels first + if (is.factor(df[[x]])) { + df[[x]] <- droplevels(df[[x]]) + } + + # reording options + if (order == "y") { + # Order by values of y + df <- df[order(df[[y]], decreasing = dir_order_lgl), ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } else if (order == "grouped_y" && group != "") { + # Order by group first, then by values of y + df <- df[ + order( + df[[group]], + df[[y]], + decreasing = c(FALSE, dir_order_lgl), + method = "radix" + ), + ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } else if (order == "grouped_y" && group == "") { + # Fallback to ordering by y if group is empty + rlang::warn("Group is empty. Ordering by y only.") + df <- df[order(df[[y]], decreasing = dir_order_lgl), ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } else if (order == "x") { + # Order alphabetically by x + df <- df[order(df[[x]], decreasing = dir_order_lgl), ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } else if (order == "grouped_x" && group != "") { + # Order by group first, then alphabetically by x + df <- df[ + order( + df[[group]], + df[[x]], + decreasing = c(FALSE, dir_order_lgl), + method = "radix" + ), + ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } else if (order == "grouped_x" && group == "") { + # Fallback to ordering by x if group is empty + rlang::warn("Group is empty. Ordering by x only.") + df <- df[order(df[[x]], decreasing = dir_order_lgl), ] + df[[x]] <- forcats::fct_inorder(df[[x]]) + } + + # Reset row names + rownames(df) <- NULL + + return(df) +} diff --git a/R/scale.R b/R/scale.R index b1a8ccd..0d6382c 100644 --- a/R/scale.R +++ b/R/scale.R @@ -1,119 +1,41 @@ -#' Color scale constructor for REACH or AGORA colors +#' Scale constructors for fill and colors +#' +#' This function is based on [palette()]. If palette is NULL, the used palette will be magma from gpplot2's viridis scale constructors. +#' +#' @inheritParams palette_gen #' -#' @param initiative Either "reach" or "agora" or "default". -#' @param palette Palette name from `pal_reach()` or `pal_agora()`. -#' @param discrete Boolean indicating whether color aesthetic is discrete or not. -#' @param reverse Boolean indicating whether the palette should be reversed. #' @param reverse_guide Boolean indicating whether the guide should be reversed. -#' @param ... Additional arguments passed to discrete_scale() or -#' scale_fill_gradient(), used respectively when discrete is TRUE or FALSE. -#' -#' @return A color scale for ggplot +#' @param ... Additional arguments passed to [ggplot2::discrete_scale()] if discrete or [ggplot2::scale_fill_gradient()] if continuous. #' #' @export -scale_color <- function(initiative = "reach", palette = "main", discrete = TRUE, reverse = FALSE, reverse_guide = TRUE, ...) { - - if (initiative == "reach") { - - pal <- pal_reach(palette) - - if (is.null(pal)) { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - rlang::warn( - c( - paste0("There is no palette '", palette, "' for the selected initiative. Fallback to pal_fallback()."), - "i" = paste0("Use `pal_reach(show_palettes = TRUE)` to see the list of available palettes.") - ) - ) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - - pal <- pal_reach( - palette = palette, - reverse = reverse, - color_ramp_palette = TRUE, - show_palettes = FALSE - ) - - } - - } else if (initiative == "agora") { - - pal <- pal_agora(palette) - - if (is.null(pal)) { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - rlang::warn( - c( - paste0("There is no palette '", palette, "' for the selected initiative. Fallback to pal_fallback()."), - "i" = paste0("Use `pal_reach(show_palettes = TRUE)` to see the list of available palettes.") - ) - ) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - - pal <- pal_agora( - palette = palette, - reverse = reverse, - color_ramp_palette = TRUE, - show_palettes = FALSE - ) - } - - } else if (initiative == "default") { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - rlang::abort( - c( - paste0("There is no initiative '", initiative, "."), - "i" = paste0("initiative should be either 'reach', 'agora' or 'default'") - ) - ) - } - - if (discrete) { +scale_color_visualizer_discrete <- function( + palette = "cat_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) { + if (!(is.null(palette))) { ggplot2::discrete_scale( - "colour", - paste0(initiative, "_", palette), - palette = pal, + "color", + palette = palette_gen(palette, "categorical", direction), guide = ggplot2::guide_legend( - title.position = "top", + title.position = title_position, draw.ulim = TRUE, draw.llim = TRUE, - ticks.colour = "#F1F3F5", + # ticks.colour = "#F1F3F5", reverse = reverse_guide ), ... ) } else { - ggplot2::scale_color_gradientn( - colours = pal(256), - guide = ggplot2::guide_colorbar( - title.position = "top", + ggplot2::scale_colour_viridis_d( + direction = direction, + guide = ggplot2::guide_legend( + title.position = title_position, draw.ulim = TRUE, draw.llim = TRUE, - ticks.colour = "#F1F3F5", + # ticks.colour = "#F1F3F5", reverse = reverse_guide ), ... @@ -121,128 +43,118 @@ scale_color <- function(initiative = "reach", palette = "main", discrete = TRUE, } } - - -#' Fill scale constructor for REACH or AGORA colors -#' -#' @param initiative Either "reach" or "agora" or "default". -#' @param palette Palette name from `pal_reach()` or `pal_agora()`. -#' @param discrete Boolean indicating whether color aesthetic is discrete or not. -#' @param reverse Boolean indicating whether the palette should be reversed. -#' @param reverse_guide Boolean indicating whether the guide should be reversed. -#' @param ... Additional arguments passed to discrete_scale() or -#' scale_fill_gradient(), used respectively when discrete is TRUE or FALSE. -#' -#' @return A fill scale for ggplot. +#' @rdname scale_color_visualizer_discrete #' #' @export -scale_fill <- function(initiative = "reach", palette = "main", discrete = TRUE, reverse = FALSE, reverse_guide = TRUE, ...) { - - - if (initiative == "reach") { - - pal <- pal_reach(palette) - - if (is.null(pal)) { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - rlang::warn( - c( - paste0("There is no palette '", palette, "' for the selected initiative. Fallback to pal_fallback()."), - "i" = paste0("Use `pal_reach(show_palettes = TRUE)` to see the list of available palettes.") - ) - ) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - - pal <- pal_reach( - palette = palette, - reverse = reverse, - color_ramp_palette = TRUE, - show_palettes = FALSE - ) - - } - - } else if (initiative == "agora") { - - pal <- pal_agora(palette) - - if (is.null(pal)) { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - rlang::warn( - c( - paste0("There is no palette '", palette, "' for the selected initiative. Fallback to pal_fallback()."), - "i" = paste0("Use `pal_reach(show_palettes = TRUE)` to see the list of available palettes.") - ) - ) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - - pal <- pal_agora( - palette = palette, - reverse = reverse, - color_ramp_palette = TRUE, - show_palettes = FALSE - ) - } - - } else if (initiative == "default") { - - pal <- pal_fallback( - reverse = reverse, - discrete = discrete, - color_ramp_palette = TRUE) - - if (discrete) palette <- "viridis" else palette <- "magma" - - } else { - rlang::abort( - c( - paste0("There is no initiative '", initiative, "."), - "i" = paste0("initiative should be either 'reach', 'agora' or 'default'") - ) - ) - } - - if (discrete) { +scale_fill_visualizer_discrete <- function( + palette = "cat_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) { + if (!(is.null(palette))) { ggplot2::discrete_scale( "fill", - paste0(initiative, "_", palette), - palette = pal, + palette = palette_gen(palette, "categorical", direction), guide = ggplot2::guide_legend( - title.position = "top", + title.position = title_position, draw.ulim = TRUE, draw.llim = TRUE, - ticks.colour = "#F1F3F5", + # ticks.colour = "#F1F3F5", reverse = reverse_guide ), ... ) } else { - ggplot2::scale_color_gradientn( - colours = pal(256), - guide = ggplot2::guide_colorbar( - title.position = "top", + ggplot2::scale_fill_viridis_d( + direction = direction, + guide = ggplot2::guide_legend( + title.position = title_position, draw.ulim = TRUE, draw.llim = TRUE, - ticks.colour = "#F1F3F5", + # ticks.colour = "#F1F3F5", reverse = reverse_guide ), ... ) } } + +#' @rdname scale_color_visualizer_discrete +#' +#' @export +scale_fill_visualizer_continuous <- function( + palette = "seq_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) { + if (!(is.null(palette))) { + pal <- palette_gen(palette, "continuous", direction) + + ggplot2::scale_fill_gradientn( + colors = pal(256), + guide = ggplot2::guide_colorbar( + title.position = title_position, + draw.ulim = TRUE, + draw.llim = TRUE, + # ticks.colour = "#F1F3F5", + reverse = reverse_guide + ), + ... + ) + } else { + ggplot2::scale_fill_viridis_c( + option = "magma", + guide = ggplot2::guide_colorbar( + title.position = title_position, + draw.ulim = TRUE, + draw.llim = TRUE, + # ticks.colour = "#F1F3F5", + reverse = reverse_guide + ), + ... + ) + } +} + +#' @rdname scale_color_visualizer_discrete +#' +#' @export +scale_color_visualizer_continuous <- function( + palette = "seq_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) { + if (!(is.null(palette))) { + pal <- palette_gen(palette, "continuous", direction) + + ggplot2::scale_fill_gradientn( + colors = pal(256), + guide = ggplot2::guide_colorbar( + title.position = title_position, + draw.ulim = TRUE, + draw.llim = TRUE, + # ticks.colour = "#F1F3F5", + reverse = reverse_guide + ), + ... + ) + } else { + ggplot2::scale_colour_viridis_c( + option = "magma", + guide = ggplot2::guide_colorbar( + title.position = title_position, + draw.ulim = TRUE, + draw.llim = TRUE, + # ticks.colour = "#F1F3F5", + reverse = reverse_guide + ), + .... + ) + } +} diff --git a/R/theme_bar.R b/R/theme_bar.R new file mode 100644 index 0000000..1494c68 --- /dev/null +++ b/R/theme_bar.R @@ -0,0 +1,95 @@ +#' Custom Theme for Bar Charts +#' +#' @return A custom theme object. +#' +#' @rdname theme_default +#' +#' @export +theme_bar <- function( + flip = TRUE, + add_text = FALSE, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5 +) { + # If add_text is TRUE, flip is FALSE + if (!flip && !add_text) { + par_axis_text_font_face <- "plain" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- FALSE + par_axis_ticks_y <- TRUE + par_axis_text_y <- TRUE + par_axis_line_x <- TRUE + par_axis_ticks_x <- TRUE + par_axis_text_x <- TRUE + par_grid_major_y <- TRUE + par_grid_major_x <- FALSE + par_grid_minor_y <- TRUE + par_grid_minor_x <- FALSE + } else if (flip && !add_text) { + par_axis_text_font_face <- "plain" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- TRUE + par_axis_ticks_y <- TRUE + par_axis_text_y <- TRUE + par_axis_line_x <- FALSE + par_axis_ticks_x <- TRUE + par_axis_text_x <- TRUE + par_grid_major_y <- FALSE + par_grid_major_x <- TRUE + par_grid_minor_y <- FALSE + par_grid_minor_x <- TRUE + } else if (!flip && add_text) { + par_axis_text_font_face <- "bold" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- FALSE + par_axis_ticks_y <- FALSE + par_axis_text_y <- FALSE + par_axis_line_x <- FALSE + par_axis_ticks_x <- TRUE + par_axis_text_x <- TRUE + par_grid_major_y <- FALSE + par_grid_major_x <- FALSE + par_grid_minor_y <- FALSE + par_grid_minor_x <- FALSE + } else if (flip && add_text) { + par_axis_text_font_face <- "bold" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- FALSE + par_axis_ticks_y <- TRUE + par_axis_text_y <- TRUE + par_axis_line_x <- FALSE + par_axis_ticks_x <- FALSE + par_axis_text_x <- FALSE + par_grid_major_y <- FALSE + par_grid_major_x <- FALSE + par_grid_minor_y <- FALSE + par_grid_minor_x <- FALSE + } + + # Theme + t <- theme_default( + axis_text_font_face = par_axis_text_font_face, + axis_x = par_axis_x, + axis_y = par_axis_y, + grid_major_y = par_grid_major_y, + grid_major_x = par_grid_major_x, + grid_minor_y = par_grid_minor_y, + grid_minor_x = par_grid_minor_x, + axis_text_y = par_axis_text_y, + axis_line_y = par_axis_line_y, + axis_ticks_y = par_axis_ticks_y, + axis_text_x = par_axis_text_x, + axis_line_x = par_axis_line_x, + axis_ticks_x = par_axis_ticks_x, + axis_text_x_angle = axis_text_x_angle, + axis_text_x_vjust = axis_text_x_vjust, + axis_text_x_hjust = axis_text_x_hjust + ) + + return(t) +} diff --git a/R/theme_default.R b/R/theme_default.R new file mode 100644 index 0000000..e8f9853 --- /dev/null +++ b/R/theme_default.R @@ -0,0 +1,385 @@ +#' ggplot2 theme wrapper with fonts and colors +#' +#' @param font_family The font family for all plot's texts. Default to "Segoe UI". +#' @param title_size The size of the title. Defaults to 12. +#' @param title_color Title color. +#' @param title_font_face Title font face. Default to "bold". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param title_hjust Title horizontal justification. Default to NULL. Use 0.5 to center the title. +#' @param title_font_family Title font family. Default to "Roboto Condensed". +#' @param text_size The size of all text other than the title, subtitle and caption. Defaults to 10. +#' @param text_color Text color. +#' @param text_font_face Text font face. Default to "bold". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param panel_background_color The color for the panel background color. Default to white. +#' @param panel_border Boolean. Plot a panel border? Default to FALSE. +#' @param panel_border_color A color. Default to REACH main grey. +#' @param legend_position Position of the legend; Default to "right". Can take "right", "left", "top", "bottom" or "none". +#' @param legend_direction Direction of the legend. Default to "vertical". Can take "vertical" or "horizontal". +#' @param legend_justification In addition to legend_direction, place the legend. Can take "left", "bottom", "center", "right", "top". +#' @param legend_title_size Legend title size. +#' @param legend_title_color Legend title color. +#' @param legend_title_font_face Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param legend_text_size Legend text size. +#' @param legend_text_color Legend text color. +#' @param legend_text_font_face Legend text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param legend_reverse Reverse the color in the guide? Default to TRUE. +#' @param title_size The size of the legend title. Defaults to 11. +#' @param title_color Legend title color. +#' @param title_font_face Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param title_position_to_plot TRUE or FALSE. Positioning to plot or to panel? +#' @param axis_x Boolean. Do you need x-axis? +#' @param axis_y Boolean. Do you need y-axis? +#' @param axis_text_size Axis text size. +#' @param axis_text_color Axis text color. +#' @param axis_text_font_face Axis text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param axis_text_x Boolean. Do you need the text for the x-axis? +#' @param axis_line_x Boolean. Do you need the line for the x-axis? +#' @param axis_ticks_x Boolean. Do you need the line for the x-axis? +#' @param axis_text_x_angle Angle for the x-axis text. +#' @param axis_text_x_vjust Vertical adjustment for the x-axis text. +#' @param axis_text_x_hjust Vertical adjustment for the x-axis text. +#' @param axis_text_y Boolean. Do you need the text for the y-axis? +#' @param axis_line_y Boolean. Do you need the line for the y-axis? +#' @param axis_ticks_y Boolean. Do you need the line for the y-axis? +#' @param axis_title_size Axis title size. +#' @param axis_title_color Axis title color. +#' @param axis_title_font_face Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). +#' @param grid_major_x Boolean. Do you need major grid lines for x-axis? +#' @param grid_major_y Boolean. Do you need major grid lines for y-axis? +#' @param grid_major_x_size Major X line size. +#' @param grid_major_y_size Major Y line size. +#' @param grid_major_color Major grid lines color. +#' @param grid_minor_x Boolean. Do you need minor grid lines for x-axis? +#' @param grid_minor_y Boolean. Do you need minor grid lines for y-axis? +#' @param grid_minor_x_size Minor X line size. +#' @param grid_minor_y_size Minor Y line size. +#' @param grid_minor_color Minor grid lines color. +#' @param caption_position_to_plot TRUE or FALSE. Positioning to plot or to panel? +#' @param ... Additional arguments passed to [ggplot2::theme()]. +#' +#' +#' @description Give some reach colors and fonts to a ggplot. +#' +#' @export +theme_default <- function( + title_font_family = "Carlito", + title_size = 20, + title_color = color("dark_grey"), + title_font_face = "bold", + title_hjust = NULL, + title_position_to_plot = TRUE, + subtitle_font_family = "Carlito", + subtitle_size = 16, + subtitle_color = color("dark_grey"), + subtitle_font_face = "plain", + subtitle_hjust = NULL, + text_font_family = "Carlito", + text_size = 14, + text_color = color("dark_grey"), + text_font_face = "plain", + panel_background_color = "#FFFFFF", + panel_border = FALSE, + panel_border_color = color("dark_grey"), + legend_position = "top", + legend_direction = "horizontal", + legend_justification = "center", + legend_reverse = TRUE, + legend_title_size = 14, + legend_title_color = color("dark_grey"), + legend_title_font_face = "plain", + legend_title_font_family = "Carlito", + legend_text_size = 14, + legend_text_color = color("dark_grey"), + legend_text_font_face = "plain", + legend_text_font_family = "Carlito", + facet_size = 15, + facet_color = color("dark_grey"), + facet_font_face = "bold", + facet_font_family = "Carlito", + facet_bg_color = color("lighter_grey"), + axis_x = TRUE, + axis_y = TRUE, + axis_text_x = TRUE, + axis_line_x = FALSE, + axis_ticks_x = FALSE, + axis_text_y = TRUE, + axis_line_y = TRUE, + axis_ticks_y = TRUE, + axis_text_font_family = "Carlito", + axis_text_size = 14, + axis_text_color = color("dark_grey"), + axis_text_font_face = "plain", + axis_title_size = 15, + axis_title_color = color("dark_grey"), + axis_title_font_face = "plain", + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5, + grid_major_x = TRUE, + grid_major_y = FALSE, + grid_major_color = color("dark_grey"), + grid_major_x_size = 0.1, + grid_major_y_size = 0.1, + grid_minor_x = TRUE, + grid_minor_y = FALSE, + grid_minor_color = color("dark_grey"), + grid_minor_x_size = 0.05, + grid_minor_y_size = 0.05, + caption_font_family = "Carlito", + caption_font_face = "plain", + caption_position_to_plot = TRUE, + caption_size = 12, + caption_color = color("dark_grey"), + ... +) { + # Basic simple theme + theme <- ggplot2::theme_minimal() + + theme <- theme + + ggplot2::theme( + # # Text - design + text = ggplot2::element_text( + family = text_font_family, + color = text_color, + size = text_size, + face = text_font_face + ), + # Default legend to right position + legend.position = legend_position, + # Defaut legend to vertical direction + legend.direction = legend_direction, + # Text sizes + axis.text = ggplot2::element_text( + size = axis_text_size, + family = axis_text_font_family, + face = axis_text_font_face, + color = axis_text_color + ), + axis.title = ggplot2::element_text( + size = axis_title_size, + family = axis_text_font_family, + face = axis_title_font_face, + color = axis_title_color + ), + # # Wrap title + plot.title = ggtext::element_textbox_simple( + hjust = title_hjust, + family = title_font_family, + color = title_color, + size = title_size, + face = title_font_face, + width = grid::unit(0.9, "npc"), + margin = ggplot2::margin(b = 10) + ), + plot.subtitle = ggtext::element_textbox_simple( + hjust = title_hjust, + family = subtitle_font_family, + color = subtitle_color, + size = subtitle_size, + face = subtitle_font_face, + margin = ggplot2::margin(t = 5, b = 10) + ), + plot.caption = ggtext::element_textbox_simple( + size = caption_size, + face = caption_font_face, + family = caption_font_family, + color = caption_color, + margin = ggplot2::margin(t = 10) + ), + legend.title = ggplot2::element_text( + size = legend_title_size, + face = legend_title_font_face, + family = legend_title_font_family, + color = legend_title_color + ), + legend.text = ggplot2::element_text( + size = legend_text_size, + face = legend_text_font_face, + family = legend_text_font_family, + color = legend_text_color + ), + axis.text.x = ggplot2::element_text( + angle = axis_text_x_angle, + vjust = axis_text_x_vjust, + hjust = axis_text_x_hjust + ) + ) + + # Position of title + if (title_position_to_plot) { + theme <- theme + + ggplot2::theme( + plot.title.position = "plot" + ) + } + + if (caption_position_to_plot) { + theme <- theme + + ggplot2::theme( + plot.caption.position = "plot" + ) + } + # Position of caption + + # Axis lines ? + if (axis_x & axis_y) { + theme <- theme + + ggplot2::theme( + axis.line = ggplot2::element_line(color = text_color) + ) + } + + if (!axis_x) { + theme <- theme + + ggplot2::theme( + axis.line.x = ggplot2::element_blank(), + axis.ticks.x = ggplot2::element_blank(), + axis.text.x = ggplot2::element_blank() + ) + } + + if (!axis_y) { + theme <- theme + + ggplot2::theme( + axis.line.y = ggplot2::element_blank(), + axis.ticks.y = ggplot2::element_blank(), + axis.text.y = ggplot2::element_blank() + ) + } + + if (!axis_line_x) { + theme <- theme + + ggplot2::theme( + axis.line.x = ggplot2::element_blank() + ) + } + + if (!axis_ticks_x) { + theme <- theme + + ggplot2::theme( + axis.ticks.x = ggplot2::element_blank() + ) + } + + if (!axis_text_x) { + theme <- theme + + ggplot2::theme( + axis.text.x = ggplot2::element_blank() + ) + } + + if (!axis_line_y) { + theme <- theme + + ggplot2::theme( + axis.line.y = ggplot2::element_blank() + ) + } + + if (!axis_ticks_y) { + theme <- theme + + ggplot2::theme( + axis.ticks.y = ggplot2::element_blank() + ) + } + + if (!axis_text_y) { + theme <- theme + + ggplot2::theme( + axis.text.y = ggplot2::element_blank() + ) + } + + # X - major grid lines + if (!grid_major_x) { + theme <- theme + + ggplot2::theme( + panel.grid.major.x = ggplot2::element_blank() + ) + } else { + theme <- theme + + ggplot2::theme( + panel.grid.major.x = ggplot2::element_line( + color = grid_major_color, + linewidth = grid_major_x_size + ) + ) + } + + # Y - major grid lines + if (!grid_major_y) { + theme <- theme + + ggplot2::theme( + panel.grid.major.y = ggplot2::element_blank() + ) + } else { + theme <- theme + + ggplot2::theme( + panel.grid.major.y = ggplot2::element_line( + color = grid_major_color, + linewidth = grid_major_y_size + ) + ) + } + + # X - minor grid lines + if (!grid_minor_x) { + theme <- theme + + ggplot2::theme( + panel.grid.minor.x = ggplot2::element_blank() + ) + } else { + theme <- theme + + ggplot2::theme( + panel.grid.minor.x = ggplot2::element_line( + color = grid_minor_color, + linewidth = grid_minor_x_size + ) + ) + } + + # Y - minor grid lines + if (!grid_minor_y) { + theme <- theme + + ggplot2::theme( + panel.grid.minor.y = ggplot2::element_blank() + ) + } else { + theme <- theme + + ggplot2::theme( + panel.grid.minor.y = ggplot2::element_line( + color = grid_minor_color, + linewidth = grid_minor_y_size + ) + ) + } + if (!panel_border) { + theme <- theme + + ggplot2::theme( + panel.border = ggplot2::element_blank() + ) + } else { + theme <- theme + + ggplot2::theme( + panel.border = ggplot2::element_rect(color = panel_background_color) + ) + } + + # Add facet title text size + theme <- theme + + ggplot2::theme( + strip.text = ggplot2::element_text( + size = facet_size, + family = facet_font_family, + face = facet_font_face, + color = facet_color + ), + strip.background = ggplot2::element_rect( + fill = facet_bg_color, + linewidth = 0 + ) + ) + + # Other parameters + theme <- theme + ggplot2::theme(...) + + return(theme) +} diff --git a/R/theme_dumbbell.R b/R/theme_dumbbell.R new file mode 100644 index 0000000..21a0eae --- /dev/null +++ b/R/theme_dumbbell.R @@ -0,0 +1,13 @@ +#' @title Dumbbell Theme + +#' @description Theme for dumbbell charts based on theme_default. +#' +#' @rdname theme_default +#' +#' @export +theme_dumbbell <- function() { + theme_default( + axis_line_x = TRUE, + grid_ + ) +} diff --git a/R/theme_lollipop.R b/R/theme_lollipop.R new file mode 100644 index 0000000..9d4ee94 --- /dev/null +++ b/R/theme_lollipop.R @@ -0,0 +1,65 @@ +#' Custom Theme for Lollipop Charts +#' +#' @return A custom theme object. +#' +#' @rdname theme_default +#' +#' @export +theme_lollipop <- function( + flip = TRUE, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5) { + # Set parameters based on flip + if (!flip) { + par_axis_text_font_face <- "plain" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- FALSE + par_axis_ticks_y <- TRUE + par_axis_text_y <- TRUE + par_axis_line_x <- TRUE + par_axis_ticks_x <- TRUE + par_axis_text_x <- TRUE + par_grid_major_y <- TRUE + par_grid_major_x <- FALSE + par_grid_minor_y <- TRUE + par_grid_minor_x <- FALSE + } else if (flip) { + par_axis_text_font_face <- "plain" + par_axis_x <- TRUE + par_axis_y <- TRUE + par_axis_line_y <- TRUE + par_axis_ticks_y <- TRUE + par_axis_text_y <- TRUE + par_axis_line_x <- FALSE + par_axis_ticks_x <- TRUE + par_axis_text_x <- TRUE + par_grid_major_y <- FALSE + par_grid_major_x <- TRUE + par_grid_minor_y <- FALSE + par_grid_minor_x <- TRUE + } + + # Theme + t <- theme_default( + axis_text_font_face = par_axis_text_font_face, + axis_x = par_axis_x, + axis_y = par_axis_y, + grid_major_y = par_grid_major_y, + grid_major_x = par_grid_major_x, + grid_minor_y = par_grid_minor_y, + grid_minor_x = par_grid_minor_x, + axis_text_y = par_axis_text_y, + axis_line_y = par_axis_line_y, + axis_ticks_y = par_axis_ticks_y, + axis_text_x = par_axis_text_x, + axis_line_x = par_axis_line_x, + axis_ticks_x = par_axis_ticks_x, + axis_text_x_angle = axis_text_x_angle, + axis_text_x_vjust = axis_text_x_vjust, + axis_text_x_hjust = axis_text_x_hjust + ) + + return(t) +} diff --git a/R/theme_point.R b/R/theme_point.R new file mode 100644 index 0000000..59c0840 --- /dev/null +++ b/R/theme_point.R @@ -0,0 +1,31 @@ +#' Custom Theme for Point Charts +#' +#' @param flip Logical. Whether the plot is flipped (horizontal). +#' @param axis_text_x_angle Angle for x-axis text. +#' @param axis_text_x_vjust Vertical justification for x-axis text. +#' @param axis_text_x_hjust Horizontal justification for x-axis text. +#' +#' @rdname theme_default +#' +#' @return A custom theme object. +#' +#' @export +theme_point <- function() { + t <- theme_default( + axis_text_font_face = "plain", + axis_x = TRUE, + axis_y = TRUE, + grid_major_y = TRUE, + grid_major_x = TRUE, + grid_minor_y = FALSE, + grid_minor_x = FALSE, + axis_text_x = TRUE, + axis_line_x = TRUE, + axis_ticks_x = TRUE, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0 + ) + + return(t) +} diff --git a/R/theme_reach.R b/R/theme_reach.R deleted file mode 100644 index ac4a3be..0000000 --- a/R/theme_reach.R +++ /dev/null @@ -1,290 +0,0 @@ -#' @title ggplot2 theme with REACH color palettes -#' -#' @param initiative Either "reach" or "default". -#' @param palette Palette name from 'pal_reach()'. -#' @param discrete Boolean indicating whether color aesthetic is discrete or not. -#' @param reverse Boolean indicating whether the palette should be reversed. -#' @param font_family The font family for all plot's texts. Default to "Segoe UI". -#' @param title_size The size of the title. Defaults to 12. -#' @param title_color Title color. -#' @param title_font_face Title font face. Default to "bold". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param title_hjust Title horizontal justification. Default to NULL. Use 0.5 to center the title. -#' @param text_size The size of all text other than the title, subtitle and caption. Defaults to 10. -#' @param text_color Text color. -#' @param text_font_face Text font face. Default to "bold". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param panel_background_color The color for the panel background color. Default to white. -#' @param panel_border Boolean. Plot a panel border? Default to FALSE. -#' @param panel_border_color A color. Default to REACH main grey. -#' @param legend_position Position of the legend; Default to "right". Can take "right", "left", "top", "bottom" or "none". -#' @param legend_direction Direction of the legend. Default to "vertical". Can take "vertical" or "horizontal". -#' @param legend_title_size Legend title size. -#' @param legend_title_color Legend title color. -#' @param legend_title_font_face Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param legend_text_size Legend text size. -#' @param legend_text_color Legend text color. -#' @param legend_text_font_face Legend text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param legend_reverse Reverse the color in the guide? Default to TRUE. -#' @param title_size The size of the legend title. Defaults to 11. -#' @param title_color Legend title color. -#' @param title_font_face Legend title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param title_position_to_plot TRUE or FALSE. Positioning to plot or to panel? -#' @param axis_x Boolean. Do you need x-axis? -#' @param axis_y Boolean. Do you need y-axis? -#' @param axis_text_size Axis text size. -#' @param axis_text_color Axis text color. -#' @param axis_text_font_face Axis text font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param axis_text_x_angle Angle for the x-axis text. -#' @param axis_text_x_vjust Vertical adjustment for the x-axis text. -#' @param axis_text_x_hjust Vertical adjustment for the x-axis text. -#' @param axis_title_size Axis title size. -#' @param axis_title_color Axis title color. -#' @param axis_title_font_face Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic"). -#' @param grid_major_x Boolean. Do you need major grid lines for x-axis? -#' @param grid_major_y Boolean. Do you need major grid lines for y-axis? -#' @param grid_major_x_size Major X line size. -#' @param grid_major_y_size Major Y line size. -#' @param grid_major_color Major grid lines color. -#' @param grid_minor_x Boolean. Do you need minor grid lines for x-axis? -#' @param grid_minor_y Boolean. Do you need minor grid lines for y-axis? -#' @param grid_minor_x_size Minor X line size. -#' @param grid_minor_y_size Minor Y line size. -#' @param grid_minor_color Minor grid lines color. -#' @param caption_position_to_plot TRUE or FALSE. Positioning to plot or to panel? -#' @param ... Additional arguments passed to `ggplot2::gg_theme()`. -#' -#' -#' @description Give some reach colors and fonts to a ggplot. -#' -#' @return The base REACH theme -#' -#' @export -theme_reach <- function( - initiative = "reach", - palette = "main", - discrete = TRUE, - reverse = FALSE, - font_family = "Segoe UI", - title_size = 12, - title_color = cols_reach("main_grey"), - title_font_face = "bold", - title_hjust = NULL, - title_position_to_plot = TRUE, - text_size = 10, - text_color = cols_reach("main_grey"), - text_font_face = "plain", - panel_background_color = "#FFFFFF", - panel_border = FALSE, - panel_border_color = cols_reach("main_grey"), - legend_position = "right", - legend_direction = "vertical", - legend_reverse = TRUE, - legend_title_size = 11, - legend_title_color = cols_reach("main_grey"), - legend_title_font_face = "plain", - legend_text_size = 10, - legend_text_color = cols_reach("main_grey"), - legend_text_font_face = "plain", - axis_x = TRUE, - axis_y = TRUE, - axis_text_size = 10, - axis_text_color = cols_reach("main_grey"), - axis_text_font_face = "plain", - axis_title_size = 11, - axis_title_color = cols_reach("main_grey"), - axis_title_font_face = "bold", - axis_text_x_angle = 0, - axis_text_x_vjust = 0.5, - axis_text_x_hjust = 0.5, - grid_major_x = FALSE, - grid_major_y = FALSE, - grid_major_color = cols_reach("main_lt_grey"), - grid_major_x_size = 0.1, - grid_major_y_size = 0.1, - grid_minor_x = FALSE, - grid_minor_y = FALSE, - grid_minor_color = cols_reach("main_lt_grey"), - grid_minor_x_size = 0.05, - grid_minor_y_size = 0.05, - caption_position_to_plot = TRUE, - ... - ) { - - # To do : - # - add facet theming - - if (!initiative %in% c("reach", "default")) - rlang::abort( - c( - paste0("There is no initiative '", initiative, " to be used with theme_reach()."), - "i" = paste0("initiative should be either 'reach' or 'default'") - ) - ) - - # Basic simple theme - # theme_reach <- ggplot2::theme_bw() - - theme_reach <- ggplot2::theme( - # Title - design - title = ggplot2::element_text( - family = font_family, - color = title_color, - size = title_size, - face = title_font_face - ), - # Text - design - text = ggplot2::element_text( - family = font_family, - color = text_color, - size = text_size, - face = text_font_face - ), - # Default legend to right position - legend.position = legend_position, - # Defaut legend to vertical direction - legend.direction = legend_direction, - # set panel background color - panel.background = ggplot2::element_rect( - fill = panel_background_color - ), - # Remove background for legend key - legend.key = ggplot2::element_blank(), - # Text sizes - axis.text = ggplot2::element_text( - size = axis_text_size, - family = font_family, - face = axis_text_font_face, - color = axis_text_color - ), - axis.title = ggplot2::element_text( - size = axis_title_size, - family = font_family, - face = axis_title_font_face, - color = axis_title_color), - # Wrap title - plot.title = ggtext::element_textbox( - hjust = title_hjust - ), - plot.subtitle = ggtext::element_textbox( - hjust = title_hjust - ), - plot.caption = ggtext::element_textbox(), - legend.title = ggplot2::element_text( - size = legend_title_size, - face = legend_title_font_face, - family = font_family, - color = legend_title_color), - legend.text = ggplot2::element_text( - size = legend_text_size, - face = legend_text_font_face, - family = font_family, - color = legend_text_color - ), - axis.text.x = ggplot2::element_text( - angle = axis_text_x_angle, - vjust = axis_text_x_vjust, - hjust = axis_text_x_hjust - ) - ) - - # Position of title - if (title_position_to_plot) theme_reach <- theme_reach + - ggplot2::theme( - plot.title.position = "plot" - ) - - if (caption_position_to_plot) theme_reach <- theme_reach + - ggplot2::theme( - plot.caption.position = "plot" - ) - # Position of caption - - # Axis lines ? - if (axis_x & axis_y) { - theme_reach <- theme_reach + - ggplot2::theme( - axis.line = ggplot2::element_line(color = text_color)) - } - - if (!axis_x) { - theme_reach <- theme_reach + - ggplot2::theme( - axis.line.x = ggplot2::element_blank(), - axis.ticks.x = ggplot2::element_blank(), - axis.text.x = ggplot2::element_blank()) - } - - if (!axis_y) { - theme_reach <- theme_reach + - ggplot2::theme( - axis.line.y = ggplot2::element_blank(), - axis.ticks.y = ggplot2::element_blank(), - axis.text.y = ggplot2::element_blank()) - } - - # X - major grid lines - if (!grid_major_x) theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.major.x = ggplot2::element_blank() - ) else theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.major.x = ggplot2::element_line( - color = grid_major_color, - linewidth = grid_major_x_size) - ) - - # Y - major grid lines - if (!grid_major_y) theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.major.y = ggplot2::element_blank() - ) else theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.major.y = ggplot2::element_line( - color = grid_major_color, - linewidth = grid_major_y_size) - ) - - # X - minor grid lines - if (!grid_minor_x) theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.minor.x = ggplot2::element_blank() - ) else theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.minor.x = ggplot2::element_line( - color = grid_minor_color, - linewidth = grid_minor_x_size) - ) - - # Y - minor grid lines - if (!grid_minor_y) theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.minor.y = ggplot2::element_blank() - ) else theme_reach <- theme_reach + - ggplot2::theme( - panel.grid.minor.y = ggplot2::element_line( - color = grid_minor_color, - linewidth = grid_minor_y_size) - ) - if (!panel_border) theme_reach <- theme_reach + - ggplot2::theme( - panel.border = ggplot2::element_blank() - ) else theme_reach <- theme_reach + - ggplot2::theme( - panel.border = ggplot2::element_rect(color = panel_background_color) - ) - - - # Other parameters - theme_reach <- theme_reach + ggplot2::theme(...) - - # Add reach color palettes by default - # (reversed guide is defaulted to TRUE for natural reading) - theme_reach <- list( - theme_reach, - scale_color(initiative = initiative, palette = palette, discrete = discrete, reverse = reverse, reverse_guide = legend_reverse), - scale_fill(initiative = initiative, palette = palette, discrete = discrete, reverse = reverse, reverse_guide = legend_reverse) - ) - - - return(theme_reach) - -} diff --git a/R/visualizeR-package.R b/R/visualizeR-package.R index 62800aa..a65cf64 100644 --- a/R/visualizeR-package.R +++ b/R/visualizeR-package.R @@ -2,6 +2,5 @@ "_PACKAGE" ## usethis namespace: start -#' @importFrom rlang := ## usethis namespace: end NULL diff --git a/R/waffle.R b/R/waffle.R deleted file mode 100644 index 7df06d9..0000000 --- a/R/waffle.R +++ /dev/null @@ -1,74 +0,0 @@ -#' @title Simple waffle chart -#' -#' @param df A data frame. -#' @param x A character column or coercible as a character column. Will give the waffle's fill color. -#' @param y A numeric column (if plotting proportion, make sure to have percentages between 0 and 100 and not 0 and 1). -#' @param n_rows Number of rows. Default to 10. -#' @param size Width of the separator between blocks (defaults to 2). -#' @param x_title The x scale title. Default to NULL. -#' @param x_lab The x scale caption. Default to NULL. -#' @param title Plot title. Default to NULL. -#' @param subtitle Plot subtitle. Default to NULL. -#' @param caption Plot caption. Default to NULL. -#' @param arrange TRUE or FALSE. Arrange by highest percentage first. -#' @param theme Whatever theme. Default to theme_reach(). -#' -#' @return A waffle chart -#' -#' @export -waffle <- function(df, - x, - y, - n_rows = 10, - size = 2, - x_title = NULL, - x_lab = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - arrange = TRUE, - theme = theme_reach( - axis_x = FALSE, - axis_y = FALSE, - legend_position = "bottom", - legend_direction = "horizontal", - title_hjust = 0.5)){ - - # A basic and not robust check - # - add check between 0 and 1 - - # Arrange by biggest prop first ? - if (arrange) df <- dplyr::arrange( - df, - dplyr::desc({{ y }}) - ) - - # Mutate to 100 - # df <- dplyr::mutate(df, "{{y}}" := {{ y }} * 100) - - # Prepare named vector - values <- stats::setNames(dplyr::pull(df, {{ y }}), dplyr::pull(df, {{ x }})) - - # Make plot - g <- waffle::waffle(values, xlab = x_lab, rows = n_rows, size = size) - - # Add title, subtitle, caption, x_title, y_title - g <- g + ggplot2::labs( - title = title, - subtitle = subtitle, - caption = caption, - fill = x_title, - color = x_title - ) - - # Basic theme - # g <- g + - # hrbrthemes::theme_ipsum() #+ - # waffle::theme_enhance_waffle() - - # Add theme - g <- g + theme - - return(g) - -} diff --git a/README.Rmd b/README.Rmd index df843f4..53a26d5 100644 --- a/README.Rmd +++ b/README.Rmd @@ -12,24 +12,23 @@ knitr::opts_chunk$set( out.width = "100%", warning = FALSE, message = FALSE, - dpi = 300, + dpi = 300, dev.args = list(type = "cairo") ) -desc = read.dcf('DESCRIPTION') -desc = setNames(as.list(desc), colnames(desc)) +desc <- read.dcf("DESCRIPTION") +desc <- setNames(as.list(desc), colnames(desc)) ``` -# `r desc$Package` +# `r desc$Package` > `r desc$Title` -`visualizeR` proposes some utils to get REACH and AGORA colors, ready-to-go color palettes, and a few visualization functions (horizontal hist graph for instance). +`visualizeR` proposes some utils to sane colors, ready-to-go color palettes, and a few visualization functions. ## Installation -You can install the last version of visualizeR from -[GitHub](https://github.com/) with: +You can install the last version of visualizeR from [GitHub](https://github.com/) with: ```{r, eval = FALSE} # install.packages("devtools") @@ -40,85 +39,89 @@ devtools::install_github("gnoblet/visualizeR", build_vignettes = TRUE) Roadmap is as follows: -- [X] Add IMPACT's colors -- [X] Add all color palettes from the internal documentation -- [ ] There remains to be added more-than-7-color palettes and black color palettes -- [X] Add new types of visualization (e.g. dumbbell plot, lollipop plot, etc.) -- [X] Use examples -- [ ] Add some ease-map functions -- [ ] Add some interactive functions (maps and graphs) -- [ ] Consolidate and make errors transparent +- [ ] Full revamp of core functions (colors, pattern, incl. adding test and pre-commit structures) +- [ ] Add other types of plots: + - [ ] Dumbell + - [ ] Waffle + - [ ] Donut + - [ ] Alluvial ## Request -Please, do not hesitate to pull request any new viz or colors or color palettes, or to email request any change (guillaume.noblet@reach-initiative.org or gnoblet@zaclys.net). +Please, do not hesitate to pull request any new viz or colors or color palettes, or to email request any change ([gnoblet\@zaclys.net](mailto:gnoblet@zaclys.net){.email}). -## Colors +## Colors -Color palettes for REACH, AGORA and IMPACT are available. Functions to access colors and palettes are `cols_initiative()` or `pal_initiative()`. For now, the initiative with the most colors and color palettes is REACH. Feel free to pull requests new AGORA and IMPACT colors. +Functions to access colors and palettes are `color()` or `palette()`. Feel free to pull request new colors. ```{r example-colors, eval = TRUE} library(visualizeR) -# Get all saved REACH colors, named -cols_reach(unnamed = F)[1:10] +# Get all saved colors, named +color(unname = F)[1:10] # Extract a color palette as hexadecimal codes and reversed -pal_reach(palette = "main", reversed = TRUE, color_ramp_palette = FALSE) +palette(palette = "cat_5_main", reversed = TRUE, color_ramp_palette = FALSE) # Get all color palettes names -pal_reach(show_palettes = T) +palette(show_palettes = TRUE) ``` ## Charts -### Example 1: Bar chart, already REACH themed +### Example 1: Bar chart -```{r example-bar-chart, out.width = "65%", eval = TRUE} -library(visualizeR) +```{r example-bar-chart, out.width = '65%', eval = TRUE} library(palmerpenguins) library(dplyr) -df <- penguins |> - group_by(island, species) |> +df <- penguins |> + group_by(island, species) |> summarize( mean_bl = mean(bill_length_mm, na.rm = T), - mean_fl = mean(flipper_length_mm, na.rm = T)) |> + mean_fl = mean(flipper_length_mm, na.rm = T) + ) |> + ungroup() + +df_island <- penguins |> + group_by(island) |> + summarize( + mean_bl = mean(bill_length_mm, na.rm = T), + mean_fl = mean(flipper_length_mm, na.rm = T) + ) |> ungroup() # Simple bar chart by group with some alpha transparency -bar(df, island, mean_bl, species, percent = FALSE, alpha = 0.6, x_title = "Mean of bill length") +bar(df, "island", "mean_bl", "species", x_title = "Mean of bill length", title = "Mean of bill length by island and species") -# Using another color palette through `theme_reach()` and changing scale to percent -bar(df, island,mean_bl, species, percent = TRUE, theme = theme_reach(palette = "artichoke_3")) +# Flipped / Horizontal +hbar(df, "island", "mean_bl", "species", x_title = "Mean of bill length", title = "Mean of bill length by island and species") -# Not flipped, with text added, group_title, no y-axis and no bold for legend -bar(df, island, mean_bl, species, group_title = "Species", flip = FALSE, add_text = TRUE, add_text_suffix = "%", percent = FALSE, theme = theme_reach(text_font_face = "plain", axis_y = FALSE)) +# Facetted +bar(df, "island", "mean_bl", facet = "species", x_title = "Mean of bill length", title = "Mean of bill length by island and species", add_color_guide = FALSE) +# Flipped, with text, smaller width, and caption +hbar(df = df_island, x = "island", y = "mean_bl", title = "Mean of bill length by island", add_text = T, width = 0.6, add_text_suffix = "mm", add_text_expand_limit = 1.3, add_color_guide = FALSE, caption = "Data: palmerpenguins package.") ``` -### Example 2: Point chart, already REACH themed +### Example 2: Scatterplot -At this stage, `point_reach()` only supports categorical grouping colors with the `group` arg. +```{r example-point-chart, out.width = '65%', eval = TRUE} +# Simple scatterplot +point(penguins, "bill_length_mm", "flipper_length_mm") -```{r example-point-chart, out.width = "65%", eval = TRUE} +# Scatterplot with grouping colors, greater dot size, some transparency +point(penguins, "bill_length_mm", "flipper_length_mm", "island", group_title = "Island", alpha = 0.6, size = 3, title = "Bill vs. flipper length", , add_color_guide = FALSE) -# Simple point chart -point(penguins, bill_length_mm, flipper_length_mm) - -# Point chart with grouping colors, greater dot size, some transparency, reversed color palette -point(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.6, size = 3, theme = theme_reach(reverse = TRUE)) - -# Using another color palettes -point(penguins, bill_length_mm, flipper_length_mm, island, size = 1.5, x_title = "Bill", y_title = "Flipper", title = "Length (mm)", theme = theme_reach(palette = "artichoke_3", text_font_face = , grid_major_x = TRUE, title_position_to_plot = FALSE)) +# Facetted scatterplot by island +point(penguins, "bill_length_mm", "flipper_length_mm", "species", "island", "fixed", group_title = "Species", title = "Bill vs. flipper length by species and island", add_color_guide = FALSE) ``` - -### Example 3: Dumbbell plot, REACH themed +### Example 3: Dumbbell plot Remember to ensure that your data are in the long format and you only have two groups on the x-axis; for instance, IDP and returnee and no NA values. -```{r example-dumbbell-plot, out.width = "65%", eval = TRUE} +```{r example-dumbbell-plot, out.width = '65%', eval = TRUE} # Prepare long data df <- tibble::tibble( admin1 = rep(letters[1:8], 2), @@ -127,31 +130,23 @@ df <- tibble::tibble( ) |> dplyr::mutate(stat = round(stat, 0)) -# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title -dumbbell(df, - stat, - setting, - admin1, - title = "% of HHs that reported open defecation as sanitation facility", - group_y_title = "Admin 1", - group_x_title = "Setting", - theme = theme_reach(legend_position = "bottom", - legend_direction = "horizontal", - legend_title_font_face = "bold", - palette = "primary", - title_position_to_plot = FALSE, - legend.title.align = 0.5)) + - # Change legend title position (could be included as part of the function) - ggplot2::guides( - color = ggplot2::guide_legend(title.position = "left"), - fill = ggplot2::guide_legend(title.position = "left") - ) + + +# dumbbell( +# df, +# 'stat', +# 'setting', +# 'admin1', +# title = '% of HHs that reported open defecation as sanitation facility', +# group_y_title = 'Admin 1', +# group_x_title = 'Setting' +# ) ``` -### Example 4: donut chart, REACH themed (to used once, not twice) -```{r example-donut-plot, out.width = "65%", warning = FALSE} +### Example 4: donut chart +```{r example-donut-plot, out.width = '65%', warning = FALSE} # Some summarized data: % of HHs by displacement status df <- tibble::tibble( status = c("Displaced", "Non displaced", "Returnee", "Don't know/Prefer not to say"), @@ -159,136 +154,138 @@ df <- tibble::tibble( ) # Donut -donut(df, - status, - percentage, - hole_size = 3, - add_text_suffix = "%", - add_text_color = cols_reach("dk_grey"), - add_text_treshold_display = 5, - x_title = "Displacement status", - title = "% of HHs by displacement status", - theme = theme_reach(legend_reverse = TRUE)) +# donut(df, +# status, +# percentage, +# hole_size = 3, +# add_text_suffix = '%', +# add_text_color = color('dark_grey'), +# add_text_treshold_display = 5, +# x_title = 'Displacement status', +# title = '% of HHs by displacement status' +# ) ``` +### Example 5: Waffle chart -### Example 5: waffle chart -```{r example-waffle-plot, out.width = "65%", warning = FALSE} +```{r example-waffle-plot, out.width = '65%', warning = FALSE} # -waffle(df, status, percentage, x_title = "A caption", title = "A title", subtitle = "A subtitle") +# waffle(df, status, percentage, x_title = 'A caption', title = 'A title', subtitle = 'A subtitle') ``` +### Example 6: Alluvial chart -### Example 6: alluvial chart, REACH themed -```{r example-alluvial-plot, out.width = "65%", warning = FALSE} - +```{r example-alluvial-plot, out.width = '65%', warning = FALSE} # Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022 df <- tibble::tibble( - status_from = c(rep("Displaced", 4), - rep("Non displaced", 4), - rep("Returnee", 4), - rep("Dnk/Pnts", 4)), + status_from = c( + rep("Displaced", 4), + rep("Non displaced", 4), + rep("Returnee", 4), + rep("Dnk/Pnts", 4) + ), status_to = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), percentage = c(20, 8, 18, 1, 12, 21, 0, 2, 0, 3, 12, 1, 0, 0, 1, 1) ) # Alluvial, here the group is the status for 2021 -alluvial(df, - status_from, - status_to, - percentage, - status_from, - from_levels = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), - alpha = 0.8, - group_title = "Status for 2021", - title = "% of HHs by self-reported status from 2021 to 2022", - theme = theme_reach( - axis_y = FALSE, - legend_position = "none")) - +# alluvial(df, +# status_from, +# status_to, +# percentage, +# status_from, +# from_levels = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), +# alpha = 0.8, +# group_title = "Status for 2021", +# title = "% of HHs by self-reported status from 2021 to 2022" +# ) ``` -### Example 7: lollipop chart -```{r example-lollipop-chart, out.width = "65%", warning = FALSE} +### Example 7: Lollipop chart + +```{r example-lollipop-chart, out.width = "65%", warning = FALSE, eval = TRUE} library(tidyr) # Prepare long data df <- tibble::tibble( - admin1 = replicate(15, sample(letters, 8)) |> t() |> as.data.frame() |> unite("admin1", sep = "") |> dplyr::pull(admin1), - stat = rnorm(15, mean = 50, sd = 15)) |> + admin1 = replicate(15, sample(letters, 8)) |> t() |> as.data.frame() |> unite("admin1", sep = "") |> dplyr::pull(admin1), + stat = rnorm(15, mean = 50, sd = 15) +) |> dplyr::mutate(stat = round(stat, 0)) -# Make lollipop plot, REACH themed, vertical with 45 degrees angle X-labels -lollipop(df, - admin1, - stat, - arrange = FALSE, - add_text = FALSE, - flip = FALSE, - y_title = "% of HHs", - x_title = "Admin 1", - title = "% of HHs that reported having received a humanitarian assistance", - theme = theme_reach(axis_text_x_angle = 45, - grid_major_y = TRUE, - grid_major_y_size = 0.2, - grid_major_x = TRUE, - grid_minor_y = TRUE)) +# Simple vertical lollipop chart +lollipop( + df = df, + x = "admin1", + y = "stat", + flip = FALSE, + dot_size = 3, + y_title = "% of HHs", + x_title = "Admin 1", + title = "% of HHs that received humanitarian assistance" +) -# Horizontal, greater point size, arranged by value, no grid, and text labels added -lollipop(df, - admin1, - stat, - arrange = TRUE, - point_size = 10, - point_color = cols_reach("main_beige"), - segment_size = 2, - add_text = TRUE, - add_text_suffix = "%", - y_title = "% of HHs", - x_title = "Admin 1", - title = "% of HHs that reported having received a humanitarian assistance in the 12 months prior to the assessment", - theme = theme_reach(title_position_to_plot = FALSE)) +# Horizontal lollipop chart with custom colors +hlollipop( + df = df, + x = "admin1", + y = "stat", + dot_size = 4, + line_size = 1, + add_color = color("cat_5_main_2"), + line_color = color("cat_5_main_4"), + y_title = "% of HHs", + x_title = "Admin 1", + title = "% of HHs that received humanitarian assistance" +) +# Create data for grouped lollipop - using set.seed for reproducibility +set.seed(123) +df_grouped <- tibble::tibble( + admin1 = rep(c("A", "B", "C", "D", "E", "F"), 2), + group = rep(c("Group A", "Group B"), each = 6), + stat = c(rnorm(6, mean = 40, sd = 10), rnorm(6, mean = 60, sd = 10)) +) |> + dplyr::mutate(stat = round(stat, 0)) +# Grouped lollipop chart with proper side-by-side positioning +lollipop( + df = df_grouped, + x = "admin1", + y = "stat", + group = "group", + order = "grouped_y", + dodge_width = 0.8, # Control spacing between grouped lollipops + dot_size = 3.5, + line_size = 0.8, + y_title = "Value", + x_title = "Category", + title = "True side-by-side grouped lollipop chart" +) + +# Horizontal grouped lollipop chart +hlollipop( + df = df_grouped, + x = "admin1", + y = "stat", + group = "group", + dodge_width = 0.7, # Narrower spacing for horizontal orientation + dot_size = 3.5, + line_size = 0.8, + y_title = "Category", + x_title = "Value", + title = "Horizontal side-by-side grouped lollipop chart" +) ``` +## Lollipop Chart Features -## Maps +Lollipop charts offer several advantages: -```{r example-map, out.width = "50%"} +- Clean visualization of point data with connecting lines to a baseline +- True side-by-side grouped display for easy comparison between categories +- Each lollipop maintains its position from dot to baseline +- Customizable appearance with parameters for dot size, line width, and colors +- The `dodge_width` parameter controls spacing between grouped lollipops -# Add indicator layer -# - based on "pretty" classes and title "Proportion (%)" -# - buffer to add a 10% around the bounding box -map <- add_indicator_layer( - indicator_admin1, - opn_dfc, - buffer = 0.1) + - # Layout - some defaults - add the map title - add_layout("% of HH that reported open defecation as sanitation facility") + - # Admin boundaries as list of shape files (lines) and colors, line widths and labels as vectors - add_admin_boundaries( - lines = list(line_admin1, border_admin0, frontier_admin0), - colors = cols_reach("main_lt_grey", "dk_grey", "black"), - lwds = c(0.5, 2, 3), - labels = c("Department", "Country", "Dominican Rep. frontier"), - title = "Administrative boundaries") + - # Add text labels - centered on admin 1 centroids - add_admin_labels(centroid_admin1, ADM1_FR_UPPER) + - # Add a compass - add_compass() + - # Add a scale bar - add_scale_bar() + - # Add credits - add_credits("Admin. boundaries. : CNIGS \nCoord. system: GCS WGS 1984") -``` - -```{r map-save, eval = TRUE, include = FALSE, echo = TRUE} -tmap::tmap_save(map, - "man/figures/README-example-map.png", - height = 4.5, - width = 6 - ) -``` - -![Once exported with `tmap::tmap_save()`.](man/figures/README-example-map.png) +The side-by-side positioning for grouped lollipops makes them visually distinct from dumbbell plots, which typically connect related points on the same line. diff --git a/README.md b/README.md index 0e24eb5..5e043eb 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ -# visualizeR +# visualizeR -> What a color\! What a viz\! +> What a color! What a viz! -`visualizeR` proposes some utils to get REACH and AGORA colors, -ready-to-go color palettes, and a few visualization functions -(horizontal hist graph for instance). +`visualizeR` proposes some utils to sane colors, ready-to-go color +palettes, and a few visualization functions. ## Installation @@ -16,133 +15,137 @@ You can install the last version of visualizeR from ``` r # install.packages("devtools") -devtools::install_github("gnoblet/visualizeR", build_vignettes = TRUE) +devtools::install_github('gnoblet/visualizeR', build_vignettes = TRUE) ``` ## Roadmap Roadmap is as follows: - - \[X\] Add IMPACT’s colors - - \[X\] Add all color palettes from the internal documentation - - \[ \] There remains to be added more-than-7-color palettes and black - color palettes - - \[X\] Add new types of visualization (e.g. dumbbell plot, lollipop - plot, etc.) - - \[X\] Use examples - - \[ \] Add some ease-map functions - - \[ \] Add some interactive functions (maps and graphs) - - \[ \] Consolidate and make errors transparent +- [ ] Full revamp of core functions (colors, pattern, incl. adding test + and pre-commit structures) +- [ ] Add other types of plots: + - [ ] Dumbell + - [ ] Waffle + - [ ] Donut + - [ ] Alluvial ## Request Please, do not hesitate to pull request any new viz or colors or color -palettes, or to email request any change -( or ). +palettes, or to email request any change (). ## Colors -Color palettes for REACH, AGORA and IMPACT are available. Functions to -access colors and palettes are `cols_initiative()` or -`pal_initiative()`. For now, the initiative with the most colors and -color palettes is REACH. Feel free to pull requests new AGORA and IMPACT -colors. +Functions to access colors and palettes are `color()` or `palette()`. +Feel free to pull request new colors. ``` r library(visualizeR) -# Get all saved REACH colors, named -cols_reach(unnamed = F)[1:10] -#> white black main_grey main_red main_lt_grey main_beige -#> "#FFFFFF" "#000000" "#58585A" "#EE5859" "#C7C8CA" "#D2CBB8" -#> iroise_1 iroise_2 iroise_3 iroise_4 -#> "#DFECEF" "#B1D7E0" "#699DA3" "#236A7A" +# Get all saved colors, named +color(unname = F)[1:10] +#> white lighter_grey light_grey dark_grey light_blue_grey +#> "#FFFFFF" "#F5F5F5" "#E3E3E3" "#464647" "#B3C6D1" +#> grey black cat_2_yellow_1 cat_2_yellow_2 cat_2_light_1 +#> "#71716F" "#000000" "#ffc20a" "#0c7bdc" "#fefe62" # Extract a color palette as hexadecimal codes and reversed -pal_reach(palette = "main", reversed = TRUE, color_ramp_palette = FALSE) -#> [1] "#58585A" "#EE5859" "#C7C8CA" "#D2CBB8" +palette(palette = 'cat_5_main', reversed = TRUE, color_ramp_palette = FALSE) +#> [1] "#083d77" "#4ecdc4" "#f4c095" "#b47eb3" "#ffd5ff" # Get all color palettes names -pal_reach(show_palettes = T) -#> [1] "main" "primary" "secondary" "two_dots" -#> [5] "two_dots_flashy" "red_main" "red_main_5" "red_alt" -#> [9] "red_alt_5" "iroise" "iroise_5" "discrete_6" -#> [13] "red_2" "red_3" "red_4" "red_5" -#> [17] "red_6" "red_7" "green_2" "green_3" -#> [21] "green_4" "green_5" "green_6" "green_7" -#> [25] "artichoke_2" "artichoke_3" "artichoke_4" "artichoke_5" -#> [29] "artichoke_6" "artichoke_7" "blue_2" "blue_3" -#> [33] "blue_4" "blue_5" "blue_6" "blue_7" +palette(show_palettes = TRUE) +#> [1] "cat_2_yellow" "cat_2_light" +#> [3] "cat_2_green" "cat_2_blue" +#> [5] "cat_5_main" "cat_5_ibm" +#> [7] "cat_3_aquamarine" "cat_3_tol_high_contrast" +#> [9] "cat_8_tol_adapted" "cat_3_custom_1" +#> [11] "cat_4_custom_1" "cat_5_custom_1" +#> [13] "cat_6_custom_1" "div_5_orange_blue" +#> [15] "div_5_green_purple" ``` ## Charts -### Example 1: Bar chart, already REACH themed +### Example 1: Bar chart ``` r -library(visualizeR) library(palmerpenguins) library(dplyr) -df <- penguins |> - group_by(island, species) |> +df <- penguins |> + group_by(island, species) |> summarize( mean_bl = mean(bill_length_mm, na.rm = T), - mean_fl = mean(flipper_length_mm, na.rm = T)) |> + mean_fl = mean(flipper_length_mm, na.rm = T) + ) |> + ungroup() + +df_island <- penguins |> + group_by(island) |> + summarize( + mean_bl = mean(bill_length_mm, na.rm = T), + mean_fl = mean(flipper_length_mm, na.rm = T) + ) |> ungroup() # Simple bar chart by group with some alpha transparency -bar(df, island, mean_bl, species, percent = FALSE, alpha = 0.6, x_title = "Mean of bill length") +bar(df, 'island', 'mean_bl', 'species', x_title = 'Mean of bill length', title = 'Mean of bill length by island and species') ``` ``` r -# Using another color palette through `theme_reach()` and changing scale to percent -bar(df, island,mean_bl, species, percent = TRUE, theme = theme_reach(palette = "artichoke_3")) +# Flipped / Horizontal +hbar(df, 'island', 'mean_bl', 'species', x_title = 'Mean of bill length', title = 'Mean of bill length by island and species') ``` ``` r -# Not flipped, with text added, group_title, no y-axis and no bold for legend -bar(df, island, mean_bl, species, group_title = "Species", flip = FALSE, add_text = TRUE, add_text_suffix = "%", percent = FALSE, theme = theme_reach(text_font_face = "plain", axis_y = FALSE)) +# Facetted +bar(df, 'island', 'mean_bl', facet = 'species', x_title = 'Mean of bill length', title = 'Mean of bill length by island and species', add_color_guide = FALSE) ``` -### Example 2: Point chart, already REACH themed - -At this stage, `point_reach()` only supports categorical grouping colors -with the `group` arg. - ``` r -# Simple point chart -point(penguins, bill_length_mm, flipper_length_mm) +# Flipped, with text, smaller width, and caption +hbar(df = df_island, x = 'island', y = 'mean_bl', title = 'Mean of bill length by island', add_text = T, width = 0.6, add_text_suffix = 'mm', add_text_expand_limit = 1.3, add_color_guide = FALSE, caption = "Data: palmerpenguins package.") +``` + + + +### Example 2: Scatterplot + +``` r +# Simple scatterplot +point(penguins, 'bill_length_mm', 'flipper_length_mm') ``` ``` r -# Point chart with grouping colors, greater dot size, some transparency, reversed color palette -point(penguins, bill_length_mm, flipper_length_mm, island, alpha = 0.6, size = 3, theme = theme_reach(reverse = TRUE)) +# Scatterplot with grouping colors, greater dot size, some transparency +point(penguins, 'bill_length_mm', 'flipper_length_mm', 'island', group_title = 'Island', alpha = 0.6, size = 3, title = 'Bill vs. flipper length', , add_color_guide = FALSE) ``` ``` r -# Using another color palettes -point(penguins, bill_length_mm, flipper_length_mm, island, size = 1.5, x_title = "Bill", y_title = "Flipper", title = "Length (mm)", theme = theme_reach(palette = "artichoke_3", text_font_face = , grid_major_x = TRUE, title_position_to_plot = FALSE)) +# Facetted scatterplot by island +point(penguins, 'bill_length_mm', 'flipper_length_mm', 'species', 'island', 'fixed', group_title = 'Species', title = 'Bill vs. flipper length by species and island', add_color_guide = FALSE) ``` -### Example 3: Dumbbell plot, REACH themed +### Example 3: Dumbbell plot Remember to ensure that your data are in the long format and you only have two groups on the x-axis; for instance, IDP and returnee and no NA @@ -152,179 +155,187 @@ values. # Prepare long data df <- tibble::tibble( admin1 = rep(letters[1:8], 2), - setting = c(rep(c("Rural", "Urban"), 4), rep(c("Urban", "Rural"), 4)), + setting = c(rep(c('Rural', 'Urban'), 4), rep(c('Urban', 'Rural'), 4)), stat = rnorm(16, mean = 50, sd = 18) ) |> dplyr::mutate(stat = round(stat, 0)) -# Example, adding a parameter to `theme_reach()` passed on `ggplot2::theme()` to align legend title -dumbbell(df, - stat, - setting, - admin1, - title = "% of HHs that reported open defecation as sanitation facility", - group_y_title = "Admin 1", - group_x_title = "Setting", - theme = theme_reach(legend_position = "bottom", - legend_direction = "horizontal", - legend_title_font_face = "bold", - palette = "primary", - title_position_to_plot = FALSE, - legend.title.align = 0.5)) + - # Change legend title position (could be included as part of the function) - ggplot2::guides( - color = ggplot2::guide_legend(title.position = "left"), - fill = ggplot2::guide_legend(title.position = "left") - ) + + +# dumbbell( +# df, +# 'stat', +# 'setting', +# 'admin1', +# title = '% of HHs that reported open defecation as sanitation facility', +# group_y_title = 'Admin 1', +# group_x_title = 'Setting' +# ) ``` - - -### Example 4: donut chart, REACH themed (to used once, not twice) +### Example 4: donut chart ``` r - # Some summarized data: % of HHs by displacement status df <- tibble::tibble( - status = c("Displaced", "Non displaced", "Returnee", "Don't know/Prefer not to say"), + status = c('Displaced', 'Non displaced', 'Returnee', 'Don\'t know/Prefer not to say'), percentage = c(18, 65, 12, 3) ) # Donut -donut(df, - status, - percentage, - hole_size = 3, - add_text_suffix = "%", - add_text_color = cols_reach("dk_grey"), - add_text_treshold_display = 5, - x_title = "Displacement status", - title = "% of HHs by displacement status", - theme = theme_reach(legend_reverse = TRUE)) +# donut(df, +# status, +# percentage, +# hole_size = 3, +# add_text_suffix = '%', +# add_text_color = color('dark_grey'), +# add_text_treshold_display = 5, +# x_title = 'Displacement status', +# title = '% of HHs by displacement status' +# ) ``` - - -### Example 5: waffle chart +### Example 5: Waffle chart ``` r # -waffle(df, status, percentage, x_title = "A caption", title = "A title", subtitle = "A subtitle") +# waffle(df, status, percentage, x_title = 'A caption', title = 'A title', subtitle = 'A subtitle') ``` - - -### Example 6: alluvial chart, REACH themed +### Example 6: Alluvial chart ``` r - # Some summarized data: % of HHs by self-reported status of displacement in 2021 and in 2022 df <- tibble::tibble( - status_from = c(rep("Displaced", 4), - rep("Non displaced", 4), - rep("Returnee", 4), - rep("Dnk/Pnts", 4)), - status_to = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts", "Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), + status_from = c( + rep('Displaced', 4), + rep('Non displaced', 4), + rep('Returnee', 4), + rep('Dnk/Pnts', 4) + ), + status_to = c('Displaced', 'Non displaced', 'Returnee', 'Dnk/Pnts', 'Displaced', 'Non displaced', 'Returnee', 'Dnk/Pnts', 'Displaced', 'Non displaced', 'Returnee', 'Dnk/Pnts', 'Displaced', 'Non displaced', 'Returnee', 'Dnk/Pnts'), percentage = c(20, 8, 18, 1, 12, 21, 0, 2, 0, 3, 12, 1, 0, 0, 1, 1) ) # Alluvial, here the group is the status for 2021 -alluvial(df, - status_from, - status_to, - percentage, - status_from, - from_levels = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), - alpha = 0.8, - group_title = "Status for 2021", - title = "% of HHs by self-reported status from 2021 to 2022", - theme = theme_reach( - axis_y = FALSE, - legend_position = "none")) +# alluvial(df, +# status_from, +# status_to, +# percentage, +# status_from, +# from_levels = c("Displaced", "Non displaced", "Returnee", "Dnk/Pnts"), +# alpha = 0.8, +# group_title = "Status for 2021", +# title = "% of HHs by self-reported status from 2021 to 2022" +# ) ``` - - -### Example 7: lollipop chart +### Example 7: Lollipop chart ``` r library(tidyr) # Prepare long data df <- tibble::tibble( - admin1 = replicate(15, sample(letters, 8)) |> t() |> as.data.frame() |> unite("admin1", sep = "") |> dplyr::pull(admin1), - stat = rnorm(15, mean = 50, sd = 15)) |> + admin1 = replicate(15, sample(letters, 8)) |> t() |> as.data.frame() |> unite("admin1", sep = "") |> dplyr::pull(admin1), + stat = rnorm(15, mean = 50, sd = 15) +) |> dplyr::mutate(stat = round(stat, 0)) -# Make lollipop plot, REACH themed, vertical with 45 degrees angle X-labels -lollipop(df, - admin1, - stat, - arrange = FALSE, - add_text = FALSE, - flip = FALSE, - y_title = "% of HHs", - x_title = "Admin 1", - title = "% of HHs that reported having received a humanitarian assistance", - theme = theme_reach(axis_text_x_angle = 45, - grid_major_y = TRUE, - grid_major_y_size = 0.2, - grid_major_x = TRUE, - grid_minor_y = TRUE)) +# Simple vertical lollipop chart +lollipop( + df = df, + x = "admin1", + y = "stat", + flip = FALSE, + dot_size = 3, + y_title = "% of HHs", + x_title = "Admin 1", + title = "% of HHs that received humanitarian assistance" +) ``` ``` r -# Horizontal, greater point size, arranged by value, no grid, and text labels added -lollipop(df, - admin1, - stat, - arrange = TRUE, - point_size = 10, - point_color = cols_reach("main_beige"), - segment_size = 2, - add_text = TRUE, - add_text_suffix = "%", - y_title = "% of HHs", - x_title = "Admin 1", - title = "% of HHs that reported having received a humanitarian assistance in the 12 months prior to the assessment", - theme = theme_reach(title_position_to_plot = FALSE)) +# Horizontal lollipop chart with custom colors +hlollipop( + df = df, + x = "admin1", + y = "stat", + dot_size = 4, + line_size = 1, + add_color = color("cat_5_main_2"), + line_color = color("cat_5_main_4"), + y_title = "% of HHs", + x_title = "Admin 1", + title = "% of HHs that received humanitarian assistance" +) ``` -## Maps +``` r + +# Create data for grouped lollipop - using set.seed for reproducibility +set.seed(123) +df_grouped <- tibble::tibble( + admin1 = rep(c("A", "B", "C", "D", "E", "F"), 2), + group = rep(c("Group A", "Group B"), each = 6), + stat = c(rnorm(6, mean = 40, sd = 10), rnorm(6, mean = 60, sd = 10)) +) |> + dplyr::mutate(stat = round(stat, 0)) + +# Grouped lollipop chart with proper side-by-side positioning +lollipop( + df = df_grouped, + x = "admin1", + y = "stat", + group = "group", + dodge_width = 0.8, # Control spacing between grouped lollipops + dot_size = 3.5, + line_size = 0.8, + y_title = "Value", + x_title = "Category", + title = "True side-by-side grouped lollipop chart" +) +``` + + ``` r -# Add indicator layer -# - based on "pretty" classes and title "Proportion (%)" -# - buffer to add a 10% around the bounding box -map <- add_indicator_layer( - indicator_admin1, - opn_dfc, - buffer = 0.1) + - # Layout - some defaults - add the map title - add_layout("% of HH that reported open defecation as sanitation facility") + - # Admin boundaries as list of shape files (lines) and colors, line widths and labels as vectors - add_admin_boundaries( - lines = list(line_admin1, border_admin0, frontier_admin0), - colors = cols_reach("main_lt_grey", "dk_grey", "black"), - lwds = c(0.5, 2, 3), - labels = c("Department", "Country", "Dominican Rep. frontier"), - title = "Administrative boundaries") + - # Add text labels - centered on admin 1 centroids - add_admin_labels(centroid_admin1, ADM1_FR_UPPER) + - # Add a compass - add_compass() + - # Add a scale bar - add_scale_bar() + - # Add credits - add_credits("Admin. boundaries. : CNIGS \nCoord. system: GCS WGS 1984") +# Horizontal grouped lollipop chart +hlollipop( + df = df_grouped, + x = "admin1", + y = "stat", + group = "group", + dodge_width = 0.7, # Narrower spacing for horizontal orientation + dot_size = 3.5, + line_size = 0.8, + y_title = "Category", + x_title = "Value", + title = "Horizontal side-by-side grouped lollipop chart" +) ``` -![Once exported with -`tmap::tmap_save()`.](man/figures/README-example-map.png) + + +## Lollipop Chart Features + +Lollipop charts offer several advantages: + +- Clean visualization of point data with connecting lines to a baseline +- True side-by-side grouped display for easy comparison between + categories +- Each lollipop maintains its position from dot to baseline +- Customizable appearance with parameters for dot size, line width, and + colors +- The `dodge_width` parameter controls spacing between grouped lollipops + +The side-by-side positioning for grouped lollipops makes them visually +distinct from dumbbell plots, which typically connect related points on +the same line. diff --git a/data-raw/border_admin0.dbf b/data-raw/border_admin0.dbf deleted file mode 100644 index 2cdd77c..0000000 Binary files a/data-raw/border_admin0.dbf and /dev/null differ diff --git a/data-raw/border_admin0.prj b/data-raw/border_admin0.prj deleted file mode 100644 index f8e4548..0000000 --- a/data-raw/border_admin0.prj +++ /dev/null @@ -1 +0,0 @@ -PROJCS["WGS_1984_UTM_Zone_18N",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Transverse_Mercator"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",-75.0],PARAMETER["Scale_Factor",0.9996],PARAMETER["Latitude_Of_Origin",0.0],UNIT["m",1.0]] \ No newline at end of file diff --git a/data-raw/border_admin0.shp b/data-raw/border_admin0.shp deleted file mode 100644 index 559c58d..0000000 Binary files a/data-raw/border_admin0.shp and /dev/null differ diff --git a/data-raw/border_admin0.shx b/data-raw/border_admin0.shx deleted file mode 100644 index f4d8240..0000000 Binary files a/data-raw/border_admin0.shx and /dev/null differ diff --git a/data-raw/centroid_admin1.dbf b/data-raw/centroid_admin1.dbf deleted file mode 100644 index f17bfb9..0000000 Binary files a/data-raw/centroid_admin1.dbf and /dev/null differ diff --git a/data-raw/centroid_admin1.prj b/data-raw/centroid_admin1.prj deleted file mode 100644 index 79392c5..0000000 --- a/data-raw/centroid_admin1.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_unknown",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/data-raw/centroid_admin1.shp b/data-raw/centroid_admin1.shp deleted file mode 100644 index 67811d2..0000000 Binary files a/data-raw/centroid_admin1.shp and /dev/null differ diff --git a/data-raw/centroid_admin1.shx b/data-raw/centroid_admin1.shx deleted file mode 100644 index f6ca9fc..0000000 Binary files a/data-raw/centroid_admin1.shx and /dev/null differ diff --git a/data-raw/frontier_admin0.dbf b/data-raw/frontier_admin0.dbf deleted file mode 100644 index 20c39d2..0000000 Binary files a/data-raw/frontier_admin0.dbf and /dev/null differ diff --git a/data-raw/frontier_admin0.prj b/data-raw/frontier_admin0.prj deleted file mode 100644 index f45cbad..0000000 --- a/data-raw/frontier_admin0.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/data-raw/frontier_admin0.shp b/data-raw/frontier_admin0.shp deleted file mode 100644 index 6a7c832..0000000 Binary files a/data-raw/frontier_admin0.shp and /dev/null differ diff --git a/data-raw/frontier_admin0.shx b/data-raw/frontier_admin0.shx deleted file mode 100644 index aeb62b0..0000000 Binary files a/data-raw/frontier_admin0.shx and /dev/null differ diff --git a/data-raw/indicator_admin1.dbf b/data-raw/indicator_admin1.dbf deleted file mode 100644 index 9dd16e2..0000000 Binary files a/data-raw/indicator_admin1.dbf and /dev/null differ diff --git a/data-raw/indicator_admin1.prj b/data-raw/indicator_admin1.prj deleted file mode 100644 index f45cbad..0000000 --- a/data-raw/indicator_admin1.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/data-raw/indicator_admin1.shp b/data-raw/indicator_admin1.shp deleted file mode 100644 index cd956a4..0000000 Binary files a/data-raw/indicator_admin1.shp and /dev/null differ diff --git a/data-raw/indicator_admin1.shx b/data-raw/indicator_admin1.shx deleted file mode 100644 index 114b1d3..0000000 Binary files a/data-raw/indicator_admin1.shx and /dev/null differ diff --git a/data-raw/line_admin1.dbf b/data-raw/line_admin1.dbf deleted file mode 100644 index 27046d0..0000000 Binary files a/data-raw/line_admin1.dbf and /dev/null differ diff --git a/data-raw/line_admin1.prj b/data-raw/line_admin1.prj deleted file mode 100644 index f45cbad..0000000 --- a/data-raw/line_admin1.prj +++ /dev/null @@ -1 +0,0 @@ -GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]] \ No newline at end of file diff --git a/data-raw/line_admin1.shp b/data-raw/line_admin1.shp deleted file mode 100644 index 5a39a4b..0000000 Binary files a/data-raw/line_admin1.shp and /dev/null differ diff --git a/data-raw/line_admin1.shx b/data-raw/line_admin1.shx deleted file mode 100644 index e078d09..0000000 Binary files a/data-raw/line_admin1.shx and /dev/null differ diff --git a/data-raw/shapefiles.R b/data-raw/shapefiles.R deleted file mode 100644 index 13db57a..0000000 --- a/data-raw/shapefiles.R +++ /dev/null @@ -1,21 +0,0 @@ - -#------ Border - admin 0 -border_admin0 <- sf::st_read("data-raw/border_admin0.shp") -usethis::use_data(border_admin0, overwrite = TRUE) - -#------ Frontier - admin 0 -frontier_admin0 <- sf::st_read("data-raw/frontier_admin0.shp") -usethis::use_data(frontier_admin0, overwrite = TRUE) - -#------ Line - admin 1 -line_admin1 <- sf::st_read("data-raw/line_admin1.shp") -usethis::use_data(line_admin1, overwrite = TRUE) - -#------ Centroid - admin 1 -centroid_admin1 <- sf::st_read("data-raw/centroid_admin1.shp") |> - dplyr::rename(ADM1_FR_UPPER = ADM1_FR_) -usethis::use_data(centroid_admin1, overwrite = TRUE) - -#------ Indicator polygon - admin 1 -indicator_admin1 <- sf::st_read("data-raw/indicator_admin1.shp") -usethis::use_data(indicator_admin1, overwrite = TRUE) diff --git a/data/border_admin0.rda b/data/border_admin0.rda deleted file mode 100644 index a6400e1..0000000 Binary files a/data/border_admin0.rda and /dev/null differ diff --git a/data/centroid_admin1.rda b/data/centroid_admin1.rda deleted file mode 100644 index f144be5..0000000 Binary files a/data/centroid_admin1.rda and /dev/null differ diff --git a/data/frontier_admin0.rda b/data/frontier_admin0.rda deleted file mode 100644 index b57263a..0000000 Binary files a/data/frontier_admin0.rda and /dev/null differ diff --git a/data/indicator_admin1.rda b/data/indicator_admin1.rda deleted file mode 100644 index f1a1a63..0000000 Binary files a/data/indicator_admin1.rda and /dev/null differ diff --git a/data/line_admin1.rda b/data/line_admin1.rda deleted file mode 100644 index 9393fdd..0000000 Binary files a/data/line_admin1.rda and /dev/null differ diff --git a/inst/WORDLIST b/inst/WORDLIST new file mode 100644 index 0000000..e5b31ed --- /dev/null +++ b/inst/WORDLIST @@ -0,0 +1,45 @@ +aut +coercible +Config +cre +Customizable +donut +Donut +dplyr +Dumbell +forcats +ggalluvial +ggplot +ggrepel +ggtext +github +gnoblet +grDevices +grey +Guillaume +hlollipop +horizonal +https +IDP +io +knitr +LazyData +Noblet +pre +rio +rlang +rmarkdown +Roadmap +Roboto +roxygen +RoxygenNote +Segoe +stringr +testthat +tidyr +UI +vdiffr +VignetteBuilder +viridisLite +visualizeR +zaclys diff --git a/man/abort_bad_argument.Rd b/man/abort_bad_argument.Rd deleted file mode 100644 index 02ec558..0000000 --- a/man/abort_bad_argument.Rd +++ /dev/null @@ -1,21 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/internals.R -\name{abort_bad_argument} -\alias{abort_bad_argument} -\title{Abord bad argument} -\usage{ -abort_bad_argument(arg, must, not = NULL) -} -\arguments{ -\item{arg}{An argument} - -\item{must}{What arg must be} - -\item{not}{Optional. What arg must not be.} -} -\value{ -A stop statement -} -\description{ -Abord bad argument -} diff --git a/man/add_admin_boundaries.Rd b/man/add_admin_boundaries.Rd deleted file mode 100644 index 7d6e3b4..0000000 --- a/man/add_admin_boundaries.Rd +++ /dev/null @@ -1,37 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_admin_boundaries} -\alias{add_admin_boundaries} -\title{Add admin boundaries (lines) and the legend} -\usage{ -add_admin_boundaries( - lines, - colors, - labels, - lwds, - title = "", - buffer = NULL, - ... -) -} -\arguments{ -\item{lines}{List of multiline shape defined by sf package.} - -\item{colors}{Vector of hexadecimal codes. Same order as lines.} - -\item{labels}{Vector of labels in the legend. Same order as lines.} - -\item{lwds}{Vector of line widths. Same order as lines.} - -\item{title}{Legend title.} - -\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top).} - -\item{...}{Other arguments to pass to each shape in `tmap::tm_lines()`.} -} -\value{ -A tmap layer. -} -\description{ -Add admin boundaries (lines) and the legend -} diff --git a/man/add_admin_labels.Rd b/man/add_admin_labels.Rd deleted file mode 100644 index d9691b6..0000000 --- a/man/add_admin_labels.Rd +++ /dev/null @@ -1,43 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_admin_labels} -\alias{add_admin_labels} -\title{Wrapper around `tmap::tm_text()` with sane defaults for plotting admin labels.} -\usage{ -add_admin_labels( - point, - text, - size = 0.5, - fontface = "bold", - fontfamily = "Leelawadee", - shadow = TRUE, - auto_placement = FALSE, - remove_overlap = FALSE, - ... -) -} -\arguments{ -\item{point}{Multipoint shape defined by sf package.} - -\item{text}{Text labels column.} - -\item{size}{Relative size of the text labels.} - -\item{fontface}{Fontface.} - -\item{fontfamily}{Fontfamily. Leelawadee is your precious.} - -\item{shadow}{Boolean. Add a shadow around text labels. Issue opened on Github to request.} - -\item{auto_placement}{Logical that determines whether the labels are placed automatically.} - -\item{remove_overlap}{Logical that determines whether the overlapping labels are removed.} - -\item{...}{Other arguments to pass to `tmap::tm_text()`.} -} -\value{ -A tmap layer. -} -\description{ -Wrapper around `tmap::tm_text()` with sane defaults for plotting admin labels. -} diff --git a/man/add_compass.Rd b/man/add_compass.Rd deleted file mode 100644 index a22f932..0000000 --- a/man/add_compass.Rd +++ /dev/null @@ -1,34 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_compass} -\alias{add_compass} -\title{Add a compass} -\usage{ -add_compass( - text_size = 0.6, - position = c("right", 0.8), - color_dark = cols_reach("black"), - text_color = cols_reach("black"), - type = "4star", - ... -) -} -\arguments{ -\item{text_size}{Relative font size.} - -\item{position}{Position of the compass. Vector of two values, specifying the x and y coordinates.} - -\item{color_dark}{Color of the dark parts of the compass.} - -\item{text_color}{color of the text.} - -\item{type}{Compass type, one of: "arrow", "4star", "8star", "radar", "rose".} - -\item{...}{Other arguments to pass to `tmap::tm_compass()`.} -} -\value{ -A tmap layer. -} -\description{ -Add a compass -} diff --git a/man/add_credits.Rd b/man/add_credits.Rd deleted file mode 100644 index 9410747..0000000 --- a/man/add_credits.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_credits} -\alias{add_credits} -\title{Do you want to credit someone or some institution?} -\usage{ -add_credits(text, size = 0.4, bg_color = NA, position = c(0.75, 0.02), ...) -} -\arguments{ -\item{text}{Text.} - -\item{size}{Relative text size.} - -\item{bg_color}{Background color.} - -\item{position}{Position. Vector of two coordinates. Usually somewhere down.} - -\item{...}{Other arguments to pass to `tmap::tm_credits()`.} -} -\value{ -A tmap layer. -} -\description{ -Do you want to credit someone or some institution? -} diff --git a/man/add_indicator_layer.Rd b/man/add_indicator_layer.Rd deleted file mode 100644 index cf54ac2..0000000 --- a/man/add_indicator_layer.Rd +++ /dev/null @@ -1,61 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_indicator_layer} -\alias{add_indicator_layer} -\title{Wrapper around `tmap::tm_polygons()` with sane defaults for plotting indicator values} -\usage{ -add_indicator_layer( - poly, - col, - buffer = NULL, - n = 5, - style = "pretty", - palette = pal_reach("red_5"), - as_count = TRUE, - color_na = cols_reach("white"), - text_na = "Missing data", - legend_title = "Proportion (\%)", - legend_text_separator = " - ", - border_alpha = 1, - border_col = cols_reach("lt_grey_1"), - lwd = 1, - ... -) -} -\arguments{ -\item{poly}{Multipolygon shape defined by sf package.} - -\item{col}{Numeric attribute to map.} - -\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top).} - -\item{n}{The desire number of classes.} - -\item{style}{Method to process the color scale for continuous numerical variables. See `classInt::classIntervals()` for details.} - -\item{palette}{Vector of fill colors as hexadecimal values. For REACH color palettes, it is possible to use `pal_reach()`. For now,'palette' must be changed manually, accordingly to the number of drawn classes.} - -\item{as_count}{Boolean. When col is a numeric variable, should it be processed as a count variable? For instance, 0, 1-10, 11-20.} - -\item{color_na}{Fill color for missing data.} - -\item{text_na}{Legend text for missing data.} - -\item{legend_title}{Legend title.} - -\item{legend_text_separator}{Text separator for classes. E.g. " to " will give 0, 1 to 10, 11 to 20.} - -\item{border_alpha}{Transparency of the border.} - -\item{border_col}{Color of the border.} - -\item{lwd}{Linewidth of the border.} - -\item{...}{Other arguments to pass to `tmap::tm_polygons()`.} -} -\value{ -A tmap layer. -} -\description{ -Wrapper around `tmap::tm_polygons()` with sane defaults for plotting indicator values -} diff --git a/man/add_layout.Rd b/man/add_layout.Rd deleted file mode 100644 index f5c4b53..0000000 --- a/man/add_layout.Rd +++ /dev/null @@ -1,49 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_layout} -\alias{add_layout} -\title{Basic defaults based on `tmap::tm_layout()`} -\usage{ -add_layout( - title = NULL, - legend_position = c(0.02, 0.5), - frame = FALSE, - legend_frame = cols_reach("main_grey"), - legend_text_size = 0.6, - legend_title_size = 0.8, - title_size = 0.9, - title_fontface = "bold", - title_color = cols_reach("main_grey"), - fontfamily = "Leelawadee", - ... -) -} -\arguments{ -\item{title}{Map title.} - -\item{legend_position}{Legend position. Not above the map is a good start.} - -\item{frame}{Boolean. Legend frame?} - -\item{legend_frame}{Legend frame color.} - -\item{legend_text_size}{Legend text size in 'pt'.} - -\item{legend_title_size}{Legend title size in 'pt'.} - -\item{title_size}{Title text size in 'pt'.} - -\item{title_fontface}{Title fontface. Bold if you wanna exemplify a lot what it is about.} - -\item{title_color}{Title font color.} - -\item{fontfamily}{Overall fontfamily. Leelawadee is your precious.} - -\item{...}{Other arguments to pass to `tmap::tm_layout()`.} -} -\value{ -A tmap layer. -} -\description{ -Basic defaults based on `tmap::tm_layout()` -} diff --git a/man/add_scale_bar.Rd b/man/add_scale_bar.Rd deleted file mode 100644 index b204c3c..0000000 --- a/man/add_scale_bar.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/map.R -\name{add_scale_bar} -\alias{add_scale_bar} -\title{Add a scale bar} -\usage{ -add_scale_bar( - text_size = 0.6, - position = c("left", 0.01), - color_dark = cols_reach("black"), - breaks = c(0, 50, 100), - ... -) -} -\arguments{ -\item{text_size}{Relative font size.} - -\item{position}{Position of the compass. Vector of two values, specifying the x and y coordinates.} - -\item{color_dark}{Color of the dark parts of the compass.} - -\item{breaks}{Breaks of the scale bar. If not specified, breaks will be automatically be chosen given the prefered width of the scale bar. Example: c(0, 50, 100).} - -\item{...}{Other arguments to pass to `tmap::tm_compass()`.} -} -\value{ -A tmap layer. -} -\description{ -Add a scale bar -} diff --git a/man/alluvial.Rd b/man/alluvial.Rd deleted file mode 100644 index 8750fe9..0000000 --- a/man/alluvial.Rd +++ /dev/null @@ -1,64 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/alluvial.R -\name{alluvial} -\alias{alluvial} -\title{Simple alluvial chart} -\usage{ -alluvial( - df, - from, - to, - value, - group = NULL, - alpha = 0.5, - from_levels = NULL, - value_title = NULL, - group_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - rect_color = cols_reach("white"), - rect_border_color = cols_reach("main_grey"), - rect_text_color = cols_reach("main_grey"), - theme = theme_reach(axis_y = FALSE, legend_position = "none") -) -} -\arguments{ -\item{df}{A data frame.} - -\item{from}{A character column of upstream stratum.} - -\item{to}{A character column of downstream stratum.} - -\item{value}{A numeric column of values.} - -\item{group}{The grouping column to fill the alluvium with.} - -\item{alpha}{Fill transparency. Default to 0.5.} - -\item{from_levels}{Order by given from levels?} - -\item{value_title}{The value/y scale title. Default to NULL.} - -\item{group_title}{The group title. Default to NULL.} - -\item{title}{Plot title. Default to NULL.} - -\item{subtitle}{Plot subtitle. Default to NULL.} - -\item{caption}{Plot caption. Default to NULL.} - -\item{rect_color}{Stratum rectangles' fill color.} - -\item{rect_border_color}{Stratum rectangles' border color.} - -\item{rect_text_color}{Stratum rectangles' text color.} - -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A donut chart to be used parsimoniously -} -\description{ -Simple alluvial chart -} diff --git a/man/bar.Rd b/man/bar.Rd index 7dc2f19..db8545a 100644 --- a/man/bar.Rd +++ b/man/bar.Rd @@ -1,16 +1,32 @@ % Generated by roxygen2: do not edit by hand % Please edit documentation in R/bar.R -\name{bar} +\name{hbar} +\alias{hbar} \alias{bar} \title{Simple bar chart} \usage{ +hbar( + ..., + flip = TRUE, + add_text = FALSE, + theme_fun = theme_bar(flip = flip, add_text = add_text) +) + bar( df, x, y, - group = NULL, - flip = TRUE, - percent = TRUE, + group = "", + facet = "", + order = "none", + x_rm_na = TRUE, + y_rm_na = TRUE, + group_rm_na = TRUE, + facet_rm_na = TRUE, + y_expand = 0.1, + add_color = color("cat_5_main_1"), + add_color_guide = TRUE, + flip = FALSE, wrap = NULL, position = "dodge", alpha = 1, @@ -20,23 +36,53 @@ bar( title = NULL, subtitle = NULL, caption = NULL, + width = 0.8, add_text = FALSE, - add_text_suffix = "", - theme = theme_reach() + add_text_size = 4.5, + add_text_color = color("dark_grey"), + add_text_font_face = "bold", + add_text_threshold_display = 0.05, + add_text_suffix = "\%", + add_text_expand_limit = 1.2, + add_text_round = 1, + theme_fun = theme_bar(flip = flip, add_text = add_text, axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, axis_text_x_hjust = 0.5), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() ) } \arguments{ +\item{flip}{TRUE or FALSE (default). Default to TRUE or horizontal bar plot.} + +\item{add_text}{TRUE or FALSE. Add values as text.} + +\item{theme_fun}{Whatever theme function. For no custom theme, use theme_fun = NULL.} + \item{df}{A data frame.} -\item{x}{A numeric column.} +\item{x}{A quoted numeric column.} -\item{y}{A character column or coercible as a character column.} +\item{y}{A quoted character column or coercible as a character column.} -\item{group}{Some grouping categorical column, e.g. administrative areas or population groups.} +\item{group}{Some quoted grouping categorical column, e.g. administrative areas or population groups.} -\item{flip}{TRUE or FALSE. Default to TRUE or horizontal bar plot.} +\item{facet}{Some quoted grouping categorical column, e.g. administrative areas or population groups.} -\item{percent}{TRUE or FALSE. Should the x-labels (and text labels if present) be displayed as percentages? Default to TRUE.} +\item{order}{A character scalar specifying the order type (one of "none", "y", "grouped"). See details.} + +\item{x_rm_na}{Remove NAs in x?} + +\item{y_rm_na}{Remove NAs in y?} + +\item{group_rm_na}{Remove NAs in group?} + +\item{facet_rm_na}{Remove NAs in facet?} + +\item{y_expand}{Multiplier to expand the y axis.} + +\item{add_color}{Add a color to bars (if no grouping).} + +\item{add_color_guide}{Should a legend be added?} \item{wrap}{Should x-labels be wrapped? Number of characters.} @@ -56,15 +102,22 @@ bar( \item{caption}{Plot caption. Default to NULL.} -\item{add_text}{TRUE or FALSE. Add the value as text.} +\item{width}{Bar width.} + +\item{add_text_size}{Text size.} + +\item{add_text_color}{Text color.} + +\item{add_text_font_face}{Text font_face.} + +\item{add_text_threshold_display}{Minimum value to add the text label.} \item{add_text_suffix}{If percent is FALSE, should we add a suffix to the text label?} -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A bar chart +\item{add_text_expand_limit}{Default to adding 10\% on top of the bar.} + +\item{add_text_round}{Round the text label.} } \description{ -Simple bar chart +`bar()` is a simple bar chart with some customization allowed, in particular the `theme_fun` argument for theming. `hbar()` uses `bar()` with sane defaults for a horizontal bar chart. } diff --git a/man/border_admin0.Rd b/man/border_admin0.Rd deleted file mode 100644 index cd495f3..0000000 --- a/man/border_admin0.Rd +++ /dev/null @@ -1,25 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{border_admin0} -\alias{border_admin0} -\title{Haïti border.} -\format{ -A sf multiline objet with 1 feature and 6 fields: -\describe{ - \item{fid_1}{fid_1} - \item{uno}{uno} - \item{count}{count} - \item{x_coord}{x_coord} - \item{y_coord}{y_coord} - \item{area}{area} - \item{geometry}{Multiline geometry.} -} -} -\usage{ -border_admin0 -} -\description{ -A multiline shapefile of Haiti's border. -} -\keyword{datasets} diff --git a/man/buffer_bbox.Rd b/man/buffer_bbox.Rd deleted file mode 100644 index 066562f..0000000 --- a/man/buffer_bbox.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/bbox_buffer.R -\name{buffer_bbox} -\alias{buffer_bbox} -\title{Bbbox buffer} -\usage{ -buffer_bbox(sf_obj, buffer = 0) -} -\arguments{ -\item{sf_obj}{A `sf` object} - -\item{buffer}{A buffer, either one value or a vector of 4 values (left, bottom, right, top). Default to 0.} -} -\value{ -A bbox with a buffer -} -\description{ -Bbbox buffer -} diff --git a/man/centroid_admin1.Rd b/man/centroid_admin1.Rd deleted file mode 100644 index c221ac9..0000000 --- a/man/centroid_admin1.Rd +++ /dev/null @@ -1,28 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{centroid_admin1} -\alias{centroid_admin1} -\title{Haïti admin 1 centroids shapefile.} -\format{ -A sf multipoint object with 10 features and 9 fields: -\describe{ - \item{ADM1_PC}{Admin 1 postal code.} - \item{ADM1_EN}{Full name in English.} - \item{ADM1_FR}{Full name in French.} - \item{ADM1_HT}{Full name in Haitian Creole.} - \item{ADM0_EN}{Country name in English.} - \item{ADM0_FR}{Country name in French.} - \item{ADM0_HT}{Country name in Haitian Creole.} - \item{ADM0_PC}{Country postal code.} - \item{ADM1_FR_UPPER}{Admin 1 French name - uppercase.} - \item{geometry}{Multipoint geometry.} -} -} -\usage{ -centroid_admin1 -} -\description{ -A multipoint shapefile of Haiti's admin 1. -} -\keyword{datasets} diff --git a/man/check_vars_in_df.Rd b/man/check_vars_in_df.Rd new file mode 100644 index 0000000..b973b00 --- /dev/null +++ b/man/check_vars_in_df.Rd @@ -0,0 +1,19 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/checks.R +\name{check_vars_in_df} +\alias{check_vars_in_df} +\title{Check if variables are in data frame} +\usage{ +check_vars_in_df(df, vars) +} +\arguments{ +\item{df}{A data frame} + +\item{vars}{A vector of variable names} +} +\value{ +A stop statement +} +\description{ +Check if variables are in data frame +} diff --git a/man/color.Rd b/man/color.Rd new file mode 100644 index 0000000..982fe5e --- /dev/null +++ b/man/color.Rd @@ -0,0 +1,33 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/color.R +\name{color} +\alias{color} +\alias{color_pattern} +\title{Helpers to extract defined colors as hex codes} +\usage{ +color(..., unname = TRUE) + +color_pattern(pattern, unname = TRUE) +} +\arguments{ +\item{...}{Character names of colors. If NULL returns all colors.} + +\item{unname}{Boolean. Should the output vector be unnamed? Default to `TRUE`.} + +\item{pattern}{Pattern of the start of colors' name.} +} +\value{ +Hex codes named or unnamed. +} +\description{ +[color()] returns the requested columns, returns NA if absent. [color_pattern()] returns all colors that start with the pattern. +} +\section{Naming of colors}{ + +* All branding colors start with "branding"; +* All , categorical colors start with ", cat_"; +* All sequential colors start with "seq_"; + +Then, a number indicates the number of colors that belong to the palettes, a string the name of the palette, and, finally, a number the position of the color. E.g., "seq_5_red_4" would be the 4th color of a continuous palettes of 5 colors in the red band. Exception is made for white, light_grey, dark_grey, and black. +} + diff --git a/man/cols_agora.Rd b/man/cols_agora.Rd deleted file mode 100644 index 29f603a..0000000 --- a/man/cols_agora.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cols_agora.R -\name{cols_agora} -\alias{cols_agora} -\title{Function to extract AGORA colors as hex codes} -\usage{ -cols_agora(..., unnamed = TRUE) -} -\arguments{ -\item{...}{Character names of reach colors. If NULL returns all colors} - -\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`} -} -\value{ -An hex code or hex codes named or unnamed -} -\description{ -Function to extract AGORA colors as hex codes -} -\details{ -This function needs to be modified to add colors -} diff --git a/man/cols_impact.Rd b/man/cols_impact.Rd deleted file mode 100644 index 9833a64..0000000 --- a/man/cols_impact.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cols_impact.R -\name{cols_impact} -\alias{cols_impact} -\title{Function to extract IMPACT colors as hex codes} -\usage{ -cols_impact(..., unnamed = TRUE) -} -\arguments{ -\item{...}{Character names of reach colors. If NULL returns all colors} - -\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`} -} -\value{ -An hex code or hex codes named or unnamed -} -\description{ -Function to extract IMPACT colors as hex codes -} -\details{ -This function needs to be modified to add colors -} diff --git a/man/cols_reach.Rd b/man/cols_reach.Rd deleted file mode 100644 index 7c0ed87..0000000 --- a/man/cols_reach.Rd +++ /dev/null @@ -1,22 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/cols_reach.R -\name{cols_reach} -\alias{cols_reach} -\title{Function to extract REACH colors as hex codes} -\usage{ -cols_reach(..., unnamed = TRUE) -} -\arguments{ -\item{...}{Character names of reach colors. If NULL returns all colors} - -\item{unnamed}{Should the output vector be unnamed? Default to `TRUE`} -} -\value{ -An hex code or hex codes named or unnamed -} -\description{ -Function to extract REACH colors as hex codes -} -\details{ -This function needs to be modified to add colors -} diff --git a/man/donut.Rd b/man/donut.Rd deleted file mode 100644 index b461123..0000000 --- a/man/donut.Rd +++ /dev/null @@ -1,61 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/donut.R -\name{donut} -\alias{donut} -\title{Simple donut chart (to be used parsimoniously), can be a pie chart} -\usage{ -donut( - df, - x, - y, - alpha = 1, - x_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - arrange = TRUE, - hole_size = 3, - add_text = TRUE, - add_text_treshold_display = 5, - add_text_color = "white", - add_text_suffix = "", - theme = theme_reach(legend_reverse = TRUE) -) -} -\arguments{ -\item{df}{A data frame.} - -\item{x}{A character column or coercible as a character column. Will give the donut's fill color.} - -\item{y}{A numeric column.} - -\item{alpha}{Fill transparency.} - -\item{x_title}{The x scale title. Default to NULL.} - -\item{title}{Plot title. Default to NULL.} - -\item{subtitle}{Plot subtitle. Default to NULL.} - -\item{caption}{Plot caption. Default to NULL.} - -\item{arrange}{TRUE or FALSE. Arrange by highest percentage first.} - -\item{hole_size}{Hole size. Default to 3. If less than 2, back to a pie chart.} - -\item{add_text}{TRUE or FALSE. Add the value as text.} - -\item{add_text_treshold_display}{Minimum value to add the text label.} - -\item{add_text_color}{Text color.} - -\item{add_text_suffix}{If percent is FALSE, should we add a suffix to the text label?} - -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A donut chart to be used parsimoniously -} -\description{ -Simple donut chart (to be used parsimoniously), can be a pie chart -} diff --git a/man/dumbbell.Rd b/man/dumbbell.Rd index 2bd7437..83a307f 100644 --- a/man/dumbbell.Rd +++ b/man/dumbbell.Rd @@ -12,22 +12,24 @@ dumbbell( point_size = 5, point_alpha = 1, segment_size = 2.5, - segment_color = cols_reach("main_lt_grey"), + segment_color = color("light_blue_grey"), group_x_title = NULL, group_y_title = NULL, x_title = NULL, title = NULL, subtitle = NULL, caption = NULL, - line_to_y_axis = TRUE, + line_to_y_axis = FALSE, line_to_y_axis_type = 3, line_to_y_axis_width = 0.5, - line_to_y_axis_color = cols_reach("main_grey"), - add_text = TRUE, + line_to_y_axis_color = color("dark_grey"), + add_text = FALSE, add_text_vjust = 2, add_text_size = 3.5, - add_text_color = cols_reach("main_grey"), - theme = theme_reach(palette = "primary") + add_text_color = color("dark_grey"), + theme_fun = theme_dumbbell(), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() ) } \arguments{ @@ -75,7 +77,11 @@ dumbbell( \item{add_text_color}{Text color.} -\item{theme}{A ggplot2 theme, default to `theme_reach()`} +\item{theme_fun}{A ggplot2 theme, default to `theme_dumbbell()`} + +\item{scale_fill_fun}{A ggplot2 scale_fill function, default to `scale_fill_visualizer_discrete()`} + +\item{scale_color_fun}{A ggplot2 scale_color function, default to `scale_color_visualizer_discrete()`} } \value{ A dumbbell chart. diff --git a/man/figures/README-example-bar-chart-1.png b/man/figures/README-example-bar-chart-1.png index cc3c997..9d1abb0 100644 Binary files a/man/figures/README-example-bar-chart-1.png and b/man/figures/README-example-bar-chart-1.png differ diff --git a/man/figures/README-example-bar-chart-2.png b/man/figures/README-example-bar-chart-2.png index e5cbaad..08e0c94 100644 Binary files a/man/figures/README-example-bar-chart-2.png and b/man/figures/README-example-bar-chart-2.png differ diff --git a/man/figures/README-example-bar-chart-3.png b/man/figures/README-example-bar-chart-3.png index f4b8b7e..950a898 100644 Binary files a/man/figures/README-example-bar-chart-3.png and b/man/figures/README-example-bar-chart-3.png differ diff --git a/man/figures/README-example-bar-chart-4.png b/man/figures/README-example-bar-chart-4.png new file mode 100644 index 0000000..87958f9 Binary files /dev/null and b/man/figures/README-example-bar-chart-4.png differ diff --git a/man/figures/README-example-point-chart-1.png b/man/figures/README-example-point-chart-1.png index f705a3d..f92acd7 100644 Binary files a/man/figures/README-example-point-chart-1.png and b/man/figures/README-example-point-chart-1.png differ diff --git a/man/figures/README-example-point-chart-2.png b/man/figures/README-example-point-chart-2.png index 76ef877..df4c459 100644 Binary files a/man/figures/README-example-point-chart-2.png and b/man/figures/README-example-point-chart-2.png differ diff --git a/man/figures/README-example-point-chart-3.png b/man/figures/README-example-point-chart-3.png index b32aa89..218e708 100644 Binary files a/man/figures/README-example-point-chart-3.png and b/man/figures/README-example-point-chart-3.png differ diff --git a/man/frontier_admin0.Rd b/man/frontier_admin0.Rd deleted file mode 100644 index 91501c1..0000000 --- a/man/frontier_admin0.Rd +++ /dev/null @@ -1,27 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{frontier_admin0} -\alias{frontier_admin0} -\title{Haïti frontier with Dominican Republic.} -\format{ -A sf multipoint objet with 4 features and 8 fields: -\describe{ - \item{fid_1}{fid_1} - \item{objectid}{objectid} - \item{id}{id} - \item{fromnode}{fromnode} - \item{tonode}{tonode} - \item{leftpolygo}{leftpolygo} - \item{rightpolygo}{rightpolygo} - \item{shape_leng}{shape_leng} - \item{geometry}{Multiline geometry.} -} -} -\usage{ -frontier_admin0 -} -\description{ -A multiline shapefile of Haiti's frontier with Dominican Republic. -} -\keyword{datasets} diff --git a/man/if_not_in_stop.Rd b/man/if_not_in_stop.Rd deleted file mode 100644 index bb29dea..0000000 --- a/man/if_not_in_stop.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/internals.R -\name{if_not_in_stop} -\alias{if_not_in_stop} -\title{Stop statement "If not in colnames" with colnames} -\usage{ -if_not_in_stop(.tbl, cols, df, arg = NULL) -} -\arguments{ -\item{.tbl}{A tibble} - -\item{cols}{A vector of column names (quoted)} - -\item{df}{Provide the tibble name as a character string} - -\item{arg}{Default to NULL.} -} -\value{ -A stop statement -} -\description{ -Stop statement "If not in colnames" with colnames -} diff --git a/man/if_vec_not_in_stop.Rd b/man/if_vec_not_in_stop.Rd deleted file mode 100644 index 56d228f..0000000 --- a/man/if_vec_not_in_stop.Rd +++ /dev/null @@ -1,23 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/internals.R -\name{if_vec_not_in_stop} -\alias{if_vec_not_in_stop} -\title{Stop statement "If not in vector"} -\usage{ -if_vec_not_in_stop(vec, cols, vec_name, arg = NULL) -} -\arguments{ -\item{vec}{A vector of character strings} - -\item{cols}{A set of character strings} - -\item{vec_name}{Provide the vector name as a character string} - -\item{arg}{Default to NULL.} -} -\value{ -A stop statement if some elements of vec are not in cols -} -\description{ -Stop statement "If not in vector" -} diff --git a/man/indicator_admin1.Rd b/man/indicator_admin1.Rd deleted file mode 100644 index 673ee1b..0000000 --- a/man/indicator_admin1.Rd +++ /dev/null @@ -1,29 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{indicator_admin1} -\alias{indicator_admin1} -\title{Indicator admin 1 polygons shapefile.} -\format{ -A sf multipoint object with 10 features and 10 fields: -\describe{ - \item{ADM1_PC}{Admin 1 postal code.} - \item{admin1}{Admin 1 unique id.} - \item{opn_dfc}{Proportion of HHs that reported open defecation as sanitation facility.} - \item{ADM1_EN}{Full name in English.} - \item{ADM1_FR}{Full name in French.} - \item{ADM1_HT}{Full name in Haitian Creole.} - \item{ADM0_EN}{Country name in English.} - \item{ADM0_FR}{Country name in French.} - \item{ADM0_HT}{Country name in Haitian Creole.} - \item{ADM0_PC}{Country postal code.} - \item{geometry}{Multipolygon geometry.} -} -} -\usage{ -indicator_admin1 -} -\description{ -A multipolygon shapefile of Haiti's admin 1 with an indicator column 'opn_dfc'. -} -\keyword{datasets} diff --git a/man/line_admin1.Rd b/man/line_admin1.Rd deleted file mode 100644 index 49f72e4..0000000 --- a/man/line_admin1.Rd +++ /dev/null @@ -1,26 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/data.R -\docType{data} -\name{line_admin1} -\alias{line_admin1} -\title{Haïti admin 1 lines shapefile.} -\format{ -A sf multiline object with 10 features and 8 fields: -\describe{ - \item{ADM1_EN}{Full name in English.} - \item{ADM1_FR}{Full name in French.} - \item{ADM1_HT}{Full name in Haitian Creole.} - \item{ADM0_EN}{Country name in English.} - \item{ADM0_FR}{Country name in French.} - \item{ADM0_HT}{Country name in Haitian Creole.} - \item{ADM0_PCODE}{Country postal code.} - \item{geometry}{Multiline geometry.} -} -} -\usage{ -line_admin1 -} -\description{ -A multiline shapefile of Haiti's admin 1. -} -\keyword{datasets} diff --git a/man/lollipop.Rd b/man/lollipop.Rd deleted file mode 100644 index 6bc23ef..0000000 --- a/man/lollipop.Rd +++ /dev/null @@ -1,88 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/lollipop.R -\name{lollipop} -\alias{lollipop} -\title{Simple bar chart} -\usage{ -lollipop( - df, - x, - y, - flip = TRUE, - wrap = NULL, - arrange = TRUE, - point_size = 3, - point_color = cols_reach("main_red"), - point_alpha = 1, - segment_size = 1, - segment_color = cols_reach("main_grey"), - segment_alpha = 1, - alpha = 1, - x_title = NULL, - y_title = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - add_text = FALSE, - add_text_size = 3, - add_text_suffix = "", - add_text_color = "white", - add_text_fontface = "bold", - theme = theme_reach() -) -} -\arguments{ -\item{df}{A data frame.} - -\item{x}{A numeric column.} - -\item{y}{A character column or coercible as a character column.} - -\item{flip}{TRUE or FALSE. Default to TRUE or horizontal lollipop plot.} - -\item{wrap}{Should x-labels be wrapped? Number of characters.} - -\item{arrange}{TRUE or FALSE. Arrange by highest percentage first.} - -\item{point_size}{Point size.} - -\item{point_color}{Point color.} - -\item{point_alpha}{Point alpha.} - -\item{segment_size}{Segment size.} - -\item{segment_color}{Segment color.} - -\item{segment_alpha}{Segment alpha.} - -\item{alpha}{Fill transparency.} - -\item{x_title}{The x scale title. Default to NULL.} - -\item{y_title}{The y scale title. Default to NULL.} - -\item{title}{Plot title. Default to NULL.} - -\item{subtitle}{Plot subtitle. Default to NULL.} - -\item{caption}{Plot caption. Default to NULL.} - -\item{add_text}{TRUE or FALSE. Add the y value as text within the bubble.} - -\item{add_text_size}{Text size.} - -\item{add_text_suffix}{If percent is FALSE, should we add a suffix to the text label?} - -\item{add_text_color}{Added text color. Default to white.} - -\item{add_text_fontface}{Added text font face. Default to "bold".} - -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A bar chart -} -\description{ -Simple bar chart -} diff --git a/man/pal_agora.Rd b/man/pal_agora.Rd deleted file mode 100644 index 71b9921..0000000 --- a/man/pal_agora.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pal_agora.R -\name{pal_agora} -\alias{pal_agora} -\title{Return function to interpolate an AGORA color palette} -\usage{ -pal_agora( - palette = "main", - reverse = FALSE, - color_ramp_palette = FALSE, - show_palettes = FALSE, - ... -) -} -\arguments{ -\item{palette}{Character name of a palette in AGORA palettes} - -\item{reverse}{Boolean indicating whether the palette should be reversed} - -\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`} - -\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`} - -\item{...}{Additional arguments to pass to colorRampPalette()} -} -\value{ -A color palette -} -\description{ -Return function to interpolate an AGORA color palette -} diff --git a/man/pal_fallback.Rd b/man/pal_fallback.Rd deleted file mode 100644 index 6716ae5..0000000 --- a/man/pal_fallback.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pal_fallback.R -\name{pal_fallback} -\alias{pal_fallback} -\title{Return function to interpolate a fallback palette base on viridis::magma()} -\usage{ -pal_fallback( - reverse = FALSE, - color_ramp_palette = FALSE, - discrete = FALSE, - n = 5, - ... -) -} -\arguments{ -\item{reverse}{Boolean indicating whether the palette should be reversed} - -\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the latter with `FALSE`} - -\item{discrete}{Boolean. Discrete or not? Default to FALSE.} - -\item{n}{Number of colors in the palette. Default to 5. Passe to `viridis::magma()`} - -\item{...}{Other parameters to pass to `grDevices::colorRampPalette()`} -} -\value{ -A color palette -} -\description{ -Return function to interpolate a fallback palette base on viridis::magma() -} diff --git a/man/pal_impact.Rd b/man/pal_impact.Rd deleted file mode 100644 index a3a16a2..0000000 --- a/man/pal_impact.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pal_impact.R -\name{pal_impact} -\alias{pal_impact} -\title{Return function to interpolate an IMPACT color palette} -\usage{ -pal_impact( - palette = "main", - reverse = FALSE, - color_ramp_palette = FALSE, - show_palettes = FALSE, - ... -) -} -\arguments{ -\item{palette}{Character name of a palette in IMPACT palettes} - -\item{reverse}{Boolean indicating whether the palette should be reversed} - -\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`} - -\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`} - -\item{...}{Additional arguments to pass to colorRampPalette()} -} -\value{ -A color palette -} -\description{ -Return function to interpolate an IMPACT color palette -} diff --git a/man/pal_reach.Rd b/man/pal_reach.Rd deleted file mode 100644 index 4d32f98..0000000 --- a/man/pal_reach.Rd +++ /dev/null @@ -1,31 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/pal_reach.R -\name{pal_reach} -\alias{pal_reach} -\title{Return function to interpolate a REACH color palette} -\usage{ -pal_reach( - palette = "main", - reverse = FALSE, - color_ramp_palette = FALSE, - show_palettes = FALSE, - ... -) -} -\arguments{ -\item{palette}{Character name of a palette in REACH palettes} - -\item{reverse}{Boolean indicating whether the palette should be reversed} - -\item{color_ramp_palette}{Should the output be a `grDevices::colorRampPalette` function or a vector of hex codes? Default to the former with `TRUE`} - -\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`} - -\item{...}{Additional arguments to pass to colorRampPalette()} -} -\value{ -A color palette -} -\description{ -Return function to interpolate a REACH color palette -} diff --git a/man/palette.Rd b/man/palette.Rd new file mode 100644 index 0000000..c17f4b5 --- /dev/null +++ b/man/palette.Rd @@ -0,0 +1,23 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/palette.R +\name{palette} +\alias{palette} +\title{Interpolate a color palette} +\usage{ +palette(palette = "cat_5_main", reverse = FALSE, show_palettes = FALSE, ...) +} +\arguments{ +\item{palette}{Character name of a palette in palettes} + +\item{reverse}{Boolean indicating whether the palette should be reversed} + +\item{show_palettes}{Should the ouput be the set of palettes names to pick from? Default to `FALSE`} + +\item{...}{Additional arguments to pass to colorRampPalette()} +} +\value{ +A color palette +} +\description{ +Interpolate a color palette +} diff --git a/man/palette_gen.Rd b/man/palette_gen.Rd new file mode 100644 index 0000000..1fe26c3 --- /dev/null +++ b/man/palette_gen.Rd @@ -0,0 +1,26 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/palette_gen.R +\name{palette_gen} +\alias{palette_gen} +\alias{palette_gen_categorical} +\alias{palette_gen_sequential} +\title{Generate color palettes} +\usage{ +palette_gen(palette, type, direction = 1, ...) + +palette_gen_categorical(palette = "cat_5_main", direction = 1) + +palette_gen_sequential(palette = "cat_5_main", direction = 1, ...) +} +\arguments{ +\item{palette}{Palette name from [palette()].} + +\item{type}{"categorical" or "sequential" or "divergent".} + +\item{direction}{1 or -1; should the order of colors be reversed?} + +\item{...}{Additional arguments to pass to [colorRampPalette()] when type is "continuous".} +} +\description{ +[palette_gen()] generates a color palette and let you choose whether continuous or discrete. [palette_gen_categorical()] and [palette_gen_sequential()] generates respectively discrete and continuous palettes. +} diff --git a/man/point.Rd b/man/point.Rd index fd2d5d0..9392c2a 100644 --- a/man/point.Rd +++ b/man/point.Rd @@ -2,35 +2,61 @@ % Please edit documentation in R/point.R \name{point} \alias{point} -\title{Simple point chart} +\title{Simple scatterplot} \usage{ point( df, x, y, - group = NULL, + group = "", + facet = "", + facet_scales = "free", + x_rm_na = TRUE, + y_rm_na = TRUE, + group_rm_na = TRUE, + facet_rm_na = TRUE, + add_color = color("cat_5_main_1"), + add_color_guide = TRUE, flip = TRUE, alpha = 1, - size = 1, + size = 2, x_title = NULL, y_title = NULL, group_title = NULL, title = NULL, subtitle = NULL, caption = NULL, - theme = theme_reach() + theme_fun = theme_point(), + scale_fill_fun = scale_fill_visualizer_discrete(), + scale_color_fun = scale_color_visualizer_discrete() ) } \arguments{ \item{df}{A data frame.} -\item{x}{A numeric column.} +\item{x}{A quoted numeric column.} -\item{y}{A character column or coercible as a character column.} +\item{y}{A quoted numeric column.} -\item{group}{Some grouping categorical column, e.g. administrative areas or population groups.} +\item{group}{Some quoted grouping categorical column, e.g. administrative areas or population groups.} -\item{flip}{TRUE or FALSE. Default to TRUE or horizontal bar plot.} +\item{facet}{Some quoted grouping categorical column.} + +\item{facet_scales}{Character. Either "free" (default) or "fixed" for facet scales.} + +\item{x_rm_na}{Remove NAs in x?} + +\item{y_rm_na}{Remove NAs in y?} + +\item{group_rm_na}{Remove NAs in group?} + +\item{facet_rm_na}{Remove NAs in facet?} + +\item{add_color}{Add a color to points (if no grouping).} + +\item{add_color_guide}{Should a legend be added?} + +\item{flip}{TRUE or FALSE.} \item{alpha}{Fill transparency.} @@ -48,11 +74,8 @@ point( \item{caption}{Plot caption. Default to NULL.} -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A bar chart +\item{theme_fun}{Whatever theme. Default to theme_point(). NULL if no theming needed.} } \description{ -Simple point chart +Simple scatterplot } diff --git a/man/reorder_by.Rd b/man/reorder_by.Rd new file mode 100644 index 0000000..aed3c01 --- /dev/null +++ b/man/reorder_by.Rd @@ -0,0 +1,42 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/reorder_by.R +\name{reorder_by} +\alias{reorder_by} +\title{Reorder a Data Frame} +\usage{ +reorder_by(df, x, y, group = "", order = "y", dir_order = 1) +} +\arguments{ +\item{df}{A data frame to be reordered.} + +\item{x}{A character scalar specifying the column to be reordered.} + +\item{y}{A character scalar specifying the column to order by if ordering by values.} + +\item{group}{A character scalar specifying the grouping column (optional).} + +\item{order}{A character scalar specifying the order type (one of "none", "y", "grouped"). See details.} + +\item{dir_order}{A logical scalar specifying whether to flip the order.} +} +\value{ +The reordered data frame. +} +\description{ +Reorder a Data Frame +} +\details{ +Ordering takes the following possible values: + +* "none": No reordering. +* "y": Order by values of y. +* "grouped_y": Order by values of y and group. +* "x": Order alphabetically by x. +* "grouped_x": Order alphabetically by x and group. +} +\examples{ +# Example usage +df <- data.frame(col1 = c("b", "a", "c"), col2 = c(10, 25, 3)) +reorder_by(df, "col1", "col2") + +} diff --git a/man/scale_color.Rd b/man/scale_color.Rd deleted file mode 100644 index ab17204..0000000 --- a/man/scale_color.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scale.R -\name{scale_color} -\alias{scale_color} -\title{Color scale constructor for REACH or AGORA colors} -\usage{ -scale_color( - initiative = "reach", - palette = "main", - discrete = TRUE, - reverse = FALSE, - reverse_guide = TRUE, - ... -) -} -\arguments{ -\item{initiative}{Either "reach" or "agora" or "default".} - -\item{palette}{Palette name from `pal_reach()` or `pal_agora()`.} - -\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} - -\item{reverse}{Boolean indicating whether the palette should be reversed.} - -\item{reverse_guide}{Boolean indicating whether the guide should be reversed.} - -\item{...}{Additional arguments passed to discrete_scale() or -scale_fill_gradient(), used respectively when discrete is TRUE or FALSE.} -} -\value{ -A color scale for ggplot -} -\description{ -Color scale constructor for REACH or AGORA colors -} diff --git a/man/scale_color_visualizer_discrete.Rd b/man/scale_color_visualizer_discrete.Rd new file mode 100644 index 0000000..da8b0d9 --- /dev/null +++ b/man/scale_color_visualizer_discrete.Rd @@ -0,0 +1,53 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/scale.R +\name{scale_color_visualizer_discrete} +\alias{scale_color_visualizer_discrete} +\alias{scale_fill_visualizer_discrete} +\alias{scale_fill_visualizer_continuous} +\alias{scale_color_visualizer_continuous} +\title{Scale constructors for fill and colors} +\usage{ +scale_color_visualizer_discrete( + palette = "cat_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) + +scale_fill_visualizer_discrete( + palette = "cat_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) + +scale_fill_visualizer_continuous( + palette = "seq_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) + +scale_color_visualizer_continuous( + palette = "seq_5_main", + direction = 1, + reverse_guide = TRUE, + title_position = NULL, + ... +) +} +\arguments{ +\item{palette}{Palette name from [palette()].} + +\item{direction}{1 or -1; should the order of colors be reversed?} + +\item{reverse_guide}{Boolean indicating whether the guide should be reversed.} + +\item{...}{Additional arguments passed to [ggplot2::discrete_scale()] if discrete or [ggplot2::scale_fill_gradient()] if continuous.} +} +\description{ +This function is based on [palette()]. If palette is NULL, the used palette will be magma from gpplot2's viridis scale constructors. +} diff --git a/man/scale_fill.Rd b/man/scale_fill.Rd deleted file mode 100644 index 95d3dc3..0000000 --- a/man/scale_fill.Rd +++ /dev/null @@ -1,35 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/scale.R -\name{scale_fill} -\alias{scale_fill} -\title{Fill scale constructor for REACH or AGORA colors} -\usage{ -scale_fill( - initiative = "reach", - palette = "main", - discrete = TRUE, - reverse = FALSE, - reverse_guide = TRUE, - ... -) -} -\arguments{ -\item{initiative}{Either "reach" or "agora" or "default".} - -\item{palette}{Palette name from `pal_reach()` or `pal_agora()`.} - -\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} - -\item{reverse}{Boolean indicating whether the palette should be reversed.} - -\item{reverse_guide}{Boolean indicating whether the guide should be reversed.} - -\item{...}{Additional arguments passed to discrete_scale() or -scale_fill_gradient(), used respectively when discrete is TRUE or FALSE.} -} -\value{ -A fill scale for ggplot. -} -\description{ -Fill scale constructor for REACH or AGORA colors -} diff --git a/man/subvec_not_in.Rd b/man/subvec_not_in.Rd deleted file mode 100644 index 90d4d58..0000000 --- a/man/subvec_not_in.Rd +++ /dev/null @@ -1,19 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/internals.R -\name{subvec_not_in} -\alias{subvec_not_in} -\title{Subvec not in} -\usage{ -subvec_not_in(vector, set) -} -\arguments{ -\item{vector}{A vector to subset} - -\item{set}{A set-vector} -} -\value{ -A subset of vector not in set -} -\description{ -Subvec not in -} diff --git a/man/theme_reach.Rd b/man/theme_default.Rd similarity index 55% rename from man/theme_reach.Rd rename to man/theme_default.Rd index 8718dc6..22a672d 100644 --- a/man/theme_reach.Rd +++ b/man/theme_default.Rd @@ -1,70 +1,107 @@ % Generated by roxygen2: do not edit by hand -% Please edit documentation in R/theme_reach.R -\name{theme_reach} -\alias{theme_reach} -\title{ggplot2 theme with REACH color palettes} +% Please edit documentation in R/theme_bar.R, R/theme_default.R, +% R/theme_dumbbell.R, R/theme_point.R +\name{theme_bar} +\alias{theme_bar} +\alias{theme_default} +\alias{theme_dumbbell} +\alias{theme_point} +\title{Custom Theme for Bar Charts} \usage{ -theme_reach( - initiative = "reach", - palette = "main", - discrete = TRUE, - reverse = FALSE, - font_family = "Segoe UI", - title_size = 12, - title_color = cols_reach("main_grey"), +theme_bar( + flip = TRUE, + add_text = FALSE, + axis_text_x_angle = 0, + axis_text_x_vjust = 0.5, + axis_text_x_hjust = 0.5 +) + +theme_default( + title_font_family = "Carlito", + title_size = 16, + title_color = color("dark_grey"), title_font_face = "bold", title_hjust = NULL, title_position_to_plot = TRUE, - text_size = 10, - text_color = cols_reach("main_grey"), + subtitle_font_family = "Carlito", + subtitle_size = 15, + subtitle_color = color("dark_grey"), + subtitle_font_face = "plain", + subtitle_hjust = NULL, + text_font_family = "Carlito", + text_size = 13, + text_color = color("dark_grey"), text_font_face = "plain", panel_background_color = "#FFFFFF", panel_border = FALSE, - panel_border_color = cols_reach("main_grey"), - legend_position = "right", - legend_direction = "vertical", + panel_border_color = color("dark_grey"), + legend_position = "top", + legend_direction = "horizontal", + legend_justification = "center", legend_reverse = TRUE, - legend_title_size = 11, - legend_title_color = cols_reach("main_grey"), + legend_title_size = 13, + legend_title_color = color("dark_grey"), legend_title_font_face = "plain", - legend_text_size = 10, - legend_text_color = cols_reach("main_grey"), + legend_title_font_family = "Carlito", + legend_text_size = 13, + legend_text_color = color("dark_grey"), legend_text_font_face = "plain", + legend_text_font_family = "Carlito", + facet_size = 14, + facet_color = color("dark_grey"), + facet_font_face = "bold", + facet_font_family = "Carlito", + facet_bg_color = color("lighter_grey"), axis_x = TRUE, axis_y = TRUE, - axis_text_size = 10, - axis_text_color = cols_reach("main_grey"), + axis_text_x = TRUE, + axis_line_x = FALSE, + axis_ticks_x = FALSE, + axis_text_y = TRUE, + axis_line_y = TRUE, + axis_ticks_y = TRUE, + axis_text_font_family = "Carlito", + axis_text_size = 13, + axis_text_color = color("dark_grey"), axis_text_font_face = "plain", - axis_title_size = 11, - axis_title_color = cols_reach("main_grey"), - axis_title_font_face = "bold", + axis_title_size = 15, + axis_title_color = color("dark_grey"), + axis_title_font_face = "plain", axis_text_x_angle = 0, axis_text_x_vjust = 0.5, axis_text_x_hjust = 0.5, - grid_major_x = FALSE, + grid_major_x = TRUE, grid_major_y = FALSE, - grid_major_color = cols_reach("main_lt_grey"), + grid_major_color = color("dark_grey"), grid_major_x_size = 0.1, grid_major_y_size = 0.1, - grid_minor_x = FALSE, + grid_minor_x = TRUE, grid_minor_y = FALSE, - grid_minor_color = cols_reach("main_lt_grey"), + grid_minor_color = color("dark_grey"), grid_minor_x_size = 0.05, grid_minor_y_size = 0.05, + caption_font_family = "Carlito", + caption_font_face = "plain", caption_position_to_plot = TRUE, + caption_size = 11, + caption_color = color("dark_grey"), ... ) + +theme_dumbbell() + +theme_point() } \arguments{ -\item{initiative}{Either "reach" or "default".} +\item{flip}{Logical. Whether the plot is flipped (horizonal).} -\item{palette}{Palette name from 'pal_reach()'.} +\item{axis_text_x_angle}{Angle for x-axis text.} -\item{discrete}{Boolean indicating whether color aesthetic is discrete or not.} +\item{axis_text_x_vjust}{Vertical justification for x-axis text.} -\item{reverse}{Boolean indicating whether the palette should be reversed.} +\item{axis_text_x_hjust}{Horizontal justification for x-axis text.} -\item{font_family}{The font family for all plot's texts. Default to "Segoe UI".} +\item{title_font_family}{Title font family. Default to "Roboto Condensed".} \item{title_size}{The size of the legend title. Defaults to 11.} @@ -92,6 +129,8 @@ theme_reach( \item{legend_direction}{Direction of the legend. Default to "vertical". Can take "vertical" or "horizontal".} +\item{legend_justification}{In addition to legend_direction, place the legend. Can take "left", "bottom", "center", "right", "top".} + \item{legend_reverse}{Reverse the color in the guide? Default to TRUE.} \item{legend_title_size}{Legend title size.} @@ -110,6 +149,18 @@ theme_reach( \item{axis_y}{Boolean. Do you need y-axis?} +\item{axis_text_x}{Boolean. Do you need the text for the x-axis?} + +\item{axis_line_x}{Boolean. Do you need the line for the x-axis?} + +\item{axis_ticks_x}{Boolean. Do you need the line for the x-axis?} + +\item{axis_text_y}{Boolean. Do you need the text for the y-axis?} + +\item{axis_line_y}{Boolean. Do you need the line for the y-axis?} + +\item{axis_ticks_y}{Boolean. Do you need the line for the y-axis?} + \item{axis_text_size}{Axis text size.} \item{axis_text_color}{Axis text color.} @@ -122,12 +173,6 @@ theme_reach( \item{axis_title_font_face}{Axis title font face. Default to "plain". Font face ("plain", "italic", "bold", "bold.italic").} -\item{axis_text_x_angle}{Angle for the x-axis text.} - -\item{axis_text_x_vjust}{Vertical adjustment for the x-axis text.} - -\item{axis_text_x_hjust}{Vertical adjustment for the x-axis text.} - \item{grid_major_x}{Boolean. Do you need major grid lines for x-axis?} \item{grid_major_y}{Boolean. Do you need major grid lines for y-axis?} @@ -150,11 +195,17 @@ theme_reach( \item{caption_position_to_plot}{TRUE or FALSE. Positioning to plot or to panel?} -\item{...}{Additional arguments passed to `ggplot2::gg_theme()`.} +\item{...}{Additional arguments passed to [ggplot2::theme()].} + +\item{font_family}{The font family for all plot's texts. Default to "Segoe UI".} } \value{ -The base REACH theme +A custom theme object. + +A custom theme object. } \description{ Give some reach colors and fonts to a ggplot. + +Theme for dumbbell charts based on theme_default. } diff --git a/man/waffle.Rd b/man/waffle.Rd deleted file mode 100644 index a46d9aa..0000000 --- a/man/waffle.Rd +++ /dev/null @@ -1,53 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/waffle.R -\name{waffle} -\alias{waffle} -\title{Simple waffle chart} -\usage{ -waffle( - df, - x, - y, - n_rows = 10, - size = 2, - x_title = NULL, - x_lab = NULL, - title = NULL, - subtitle = NULL, - caption = NULL, - arrange = TRUE, - theme = theme_reach(axis_x = FALSE, axis_y = FALSE, legend_position = "bottom", - legend_direction = "horizontal", title_hjust = 0.5) -) -} -\arguments{ -\item{df}{A data frame.} - -\item{x}{A character column or coercible as a character column. Will give the waffle's fill color.} - -\item{y}{A numeric column (if plotting proportion, make sure to have percentages between 0 and 100 and not 0 and 1).} - -\item{n_rows}{Number of rows. Default to 10.} - -\item{size}{Width of the separator between blocks (defaults to 2).} - -\item{x_title}{The x scale title. Default to NULL.} - -\item{x_lab}{The x scale caption. Default to NULL.} - -\item{title}{Plot title. Default to NULL.} - -\item{subtitle}{Plot subtitle. Default to NULL.} - -\item{caption}{Plot caption. Default to NULL.} - -\item{arrange}{TRUE or FALSE. Arrange by highest percentage first.} - -\item{theme}{Whatever theme. Default to theme_reach().} -} -\value{ -A waffle chart -} -\description{ -Simple waffle chart -} diff --git a/renv.lock b/renv.lock new file mode 100644 index 0000000..5479592 --- /dev/null +++ b/renv.lock @@ -0,0 +1,4788 @@ +{ + "R": { + "Version": "4.5.1", + "Repositories": [ + { + "Name": "CRAN", + "URL": "https://p3m.dev/cran/latest" + } + ] + }, + "Packages": { + "DT": { + "Package": "DT", + "Version": "0.33", + "Source": "Repository", + "Type": "Package", + "Title": "A Wrapper of the JavaScript Library 'DataTables'", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = \"aut\"), person(\"Joe\", \"Cheng\", email = \"joe@posit.co\", role = c(\"aut\", \"cre\")), person(\"Xianying\", \"Tan\", role = \"aut\"), person(\"JJ\", \"Allaire\", role = \"ctb\"), person(\"Maximilian\", \"Girlich\", role = \"ctb\"), person(\"Greg\", \"Freedman Ellis\", role = \"ctb\"), person(\"Johannes\", \"Rauh\", role = \"ctb\"), person(\"SpryMedia Limited\", role = c(\"ctb\", \"cph\"), comment = \"DataTables in htmlwidgets/lib\"), person(\"Brian\", \"Reavis\", role = c(\"ctb\", \"cph\"), comment = \"selectize.js in htmlwidgets/lib\"), person(\"Leon\", \"Gersen\", role = c(\"ctb\", \"cph\"), comment = \"noUiSlider in htmlwidgets/lib\"), person(\"Bartek\", \"Szopka\", role = c(\"ctb\", \"cph\"), comment = \"jquery.highlight.js in htmlwidgets/lib\"), person(\"Alex\", \"Pickering\", role = c(\"ctb\")), person(\"William\", \"Holmes\", role = c(\"ctb\")), person(\"Mikko\", \"Marttila\", role = c(\"ctb\")), person(\"Andres\", \"Quintero\", role = c(\"ctb\")), person(\"Stéphane\", \"Laurent\", role = c(\"ctb\")), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Data objects in R can be rendered as HTML tables using the JavaScript library 'DataTables' (typically via R Markdown or Shiny). The 'DataTables' library has been included in this R package. The package name 'DT' is an abbreviation of 'DataTables'.", + "URL": "https://github.com/rstudio/DT", + "BugReports": "https://github.com/rstudio/DT/issues", + "License": "GPL-3 | file LICENSE", + "Imports": [ + "htmltools (>= 0.3.6)", + "htmlwidgets (>= 1.3)", + "httpuv", + "jsonlite (>= 0.9.16)", + "magrittr", + "crosstalk", + "jquerylib", + "promises" + ], + "Suggests": [ + "knitr (>= 1.8)", + "rmarkdown", + "shiny (>= 1.6)", + "bslib", + "future", + "testit", + "tibble" + ], + "VignetteBuilder": "knitr", + "RoxygenNote": "7.3.1", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut], Joe Cheng [aut, cre], Xianying Tan [aut], JJ Allaire [ctb], Maximilian Girlich [ctb], Greg Freedman Ellis [ctb], Johannes Rauh [ctb], SpryMedia Limited [ctb, cph] (DataTables in htmlwidgets/lib), Brian Reavis [ctb, cph] (selectize.js in htmlwidgets/lib), Leon Gersen [ctb, cph] (noUiSlider in htmlwidgets/lib), Bartek Szopka [ctb, cph] (jquery.highlight.js in htmlwidgets/lib), Alex Pickering [ctb], William Holmes [ctb], Mikko Marttila [ctb], Andres Quintero [ctb], Stéphane Laurent [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Joe Cheng ", + "Repository": "https://p3m.dev/cran/latest" + }, + "MASS": { + "Package": "MASS", + "Version": "7.3-65", + "Source": "Repository", + "Priority": "recommended", + "Date": "2025-02-19", + "Revision": "$Rev: 3681 $", + "Depends": [ + "R (>= 4.4.0)", + "grDevices", + "graphics", + "stats", + "utils" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "lattice", + "nlme", + "nnet", + "survival" + ], + "Authors@R": "c(person(\"Brian\", \"Ripley\", role = c(\"aut\", \"cre\", \"cph\"), email = \"Brian.Ripley@R-project.org\"), person(\"Bill\", \"Venables\", role = c(\"aut\", \"cph\")), person(c(\"Douglas\", \"M.\"), \"Bates\", role = \"ctb\"), person(\"Kurt\", \"Hornik\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"Albrecht\", \"Gebhardt\", role = \"trl\", comment = \"partial port ca 1998\"), person(\"David\", \"Firth\", role = \"ctb\", comment = \"support functions for polr\"))", + "Description": "Functions and datasets to support Venables and Ripley, \"Modern Applied Statistics with S\" (4th edition, 2002).", + "Title": "Support Functions and Datasets for Venables and Ripley's MASS", + "LazyData": "yes", + "ByteCompile": "yes", + "License": "GPL-2 | GPL-3", + "URL": "http://www.stats.ox.ac.uk/pub/MASS4/", + "Contact": "", + "NeedsCompilation": "yes", + "Author": "Brian Ripley [aut, cre, cph], Bill Venables [aut, cph], Douglas M. Bates [ctb], Kurt Hornik [trl] (partial port ca 1998), Albrecht Gebhardt [trl] (partial port ca 1998), David Firth [ctb] (support functions for polr)", + "Maintainer": "Brian Ripley ", + "Repository": "CRAN" + }, + "Matrix": { + "Package": "Matrix", + "Version": "1.7-3", + "Source": "Repository", + "VersionNote": "do also bump src/version.h, inst/include/Matrix/version.h", + "Date": "2025-03-05", + "Priority": "recommended", + "Title": "Sparse and Dense Matrix Classes and Methods", + "Description": "A rich hierarchy of sparse and dense matrix classes, including general, symmetric, triangular, and diagonal matrices with numeric, logical, or pattern entries. Efficient methods for operating on such matrices, often wrapping the 'BLAS', 'LAPACK', and 'SuiteSparse' libraries.", + "License": "GPL (>= 2) | file LICENCE", + "URL": "https://Matrix.R-forge.R-project.org", + "BugReports": "https://R-forge.R-project.org/tracker/?atid=294&group_id=61", + "Contact": "Matrix-authors@R-project.org", + "Authors@R": "c(person(\"Douglas\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"Martin\", \"Maechler\", role = c(\"aut\", \"cre\"), email = \"mmaechler+Matrix@gmail.com\", comment = c(ORCID = \"0000-0002-8685-9910\")), person(\"Mikael\", \"Jagan\", role = \"aut\", comment = c(ORCID = \"0000-0002-3542-2938\")), person(\"Timothy A.\", \"Davis\", role = \"ctb\", comment = c(ORCID = \"0000-0001-7614-6899\", \"SuiteSparse libraries\", \"collaborators listed in dir(system.file(\\\"doc\\\", \\\"SuiteSparse\\\", package=\\\"Matrix\\\"), pattern=\\\"License\\\", full.names=TRUE, recursive=TRUE)\")), person(\"George\", \"Karypis\", role = \"ctb\", comment = c(ORCID = \"0000-0003-2753-1437\", \"METIS library\", \"Copyright: Regents of the University of Minnesota\")), person(\"Jason\", \"Riedy\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4345-4200\", \"GNU Octave's condest() and onenormest()\", \"Copyright: Regents of the University of California\")), person(\"Jens\", \"Oehlschlägel\", role = \"ctb\", comment = \"initial nearPD()\"), person(\"R Core Team\", role = \"ctb\", comment = c(ROR = \"02zz1nj61\", \"base R's matrix implementation\")))", + "Depends": [ + "R (>= 4.4)", + "methods" + ], + "Imports": [ + "grDevices", + "graphics", + "grid", + "lattice", + "stats", + "utils" + ], + "Suggests": [ + "MASS", + "datasets", + "sfsmisc", + "tools" + ], + "Enhances": [ + "SparseM", + "graph" + ], + "LazyData": "no", + "LazyDataNote": "not possible, since we use data/*.R and our S4 classes", + "BuildResaveData": "no", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Douglas Bates [aut] (), Martin Maechler [aut, cre] (), Mikael Jagan [aut] (), Timothy A. Davis [ctb] (, SuiteSparse libraries, collaborators listed in dir(system.file(\"doc\", \"SuiteSparse\", package=\"Matrix\"), pattern=\"License\", full.names=TRUE, recursive=TRUE)), George Karypis [ctb] (, METIS library, Copyright: Regents of the University of Minnesota), Jason Riedy [ctb] (, GNU Octave's condest() and onenormest(), Copyright: Regents of the University of California), Jens Oehlschlägel [ctb] (initial nearPD()), R Core Team [ctb] (02zz1nj61, base R's matrix implementation)", + "Maintainer": "Martin Maechler ", + "Repository": "CRAN" + }, + "R.methodsS3": { + "Package": "R.methodsS3", + "Version": "1.8.2", + "Source": "Repository", + "Depends": [ + "R (>= 2.13.0)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "codetools" + ], + "Title": "S3 Methods Simplified", + "Authors@R": "c(person(\"Henrik\", \"Bengtsson\", role=c(\"aut\", \"cre\", \"cph\"), email = \"henrikb@braju.com\"))", + "Author": "Henrik Bengtsson [aut, cre, cph]", + "Maintainer": "Henrik Bengtsson ", + "Description": "Methods that simplify the setup of S3 generic functions and S3 methods. Major effort has been made in making definition of methods as simple as possible with a minimum of maintenance for package developers. For example, generic functions are created automatically, if missing, and naming conflict are automatically solved, if possible. The method setMethodS3() is a good start for those who in the future may want to migrate to S4. This is a cross-platform package implemented in pure R that generates standard S3 methods.", + "License": "LGPL (>= 2.1)", + "LazyLoad": "TRUE", + "URL": "https://github.com/HenrikBengtsson/R.methodsS3", + "BugReports": "https://github.com/HenrikBengtsson/R.methodsS3/issues", + "NeedsCompilation": "no", + "Repository": "CRAN", + "Encoding": "UTF-8" + }, + "R.oo": { + "Package": "R.oo", + "Version": "1.27.1", + "Source": "Repository", + "Depends": [ + "R (>= 2.13.0)", + "R.methodsS3 (>= 1.8.2)" + ], + "Imports": [ + "methods", + "utils" + ], + "Suggests": [ + "tools" + ], + "Title": "R Object-Oriented Programming with or without References", + "Authors@R": "c(person(\"Henrik\", \"Bengtsson\", role=c(\"aut\", \"cre\", \"cph\"), email = \"henrikb@braju.com\"))", + "Author": "Henrik Bengtsson [aut, cre, cph]", + "Maintainer": "Henrik Bengtsson ", + "Description": "Methods and classes for object-oriented programming in R with or without references. Large effort has been made on making definition of methods as simple as possible with a minimum of maintenance for package developers. The package has been developed since 2001 and is now considered very stable. This is a cross-platform package implemented in pure R that defines standard S3 classes without any tricks.", + "License": "LGPL (>= 2.1)", + "LazyLoad": "TRUE", + "URL": "https://henrikbengtsson.github.io/R.oo/, https://github.com/HenrikBengtsson/R.oo", + "BugReports": "https://github.com/HenrikBengtsson/R.oo/issues", + "NeedsCompilation": "no", + "Repository": "CRAN", + "Encoding": "UTF-8" + }, + "R.utils": { + "Package": "R.utils", + "Version": "2.13.0", + "Source": "Repository", + "Depends": [ + "R (>= 2.14.0)", + "R.oo" + ], + "Imports": [ + "methods", + "utils", + "tools", + "R.methodsS3" + ], + "Suggests": [ + "datasets", + "digest (>= 0.6.10)" + ], + "Title": "Various Programming Utilities", + "Authors@R": "c(person(\"Henrik\", \"Bengtsson\", role=c(\"aut\", \"cre\", \"cph\"), email = \"henrikb@braju.com\"))", + "Author": "Henrik Bengtsson [aut, cre, cph]", + "Maintainer": "Henrik Bengtsson ", + "Description": "Utility functions useful when programming and developing R packages.", + "License": "LGPL (>= 2.1)", + "LazyLoad": "TRUE", + "URL": "https://henrikbengtsson.github.io/R.utils/, https://github.com/HenrikBengtsson/R.utils", + "BugReports": "https://github.com/HenrikBengtsson/R.utils/issues", + "NeedsCompilation": "no", + "Repository": "CRAN", + "Encoding": "UTF-8" + }, + "R6": { + "Package": "R6", + "Version": "2.6.1", + "Source": "Repository", + "Title": "Encapsulated Classes with Reference Semantics", + "Authors@R": "c( person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Creates classes with reference semantics, similar to R's built-in reference classes. Compared to reference classes, R6 classes are simpler and lighter-weight, and they are not built on S4 classes so they do not require the methods package. These classes allow public and private members, and they support inheritance, even when the classes are defined in different packages.", + "License": "MIT + file LICENSE", + "URL": "https://r6.r-lib.org, https://github.com/r-lib/R6", + "BugReports": "https://github.com/r-lib/R6/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Suggests": [ + "lobstr", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate, ggplot2, microbenchmark, scales", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Winston Chang ", + "Repository": "RSPM" + }, + "RColorBrewer": { + "Package": "RColorBrewer", + "Version": "1.1-3", + "Source": "Repository", + "Date": "2022-04-03", + "Title": "ColorBrewer Palettes", + "Authors@R": "c(person(given = \"Erich\", family = \"Neuwirth\", role = c(\"aut\", \"cre\"), email = \"erich.neuwirth@univie.ac.at\"))", + "Author": "Erich Neuwirth [aut, cre]", + "Maintainer": "Erich Neuwirth ", + "Depends": [ + "R (>= 2.0.0)" + ], + "Description": "Provides color schemes for maps (and other graphics) designed by Cynthia Brewer as described at http://colorbrewer2.org.", + "License": "Apache License 2.0", + "NeedsCompilation": "no", + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "Rcpp": { + "Package": "Rcpp", + "Version": "1.0.14", + "Source": "Repository", + "Title": "Seamless R and C++ Integration", + "Date": "2025-01-11", + "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Romain\", \"Francois\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"JJ\", \"Allaire\", role = \"aut\", comment = c(ORCID = \"0000-0003-0174-9868\")), person(\"Kevin\", \"Ushey\", role = \"aut\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Qiang\", \"Kou\", role = \"aut\", comment = c(ORCID = \"0000-0001-6786-5453\")), person(\"Nathan\", \"Russell\", role = \"aut\"), person(\"Iñaki\", \"Ucar\", role = \"aut\", comment = c(ORCID = \"0000-0001-6403-5550\")), person(\"Doug\", \"Bates\", role = \"aut\", comment = c(ORCID = \"0000-0001-8316-9503\")), person(\"John\", \"Chambers\", role = \"aut\"))", + "Description": "The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless integration of R and C++. Many R data types and objects can be mapped back and forth to C++ equivalents which facilitates both writing of new code as well as easier integration of third-party libraries. Documentation about 'Rcpp' is provided by several vignettes included in this package, via the 'Rcpp Gallery' site at , the paper by Eddelbuettel and Francois (2011, ), the book by Eddelbuettel (2013, ) and the paper by Eddelbuettel and Balamuta (2018, ); see 'citation(\"Rcpp\")' for details.", + "Imports": [ + "methods", + "utils" + ], + "Suggests": [ + "tinytest", + "inline", + "rbenchmark", + "pkgKitten (>= 0.1.2)" + ], + "URL": "https://www.rcpp.org, https://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp", + "License": "GPL (>= 2)", + "BugReports": "https://github.com/RcppCore/Rcpp/issues", + "MailingList": "rcpp-devel@lists.r-forge.r-project.org", + "RoxygenNote": "6.1.1", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Dirk Eddelbuettel [aut, cre] (), Romain Francois [aut] (), JJ Allaire [aut] (), Kevin Ushey [aut] (), Qiang Kou [aut] (), Nathan Russell [aut], Iñaki Ucar [aut] (), Doug Bates [aut] (), John Chambers [aut]", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "Rttf2pt1": { + "Package": "Rttf2pt1", + "Version": "1.3.12", + "Source": "Repository", + "Title": "'ttf2pt1' Program", + "Author": "Winston Chang, Andrew Weeks, Frank M. Siegert, Mark Heath, Thomas Henlick, Sergey Babkin, Turgut Uyar, Rihardas Hepas, Szalay Tamas, Johan Vromans, Petr Titera, Lei Wang, Chen Xiangyang, Zvezdan Petkovic, Rigel, I. Lee Hetherington", + "Maintainer": "Winston Chang ", + "Description": "Contains the program 'ttf2pt1', for use with the 'extrafont' package. This product includes software developed by the 'TTF2PT1' Project and its contributors.", + "Depends": [ + "R (>= 2.15)" + ], + "License": "file LICENSE", + "URL": "https://github.com/wch/Rttf2pt1", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "License_is_FOSS": "yes", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "askpass": { + "Package": "askpass", + "Version": "1.2.1", + "Source": "Repository", + "Type": "Package", + "Title": "Password Entry Utilities for R, Git, and SSH", + "Authors@R": "person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\"))", + "Description": "Cross-platform utilities for prompting the user for credentials or a passphrase, for example to authenticate with a server or read a protected key. Includes native programs for MacOS and Windows, hence no 'tcltk' is required. Password entry can be invoked in two different ways: directly from R via the askpass() function, or indirectly as password-entry back-end for 'ssh-agent' or 'git-credential' via the SSH_ASKPASS and GIT_ASKPASS environment variables. Thereby the user can be prompted for credentials or a passphrase if needed when R calls out to git or ssh.", + "License": "MIT + file LICENSE", + "URL": "https://r-lib.r-universe.dev/askpass", + "BugReports": "https://github.com/r-lib/askpass/issues", + "Encoding": "UTF-8", + "Imports": [ + "sys (>= 2.1)" + ], + "RoxygenNote": "7.2.3", + "Suggests": [ + "testthat" + ], + "Language": "en-US", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] ()", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "backports": { + "Package": "backports", + "Version": "1.5.0", + "Source": "Repository", + "Type": "Package", + "Title": "Reimplementations of Functions Introduced Since R-3.0.0", + "Authors@R": "c( person(\"Michel\", \"Lang\", NULL, \"michellang@gmail.com\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0001-9754-0393\")), person(\"Duncan\", \"Murdoch\", NULL, \"murdoch.duncan@gmail.com\", role = c(\"aut\")), person(\"R Core Team\", role = \"aut\"))", + "Maintainer": "Michel Lang ", + "Description": "Functions introduced or changed since R v3.0.0 are re-implemented in this package. The backports are conditionally exported in order to let R resolve the function name to either the implemented backport, or the respective base version, if available. Package developers can make use of new functions or arguments by selectively importing specific backports to support older installations.", + "URL": "https://github.com/r-lib/backports", + "BugReports": "https://github.com/r-lib/backports/issues", + "License": "GPL-2 | GPL-3", + "NeedsCompilation": "yes", + "ByteCompile": "yes", + "Depends": [ + "R (>= 3.0.0)" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "Author": "Michel Lang [cre, aut] (), Duncan Murdoch [aut], R Core Team [aut]", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "base64enc": { + "Package": "base64enc", + "Version": "0.1-3", + "Source": "Repository", + "Title": "Tools for base64 encoding", + "Author": "Simon Urbanek ", + "Maintainer": "Simon Urbanek ", + "Depends": [ + "R (>= 2.9.0)" + ], + "Enhances": [ + "png" + ], + "Description": "This package provides tools for handling base64 encoding. It is more flexible than the orphaned base64 package.", + "License": "GPL-2 | GPL-3", + "URL": "http://www.rforge.net/base64enc", + "NeedsCompilation": "yes", + "Repository": "RSPM", + "Encoding": "UTF-8", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "bit": { + "Package": "bit", + "Version": "4.6.0", + "Source": "Repository", + "Title": "Classes and Methods for Fast Memory-Efficient Boolean Selections", + "Authors@R": "c( person(\"Michael\", \"Chirico\", email = \"MichaelChirico4@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Jens\", \"Oehlschlägel\", role = \"aut\"), person(\"Brian\", \"Ripley\", role = \"ctb\") )", + "Depends": [ + "R (>= 3.4.0)" + ], + "Suggests": [ + "testthat (>= 3.0.0)", + "roxygen2", + "knitr", + "markdown", + "rmarkdown", + "microbenchmark", + "bit64 (>= 4.0.0)", + "ff (>= 4.0.0)" + ], + "Description": "Provided are classes for boolean and skewed boolean vectors, fast boolean methods, fast unique and non-unique integer sorting, fast set operations on sorted and unsorted sets of integers, and foundations for ff (range index, compression, chunked processing).", + "License": "GPL-2 | GPL-3", + "LazyLoad": "yes", + "ByteCompile": "yes", + "Encoding": "UTF-8", + "URL": "https://github.com/r-lib/bit", + "VignetteBuilder": "knitr, rmarkdown", + "RoxygenNote": "7.3.2", + "Config/testthat/edition": "3", + "NeedsCompilation": "yes", + "Author": "Michael Chirico [aut, cre], Jens Oehlschlägel [aut], Brian Ripley [ctb]", + "Maintainer": "Michael Chirico ", + "Repository": "https://p3m.dev/cran/latest" + }, + "bit64": { + "Package": "bit64", + "Version": "4.6.0-1", + "Source": "Repository", + "Title": "A S3 Class for Vectors of 64bit Integers", + "Authors@R": "c( person(\"Michael\", \"Chirico\", email = \"michaelchirico4@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Jens\", \"Oehlschlägel\", role = \"aut\"), person(\"Leonardo\", \"Silvestri\", role = \"ctb\"), person(\"Ofek\", \"Shilon\", role = \"ctb\") )", + "Depends": [ + "R (>= 3.4.0)", + "bit (>= 4.0.0)" + ], + "Description": "Package 'bit64' provides serializable S3 atomic 64bit (signed) integers. These are useful for handling database keys and exact counting in +-2^63. WARNING: do not use them as replacement for 32bit integers, integer64 are not supported for subscripting by R-core and they have different semantics when combined with double, e.g. integer64 + double => integer64. Class integer64 can be used in vectors, matrices, arrays and data.frames. Methods are available for coercion from and to logicals, integers, doubles, characters and factors as well as many elementwise and summary functions. Many fast algorithmic operations such as 'match' and 'order' support inter- active data exploration and manipulation and optionally leverage caching.", + "License": "GPL-2 | GPL-3", + "LazyLoad": "yes", + "ByteCompile": "yes", + "URL": "https://github.com/r-lib/bit64", + "Encoding": "UTF-8", + "Imports": [ + "graphics", + "methods", + "stats", + "utils" + ], + "Suggests": [ + "testthat (>= 3.0.3)", + "withr" + ], + "Config/testthat/edition": "3", + "Config/needs/development": "testthat", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Michael Chirico [aut, cre], Jens Oehlschlägel [aut], Leonardo Silvestri [ctb], Ofek Shilon [ctb]", + "Maintainer": "Michael Chirico ", + "Repository": "https://p3m.dev/cran/latest" + }, + "brio": { + "Package": "brio", + "Version": "1.1.5", + "Source": "Repository", + "Title": "Basic R Input Output", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Functions to handle basic input output, these functions always read and write UTF-8 (8-bit Unicode Transformation Format) files and provide more explicit control over line endings.", + "License": "MIT + file LICENSE", + "URL": "https://brio.r-lib.org, https://github.com/r-lib/brio", + "BugReports": "https://github.com/r-lib/brio/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Suggests": [ + "covr", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut] (), Gábor Csárdi [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "bslib": { + "Package": "bslib", + "Version": "0.9.0", + "Source": "Repository", + "Title": "Custom 'Bootstrap' 'Sass' Themes for 'shiny' and 'rmarkdown'", + "Authors@R": "c( person(\"Carson\", \"Sievert\", , \"carson@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = \"aut\"), person(\"Garrick\", \"Aden-Buie\", , \"garrick@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0002-7111-0077\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(, \"Bootstrap contributors\", role = \"ctb\", comment = \"Bootstrap library\"), person(, \"Twitter, Inc\", role = \"cph\", comment = \"Bootstrap library\"), person(\"Javi\", \"Aguilar\", role = c(\"ctb\", \"cph\"), comment = \"Bootstrap colorpicker library\"), person(\"Thomas\", \"Park\", role = c(\"ctb\", \"cph\"), comment = \"Bootswatch library\"), person(, \"PayPal\", role = c(\"ctb\", \"cph\"), comment = \"Bootstrap accessibility plugin\") )", + "Description": "Simplifies custom 'CSS' styling of both 'shiny' and 'rmarkdown' via 'Bootstrap' 'Sass'. Supports 'Bootstrap' 3, 4 and 5 as well as their various 'Bootswatch' themes. An interactive widget is also provided for previewing themes in real time.", + "License": "MIT + file LICENSE", + "URL": "https://rstudio.github.io/bslib/, https://github.com/rstudio/bslib", + "BugReports": "https://github.com/rstudio/bslib/issues", + "Depends": [ + "R (>= 2.10)" + ], + "Imports": [ + "base64enc", + "cachem", + "fastmap (>= 1.1.1)", + "grDevices", + "htmltools (>= 0.5.8)", + "jquerylib (>= 0.1.3)", + "jsonlite", + "lifecycle", + "memoise (>= 2.0.1)", + "mime", + "rlang", + "sass (>= 0.4.9)" + ], + "Suggests": [ + "bsicons", + "curl", + "fontawesome", + "future", + "ggplot2", + "knitr", + "magrittr", + "rappdirs", + "rmarkdown (>= 2.7)", + "shiny (> 1.8.1)", + "testthat", + "thematic", + "tools", + "utils", + "withr", + "yaml" + ], + "Config/Needs/deploy": "BH, chiflights22, colourpicker, commonmark, cpp11, cpsievert/chiflights22, cpsievert/histoslider, dplyr, DT, ggplot2, ggridges, gt, hexbin, histoslider, htmlwidgets, lattice, leaflet, lubridate, markdown, modelr, plotly, reactable, reshape2, rprojroot, rsconnect, rstudio/shiny, scales, styler, tibble", + "Config/Needs/routine": "chromote, desc, renv", + "Config/Needs/website": "brio, crosstalk, dplyr, DT, ggplot2, glue, htmlwidgets, leaflet, lorem, palmerpenguins, plotly, purrr, rprojroot, rstudio/htmltools, scales, stringr, tidyr, webshot2", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "zzzz-bs-sass, fonts, zzz-precompile, theme-*, rmd-*", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "Collate": "'accordion.R' 'breakpoints.R' 'bs-current-theme.R' 'bs-dependencies.R' 'bs-global.R' 'bs-remove.R' 'bs-theme-layers.R' 'bs-theme-preset-bootswatch.R' 'bs-theme-preset-brand.R' 'bs-theme-preset-builtin.R' 'bs-theme-preset.R' 'utils.R' 'bs-theme-preview.R' 'bs-theme-update.R' 'bs-theme.R' 'bslib-package.R' 'buttons.R' 'card.R' 'deprecated.R' 'files.R' 'fill.R' 'imports.R' 'input-dark-mode.R' 'input-switch.R' 'layout.R' 'nav-items.R' 'nav-update.R' 'navbar_options.R' 'navs-legacy.R' 'navs.R' 'onLoad.R' 'page.R' 'popover.R' 'precompiled.R' 'print.R' 'shiny-devmode.R' 'sidebar.R' 'staticimports.R' 'tooltip.R' 'utils-deps.R' 'utils-shiny.R' 'utils-tags.R' 'value-box.R' 'version-default.R' 'versions.R'", + "NeedsCompilation": "no", + "Author": "Carson Sievert [aut, cre] (), Joe Cheng [aut], Garrick Aden-Buie [aut] (), Posit Software, PBC [cph, fnd], Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Javi Aguilar [ctb, cph] (Bootstrap colorpicker library), Thomas Park [ctb, cph] (Bootswatch library), PayPal [ctb, cph] (Bootstrap accessibility plugin)", + "Maintainer": "Carson Sievert ", + "Repository": "RSPM" + }, + "cachem": { + "Package": "cachem", + "Version": "1.1.0", + "Source": "Repository", + "Title": "Cache R Objects with Automatic Pruning", + "Description": "Key-value stores with automatic pruning. Caches can limit either their total size or the age of the oldest object (or both), automatically pruning objects to maintain the constraints.", + "Authors@R": "c( person(\"Winston\", \"Chang\", , \"winston@posit.co\", c(\"aut\", \"cre\")), person(family = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")))", + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "ByteCompile": "true", + "URL": "https://cachem.r-lib.org/, https://github.com/r-lib/cachem", + "Imports": [ + "rlang", + "fastmap (>= 1.2.0)" + ], + "Suggests": [ + "testthat" + ], + "RoxygenNote": "7.2.3", + "Config/Needs/routine": "lobstr", + "Config/Needs/website": "pkgdown", + "NeedsCompilation": "yes", + "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Winston Chang ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "callr": { + "Package": "callr", + "Version": "3.7.6", + "Source": "Repository", + "Title": "Call R from R", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\", \"cph\"), comment = c(ORCID = \"0000-0001-7098-9676\")), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"Ascent Digital Services\", role = c(\"cph\", \"fnd\")) )", + "Description": "It is sometimes useful to perform a computation in a separate R process, without affecting the current R process at all. This packages does exactly that.", + "License": "MIT + file LICENSE", + "URL": "https://callr.r-lib.org, https://github.com/r-lib/callr", + "BugReports": "https://github.com/r-lib/callr/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "processx (>= 3.6.1)", + "R6", + "utils" + ], + "Suggests": [ + "asciicast (>= 2.3.1)", + "cli (>= 1.1.0)", + "mockery", + "ps", + "rprojroot", + "spelling", + "testthat (>= 3.2.0)", + "withr (>= 2.3.0)" + ], + "Config/Needs/website": "r-lib/asciicast, glue, htmlwidgets, igraph, tibble, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.3.1.9000", + "NeedsCompilation": "no", + "Author": "Gábor Csárdi [aut, cre, cph] (), Winston Chang [aut], Posit Software, PBC [cph, fnd], Ascent Digital Services [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM" + }, + "cellranger": { + "Package": "cellranger", + "Version": "1.1.0", + "Source": "Repository", + "Title": "Translate Spreadsheet Cell Ranges to Rows and Columns", + "Authors@R": "c( person(\"Jennifer\", \"Bryan\", , \"jenny@stat.ubc.ca\", c(\"cre\", \"aut\")), person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", \"ctb\") )", + "Description": "Helper functions to work with spreadsheets and the \"A1:D10\" style of cell range specification.", + "Depends": [ + "R (>= 3.0.0)" + ], + "License": "MIT + file LICENSE", + "LazyData": "true", + "URL": "https://github.com/rsheets/cellranger", + "BugReports": "https://github.com/rsheets/cellranger/issues", + "Suggests": [ + "covr", + "testthat (>= 1.0.0)", + "knitr", + "rmarkdown" + ], + "RoxygenNote": "5.0.1.9000", + "VignetteBuilder": "knitr", + "Imports": [ + "rematch", + "tibble" + ], + "NeedsCompilation": "no", + "Author": "Jennifer Bryan [cre, aut], Hadley Wickham [ctb]", + "Maintainer": "Jennifer Bryan ", + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "checkmate": { + "Package": "checkmate", + "Version": "2.3.2", + "Source": "Repository", + "Type": "Package", + "Title": "Fast and Versatile Argument Checks", + "Description": "Tests and assertions to perform frequent argument checks. A substantial part of the package was written in C to minimize any worries about execution time overhead.", + "Authors@R": "c( person(\"Michel\", \"Lang\", NULL, \"michellang@gmail.com\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0001-9754-0393\")), person(\"Bernd\", \"Bischl\", NULL, \"bernd_bischl@gmx.net\", role = \"ctb\"), person(\"Dénes\", \"Tóth\", NULL, \"toth.denes@kogentum.hu\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4262-3217\")) )", + "URL": "https://mllg.github.io/checkmate/, https://github.com/mllg/checkmate", + "URLNote": "https://github.com/mllg/checkmate", + "BugReports": "https://github.com/mllg/checkmate/issues", + "NeedsCompilation": "yes", + "ByteCompile": "yes", + "Encoding": "UTF-8", + "Depends": [ + "R (>= 3.0.0)" + ], + "Imports": [ + "backports (>= 1.1.0)", + "utils" + ], + "Suggests": [ + "R6", + "fastmatch", + "data.table (>= 1.9.8)", + "devtools", + "ggplot2", + "knitr", + "magrittr", + "microbenchmark", + "rmarkdown", + "testthat (>= 3.0.4)", + "tinytest (>= 1.1.0)", + "tibble" + ], + "License": "BSD_3_clause + file LICENSE", + "VignetteBuilder": "knitr", + "RoxygenNote": "7.3.2", + "Collate": "'AssertCollection.R' 'allMissing.R' 'anyInfinite.R' 'anyMissing.R' 'anyNaN.R' 'asInteger.R' 'assert.R' 'helper.R' 'makeExpectation.R' 'makeTest.R' 'makeAssertion.R' 'checkAccess.R' 'checkArray.R' 'checkAtomic.R' 'checkAtomicVector.R' 'checkCharacter.R' 'checkChoice.R' 'checkClass.R' 'checkComplex.R' 'checkCount.R' 'checkDataFrame.R' 'checkDataTable.R' 'checkDate.R' 'checkDirectoryExists.R' 'checkDisjunct.R' 'checkDouble.R' 'checkEnvironment.R' 'checkFALSE.R' 'checkFactor.R' 'checkFileExists.R' 'checkFlag.R' 'checkFormula.R' 'checkFunction.R' 'checkInt.R' 'checkInteger.R' 'checkIntegerish.R' 'checkList.R' 'checkLogical.R' 'checkMatrix.R' 'checkMultiClass.R' 'checkNamed.R' 'checkNames.R' 'checkNull.R' 'checkNumber.R' 'checkNumeric.R' 'checkOS.R' 'checkPOSIXct.R' 'checkPathForOutput.R' 'checkPermutation.R' 'checkR6.R' 'checkRaw.R' 'checkScalar.R' 'checkScalarNA.R' 'checkSetEqual.R' 'checkString.R' 'checkSubset.R' 'checkTRUE.R' 'checkTibble.R' 'checkVector.R' 'coalesce.R' 'isIntegerish.R' 'matchArg.R' 'qassert.R' 'qassertr.R' 'vname.R' 'wfwl.R' 'zzz.R'", + "Author": "Michel Lang [cre, aut] (), Bernd Bischl [ctb], Dénes Tóth [ctb] ()", + "Maintainer": "Michel Lang ", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "cli": { + "Package": "cli", + "Version": "3.6.5", + "Source": "Repository", + "Title": "Helpers for Developing Command Line Interfaces", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"gabor@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Kirill\", \"Müller\", role = \"ctb\"), person(\"Salim\", \"Brüggemann\", , \"salim-b@pm.me\", role = \"ctb\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A suite of tools to build attractive command line interfaces ('CLIs'), from semantic elements: headings, lists, alerts, paragraphs, etc. Supports custom themes via a 'CSS'-like language. It also contains a number of lower level 'CLI' elements: rules, boxes, trees, and 'Unicode' symbols with 'ASCII' alternatives. It support ANSI colors and text styles as well.", + "License": "MIT + file LICENSE", + "URL": "https://cli.r-lib.org, https://github.com/r-lib/cli", + "BugReports": "https://github.com/r-lib/cli/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "callr", + "covr", + "crayon", + "digest", + "glue (>= 1.6.0)", + "grDevices", + "htmltools", + "htmlwidgets", + "knitr", + "methods", + "processx", + "ps (>= 1.3.4.9000)", + "rlang (>= 1.0.2.9003)", + "rmarkdown", + "rprojroot", + "rstudioapi", + "testthat (>= 3.2.0)", + "tibble", + "whoami", + "withr" + ], + "Config/Needs/website": "r-lib/asciicast, bench, brio, cpp11, decor, desc, fansi, prettyunits, sessioninfo, tidyverse/tidytemplate, usethis, vctrs", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Gábor Csárdi [aut, cre], Hadley Wickham [ctb], Kirill Müller [ctb], Salim Brüggemann [ctb] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "clipr": { + "Package": "clipr", + "Version": "0.8.0", + "Source": "Repository", + "Type": "Package", + "Title": "Read and Write from the System Clipboard", + "Authors@R": "c( person(\"Matthew\", \"Lincoln\", , \"matthew.d.lincoln@gmail.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4387-3384\")), person(\"Louis\", \"Maddox\", role = \"ctb\"), person(\"Steve\", \"Simpson\", role = \"ctb\"), person(\"Jennifer\", \"Bryan\", role = \"ctb\") )", + "Description": "Simple utility functions to read from and write to the Windows, OS X, and X11 clipboards.", + "License": "GPL-3", + "URL": "https://github.com/mdlincoln/clipr, http://matthewlincoln.net/clipr/", + "BugReports": "https://github.com/mdlincoln/clipr/issues", + "Imports": [ + "utils" + ], + "Suggests": [ + "covr", + "knitr", + "rmarkdown", + "rstudioapi (>= 0.5)", + "testthat (>= 2.0.0)" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.1.2", + "SystemRequirements": "xclip (https://github.com/astrand/xclip) or xsel (http://www.vergenet.net/~conrad/software/xsel/) for accessing the X11 clipboard, or wl-clipboard (https://github.com/bugaevc/wl-clipboard) for systems using Wayland.", + "NeedsCompilation": "no", + "Author": "Matthew Lincoln [aut, cre] (), Louis Maddox [ctb], Steve Simpson [ctb], Jennifer Bryan [ctb]", + "Maintainer": "Matthew Lincoln ", + "Repository": "RSPM" + }, + "commonmark": { + "Package": "commonmark", + "Version": "1.9.5", + "Source": "Repository", + "Type": "Package", + "Title": "High Performance CommonMark and Github Markdown Rendering in R", + "Authors@R": "c( person(\"Jeroen\", \"Ooms\", ,\"jeroenooms@gmail.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"John MacFarlane\", role = \"cph\", comment = \"Author of cmark\"))", + "Description": "The CommonMark specification defines a rationalized version of markdown syntax. This package uses the 'cmark' reference implementation for converting markdown text into various formats including html, latex and groff man. In addition it exposes the markdown parse tree in xml format. Also includes opt-in support for GFM extensions including tables, autolinks, and strikethrough text.", + "License": "BSD_2_clause + file LICENSE", + "URL": "https://docs.ropensci.org/commonmark/ https://ropensci.r-universe.dev/commonmark", + "BugReports": "https://github.com/r-lib/commonmark/issues", + "Suggests": [ + "curl", + "testthat", + "xml2" + ], + "RoxygenNote": "7.3.2", + "Language": "en-US", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (), John MacFarlane [cph] (Author of cmark)", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "cpp11": { + "Package": "cpp11", + "Version": "0.5.2", + "Source": "Repository", + "Title": "A C++11 Interface for R's C Interface", + "Authors@R": "c( person(\"Davis\", \"Vaughan\", email = \"davis@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4777-038X\")), person(\"Jim\",\"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Romain\", \"François\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Benjamin\", \"Kietzman\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Provides a header only, C++11 interface to R's C interface. Compared to other approaches 'cpp11' strives to be safe against long jumps from the C API as well as C++ exceptions, conform to normal R function semantics and supports interaction with 'ALTREP' vectors.", + "License": "MIT + file LICENSE", + "URL": "https://cpp11.r-lib.org, https://github.com/r-lib/cpp11", + "BugReports": "https://github.com/r-lib/cpp11/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Suggests": [ + "bench", + "brio", + "callr", + "cli", + "covr", + "decor", + "desc", + "ggplot2", + "glue", + "knitr", + "lobstr", + "mockery", + "progress", + "rmarkdown", + "scales", + "Rcpp", + "testthat (>= 3.2.0)", + "tibble", + "utils", + "vctrs", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/Needs/cpp11/cpp_register": "brio, cli, decor, desc, glue, tibble, vctrs", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Davis Vaughan [aut, cre] (), Jim Hester [aut] (), Romain François [aut] (), Benjamin Kietzman [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "RSPM" + }, + "crayon": { + "Package": "crayon", + "Version": "1.5.3", + "Source": "Repository", + "Title": "Colored Terminal Output", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Brodie\", \"Gaslam\", , \"brodie.gaslam@yahoo.com\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "The crayon package is now superseded. Please use the 'cli' package for new projects. Colored terminal output on terminals that support 'ANSI' color and highlight codes. It also works in 'Emacs' 'ESS'. 'ANSI' color support is automatically detected. Colors and highlighting can be combined and nested. New styles can also be created easily. This package was inspired by the 'chalk' 'JavaScript' project.", + "License": "MIT + file LICENSE", + "URL": "https://r-lib.github.io/crayon/, https://github.com/r-lib/crayon", + "BugReports": "https://github.com/r-lib/crayon/issues", + "Imports": [ + "grDevices", + "methods", + "utils" + ], + "Suggests": [ + "mockery", + "rstudioapi", + "testthat", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "Collate": "'aaa-rstudio-detect.R' 'aaaa-rematch2.R' 'aab-num-ansi-colors.R' 'aac-num-ansi-colors.R' 'ansi-256.R' 'ansi-palette.R' 'combine.R' 'string.R' 'utils.R' 'crayon-package.R' 'disposable.R' 'enc-utils.R' 'has_ansi.R' 'has_color.R' 'link.R' 'styles.R' 'machinery.R' 'parts.R' 'print.R' 'style-var.R' 'show.R' 'string_operations.R'", + "NeedsCompilation": "no", + "Author": "Gábor Csárdi [aut, cre], Brodie Gaslam [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM" + }, + "crosstalk": { + "Package": "crosstalk", + "Version": "1.2.1", + "Source": "Repository", + "Type": "Package", + "Title": "Inter-Widget Interactivity for HTML Widgets", + "Authors@R": "c( person(\"Joe\", \"Cheng\", role = \"aut\", email = \"joe@posit.co\"), person(\"Carson\", \"Sievert\", role = c(\"aut\", \"cre\"), email = \"carson@posit.co\", comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(family = \"jQuery Foundation\", role = \"cph\", comment = \"jQuery library and jQuery UI library\"), person(family = \"jQuery contributors\", role = c(\"ctb\", \"cph\"), comment = \"jQuery library; authors listed in inst/www/shared/jquery-AUTHORS.txt\"), person(\"Mark\", \"Otto\", role = \"ctb\", comment = \"Bootstrap library\"), person(\"Jacob\", \"Thornton\", role = \"ctb\", comment = \"Bootstrap library\"), person(family = \"Bootstrap contributors\", role = \"ctb\", comment = \"Bootstrap library\"), person(family = \"Twitter, Inc\", role = \"cph\", comment = \"Bootstrap library\"), person(\"Brian\", \"Reavis\", role = c(\"ctb\", \"cph\"), comment = \"selectize.js library\"), person(\"Kristopher Michael\", \"Kowal\", role = c(\"ctb\", \"cph\"), comment = \"es5-shim library\"), person(family = \"es5-shim contributors\", role = c(\"ctb\", \"cph\"), comment = \"es5-shim library\"), person(\"Denis\", \"Ineshin\", role = c(\"ctb\", \"cph\"), comment = \"ion.rangeSlider library\"), person(\"Sami\", \"Samhuri\", role = c(\"ctb\", \"cph\"), comment = \"Javascript strftime library\") )", + "Description": "Provides building blocks for allowing HTML widgets to communicate with each other, with Shiny or without (i.e. static .html files). Currently supports linked brushing and filtering.", + "License": "MIT + file LICENSE", + "Imports": [ + "htmltools (>= 0.3.6)", + "jsonlite", + "lazyeval", + "R6" + ], + "Suggests": [ + "shiny", + "ggplot2", + "testthat (>= 2.1.0)", + "sass", + "bslib" + ], + "URL": "https://rstudio.github.io/crosstalk/, https://github.com/rstudio/crosstalk", + "BugReports": "https://github.com/rstudio/crosstalk/issues", + "RoxygenNote": "7.2.3", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Joe Cheng [aut], Carson Sievert [aut, cre] (), Posit Software, PBC [cph, fnd], jQuery Foundation [cph] (jQuery library and jQuery UI library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/www/shared/jquery-AUTHORS.txt), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Brian Reavis [ctb, cph] (selectize.js library), Kristopher Michael Kowal [ctb, cph] (es5-shim library), es5-shim contributors [ctb, cph] (es5-shim library), Denis Ineshin [ctb, cph] (ion.rangeSlider library), Sami Samhuri [ctb, cph] (Javascript strftime library)", + "Maintainer": "Carson Sievert ", + "Repository": "https://p3m.dev/cran/latest" + }, + "curl": { + "Package": "curl", + "Version": "6.4.0", + "Source": "Repository", + "Type": "Package", + "Title": "A Modern and Flexible Web Client for R", + "Authors@R": "c( person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Posit Software, PBC\", role = \"cph\"))", + "Description": "Bindings to 'libcurl' for performing fully configurable HTTP/FTP requests where responses can be processed in memory, on disk, or streaming via the callback or connection interfaces. Some knowledge of 'libcurl' is recommended; for a more-user-friendly web client see the 'httr2' package which builds on this package with http specific tools and logic.", + "License": "MIT + file LICENSE", + "SystemRequirements": "libcurl (>= 7.73): libcurl-devel (rpm) or libcurl4-openssl-dev (deb)", + "URL": "https://jeroen.r-universe.dev/curl", + "BugReports": "https://github.com/jeroen/curl/issues", + "Suggests": [ + "spelling", + "testthat (>= 1.0.0)", + "knitr", + "jsonlite", + "later", + "rmarkdown", + "httpuv (>= 1.4.4)", + "webutils" + ], + "VignetteBuilder": "knitr", + "Depends": [ + "R (>= 3.0.0)" + ], + "RoxygenNote": "7.3.2.9000", + "Encoding": "UTF-8", + "Language": "en-US", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (ORCID: ), Hadley Wickham [ctb], Posit Software, PBC [cph]", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_27" + }, + "data.table": { + "Package": "data.table", + "Version": "1.17.6", + "Source": "Repository", + "Title": "Extension of `data.frame`", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "bit64 (>= 4.0.0)", + "bit (>= 4.0.4)", + "R.utils", + "xts", + "zoo (>= 1.8-1)", + "yaml", + "knitr", + "markdown" + ], + "Description": "Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development.", + "License": "MPL-2.0 | file LICENSE", + "URL": "https://r-datatable.com, https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table", + "BugReports": "https://github.com/Rdatatable/data.table/issues", + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "ByteCompile": "TRUE", + "Authors@R": "c( person(\"Tyson\",\"Barrett\", role=c(\"aut\",\"cre\"), email=\"t.barrett88@gmail.com\", comment = c(ORCID=\"0000-0002-2137-1391\")), person(\"Matt\",\"Dowle\", role=\"aut\", email=\"mattjdowle@gmail.com\"), person(\"Arun\",\"Srinivasan\", role=\"aut\", email=\"asrini@pm.me\"), person(\"Jan\",\"Gorecki\", role=\"aut\"), person(\"Michael\",\"Chirico\", role=\"aut\", comment = c(ORCID=\"0000-0003-0787-087X\")), person(\"Toby\",\"Hocking\", role=\"aut\", comment = c(ORCID=\"0000-0002-3146-0865\")), person(\"Benjamin\",\"Schwendinger\",role=\"aut\", comment = c(ORCID=\"0000-0003-3315-8114\")), person(\"Ivan\", \"Krylov\", role=\"aut\", email=\"ikrylov@disroot.org\", comment = c(ORCID=\"0000-0002-0172-3812\")), person(\"Pasha\",\"Stetsenko\", role=\"ctb\"), person(\"Tom\",\"Short\", role=\"ctb\"), person(\"Steve\",\"Lianoglou\", role=\"ctb\"), person(\"Eduard\",\"Antonyan\", role=\"ctb\"), person(\"Markus\",\"Bonsch\", role=\"ctb\"), person(\"Hugh\",\"Parsonage\", role=\"ctb\"), person(\"Scott\",\"Ritchie\", role=\"ctb\"), person(\"Kun\",\"Ren\", role=\"ctb\"), person(\"Xianying\",\"Tan\", role=\"ctb\"), person(\"Rick\",\"Saporta\", role=\"ctb\"), person(\"Otto\",\"Seiskari\", role=\"ctb\"), person(\"Xianghui\",\"Dong\", role=\"ctb\"), person(\"Michel\",\"Lang\", role=\"ctb\"), person(\"Watal\",\"Iwasaki\", role=\"ctb\"), person(\"Seth\",\"Wenchel\", role=\"ctb\"), person(\"Karl\",\"Broman\", role=\"ctb\"), person(\"Tobias\",\"Schmidt\", role=\"ctb\"), person(\"David\",\"Arenburg\", role=\"ctb\"), person(\"Ethan\",\"Smith\", role=\"ctb\"), person(\"Francois\",\"Cocquemas\", role=\"ctb\"), person(\"Matthieu\",\"Gomez\", role=\"ctb\"), person(\"Philippe\",\"Chataignon\", role=\"ctb\"), person(\"Nello\",\"Blaser\", role=\"ctb\"), person(\"Dmitry\",\"Selivanov\", role=\"ctb\"), person(\"Andrey\",\"Riabushenko\", role=\"ctb\"), person(\"Cheng\",\"Lee\", role=\"ctb\"), person(\"Declan\",\"Groves\", role=\"ctb\"), person(\"Daniel\",\"Possenriede\", role=\"ctb\"), person(\"Felipe\",\"Parages\", role=\"ctb\"), person(\"Denes\",\"Toth\", role=\"ctb\"), person(\"Mus\",\"Yaramaz-David\", role=\"ctb\"), person(\"Ayappan\",\"Perumal\", role=\"ctb\"), person(\"James\",\"Sams\", role=\"ctb\"), person(\"Martin\",\"Morgan\", role=\"ctb\"), person(\"Michael\",\"Quinn\", role=\"ctb\"), person(\"@javrucebo\",\"\", role=\"ctb\"), person(\"@marc-outins\",\"\", role=\"ctb\"), person(\"Roy\",\"Storey\", role=\"ctb\"), person(\"Manish\",\"Saraswat\", role=\"ctb\"), person(\"Morgan\",\"Jacob\", role=\"ctb\"), person(\"Michael\",\"Schubmehl\", role=\"ctb\"), person(\"Davis\",\"Vaughan\", role=\"ctb\"), person(\"Leonardo\",\"Silvestri\", role=\"ctb\"), person(\"Jim\",\"Hester\", role=\"ctb\"), person(\"Anthony\",\"Damico\", role=\"ctb\"), person(\"Sebastian\",\"Freundt\", role=\"ctb\"), person(\"David\",\"Simons\", role=\"ctb\"), person(\"Elliott\",\"Sales de Andrade\", role=\"ctb\"), person(\"Cole\",\"Miller\", role=\"ctb\"), person(\"Jens Peder\",\"Meldgaard\", role=\"ctb\"), person(\"Vaclav\",\"Tlapak\", role=\"ctb\"), person(\"Kevin\",\"Ushey\", role=\"ctb\"), person(\"Dirk\",\"Eddelbuettel\", role=\"ctb\"), person(\"Tony\",\"Fischetti\", role=\"ctb\"), person(\"Ofek\",\"Shilon\", role=\"ctb\"), person(\"Vadim\",\"Khotilovich\", role=\"ctb\"), person(\"Hadley\",\"Wickham\", role=\"ctb\"), person(\"Bennet\",\"Becker\", role=\"ctb\"), person(\"Kyle\",\"Haynes\", role=\"ctb\"), person(\"Boniface Christian\",\"Kamgang\", role=\"ctb\"), person(\"Olivier\",\"Delmarcell\", role=\"ctb\"), person(\"Josh\",\"O'Brien\", role=\"ctb\"), person(\"Dereck\",\"de Mezquita\", role=\"ctb\"), person(\"Michael\",\"Czekanski\", role=\"ctb\"), person(\"Dmitry\", \"Shemetov\", role=\"ctb\"), person(\"Nitish\", \"Jha\", role=\"ctb\"), person(\"Joshua\", \"Wu\", role=\"ctb\"), person(\"Iago\", \"Giné-Vázquez\", role=\"ctb\"), person(\"Anirban\", \"Chetia\", role=\"ctb\"), person(\"Doris\", \"Amoakohene\", role=\"ctb\"), person(\"Angel\", \"Feliz\", role=\"ctb\"), person(\"Michael\",\"Young\", role=\"ctb\"), person(\"Mark\", \"Seeto\", role=\"ctb\"), person(\"Philippe\", \"Grosjean\", role=\"ctb\"), person(\"Vincent\", \"Runge\", role=\"ctb\"), person(\"Christian\", \"Wia\", role=\"ctb\"), person(\"Elise\", \"Maigné\", role=\"ctb\"), person(\"Vincent\", \"Rocher\", role=\"ctb\"), person(\"Vijay\", \"Lulla\", role=\"ctb\"), person(\"Aljaž\", \"Sluga\", role=\"ctb\"), person(\"Bill\", \"Evans\", role=\"ctb\") )", + "NeedsCompilation": "yes", + "Author": "Tyson Barrett [aut, cre] (ORCID: ), Matt Dowle [aut], Arun Srinivasan [aut], Jan Gorecki [aut], Michael Chirico [aut] (ORCID: ), Toby Hocking [aut] (ORCID: ), Benjamin Schwendinger [aut] (ORCID: ), Ivan Krylov [aut] (ORCID: ), Pasha Stetsenko [ctb], Tom Short [ctb], Steve Lianoglou [ctb], Eduard Antonyan [ctb], Markus Bonsch [ctb], Hugh Parsonage [ctb], Scott Ritchie [ctb], Kun Ren [ctb], Xianying Tan [ctb], Rick Saporta [ctb], Otto Seiskari [ctb], Xianghui Dong [ctb], Michel Lang [ctb], Watal Iwasaki [ctb], Seth Wenchel [ctb], Karl Broman [ctb], Tobias Schmidt [ctb], David Arenburg [ctb], Ethan Smith [ctb], Francois Cocquemas [ctb], Matthieu Gomez [ctb], Philippe Chataignon [ctb], Nello Blaser [ctb], Dmitry Selivanov [ctb], Andrey Riabushenko [ctb], Cheng Lee [ctb], Declan Groves [ctb], Daniel Possenriede [ctb], Felipe Parages [ctb], Denes Toth [ctb], Mus Yaramaz-David [ctb], Ayappan Perumal [ctb], James Sams [ctb], Martin Morgan [ctb], Michael Quinn [ctb], @javrucebo [ctb], @marc-outins [ctb], Roy Storey [ctb], Manish Saraswat [ctb], Morgan Jacob [ctb], Michael Schubmehl [ctb], Davis Vaughan [ctb], Leonardo Silvestri [ctb], Jim Hester [ctb], Anthony Damico [ctb], Sebastian Freundt [ctb], David Simons [ctb], Elliott Sales de Andrade [ctb], Cole Miller [ctb], Jens Peder Meldgaard [ctb], Vaclav Tlapak [ctb], Kevin Ushey [ctb], Dirk Eddelbuettel [ctb], Tony Fischetti [ctb], Ofek Shilon [ctb], Vadim Khotilovich [ctb], Hadley Wickham [ctb], Bennet Becker [ctb], Kyle Haynes [ctb], Boniface Christian Kamgang [ctb], Olivier Delmarcell [ctb], Josh O'Brien [ctb], Dereck de Mezquita [ctb], Michael Czekanski [ctb], Dmitry Shemetov [ctb], Nitish Jha [ctb], Joshua Wu [ctb], Iago Giné-Vázquez [ctb], Anirban Chetia [ctb], Doris Amoakohene [ctb], Angel Feliz [ctb], Michael Young [ctb], Mark Seeto [ctb], Philippe Grosjean [ctb], Vincent Runge [ctb], Christian Wia [ctb], Elise Maigné [ctb], Vincent Rocher [ctb], Vijay Lulla [ctb], Aljaž Sluga [ctb], Bill Evans [ctb]", + "Maintainer": "Tyson Barrett ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "desc": { + "Package": "desc", + "Version": "1.4.3", + "Source": "Repository", + "Title": "Manipulate DESCRIPTION Files", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Kirill\", \"Müller\", role = \"aut\"), person(\"Jim\", \"Hester\", , \"james.f.hester@gmail.com\", role = \"aut\"), person(\"Maëlle\", \"Salmon\", role = \"ctb\", comment = c(ORCID = \"0000-0002-2815-0399\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Maintainer": "Gábor Csárdi ", + "Description": "Tools to read, write, create, and manipulate DESCRIPTION files. It is intended for packages that create or manipulate other packages.", + "License": "MIT + file LICENSE", + "URL": "https://desc.r-lib.org/, https://github.com/r-lib/desc", + "BugReports": "https://github.com/r-lib/desc/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "cli", + "R6", + "utils" + ], + "Suggests": [ + "callr", + "covr", + "gh", + "spelling", + "testthat", + "whoami", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.2.3", + "Collate": "'assertions.R' 'authors-at-r.R' 'built.R' 'classes.R' 'collate.R' 'constants.R' 'deps.R' 'desc-package.R' 'description.R' 'encoding.R' 'find-package-root.R' 'latex.R' 'non-oo-api.R' 'package-archives.R' 'read.R' 'remotes.R' 'str.R' 'syntax_checks.R' 'urls.R' 'utils.R' 'validate.R' 'version.R'", + "NeedsCompilation": "no", + "Author": "Gábor Csárdi [aut, cre], Kirill Müller [aut], Jim Hester [aut], Maëlle Salmon [ctb] (), Posit Software, PBC [cph, fnd]", + "Repository": "RSPM" + }, + "diffobj": { + "Package": "diffobj", + "Version": "0.3.6", + "Source": "Repository", + "Type": "Package", + "Title": "Diffs for R Objects", + "Description": "Generate a colorized diff of two R objects for an intuitive visualization of their differences.", + "Authors@R": "c( person( \"Brodie\", \"Gaslam\", email=\"brodie.gaslam@yahoo.com\", role=c(\"aut\", \"cre\")), person( \"Michael B.\", \"Allen\", email=\"ioplex@gmail.com\", role=c(\"ctb\", \"cph\"), comment=\"Original C implementation of Myers Diff Algorithm\"))", + "Depends": [ + "R (>= 3.1.0)" + ], + "License": "GPL-2 | GPL-3", + "URL": "https://github.com/brodieG/diffobj", + "BugReports": "https://github.com/brodieG/diffobj/issues", + "RoxygenNote": "7.2.3", + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "Suggests": [ + "knitr", + "rmarkdown" + ], + "Collate": "'capt.R' 'options.R' 'pager.R' 'check.R' 'finalizer.R' 'misc.R' 'html.R' 'styles.R' 's4.R' 'core.R' 'diff.R' 'get.R' 'guides.R' 'hunks.R' 'layout.R' 'myerssimple.R' 'rdiff.R' 'rds.R' 'set.R' 'subset.R' 'summmary.R' 'system.R' 'text.R' 'tochar.R' 'trim.R' 'word.R'", + "Imports": [ + "crayon (>= 1.3.2)", + "tools", + "methods", + "utils", + "stats" + ], + "NeedsCompilation": "yes", + "Author": "Brodie Gaslam [aut, cre], Michael B. Allen [ctb, cph] (Original C implementation of Myers Diff Algorithm)", + "Maintainer": "Brodie Gaslam ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "digest": { + "Package": "digest", + "Version": "0.6.37", + "Source": "Repository", + "Authors@R": "c(person(\"Dirk\", \"Eddelbuettel\", role = c(\"aut\", \"cre\"), email = \"edd@debian.org\", comment = c(ORCID = \"0000-0001-6419-907X\")), person(\"Antoine\", \"Lucas\", role=\"ctb\"), person(\"Jarek\", \"Tuszynski\", role=\"ctb\"), person(\"Henrik\", \"Bengtsson\", role=\"ctb\", comment = c(ORCID = \"0000-0002-7579-5165\")), person(\"Simon\", \"Urbanek\", role=\"ctb\", comment = c(ORCID = \"0000-0003-2297-1732\")), person(\"Mario\", \"Frasca\", role=\"ctb\"), person(\"Bryan\", \"Lewis\", role=\"ctb\"), person(\"Murray\", \"Stokely\", role=\"ctb\"), person(\"Hannes\", \"Muehleisen\", role=\"ctb\"), person(\"Duncan\", \"Murdoch\", role=\"ctb\"), person(\"Jim\", \"Hester\", role=\"ctb\"), person(\"Wush\", \"Wu\", role=\"ctb\", comment = c(ORCID = \"0000-0001-5180-0567\")), person(\"Qiang\", \"Kou\", role=\"ctb\", comment = c(ORCID = \"0000-0001-6786-5453\")), person(\"Thierry\", \"Onkelinx\", role=\"ctb\", comment = c(ORCID = \"0000-0001-8804-4216\")), person(\"Michel\", \"Lang\", role=\"ctb\", comment = c(ORCID = \"0000-0001-9754-0393\")), person(\"Viliam\", \"Simko\", role=\"ctb\"), person(\"Kurt\", \"Hornik\", role=\"ctb\", comment = c(ORCID = \"0000-0003-4198-9911\")), person(\"Radford\", \"Neal\", role=\"ctb\", comment = c(ORCID = \"0000-0002-2473-3407\")), person(\"Kendon\", \"Bell\", role=\"ctb\", comment = c(ORCID = \"0000-0002-9093-8312\")), person(\"Matthew\", \"de Queljoe\", role=\"ctb\"), person(\"Dmitry\", \"Selivanov\", role=\"ctb\"), person(\"Ion\", \"Suruceanu\", role=\"ctb\"), person(\"Bill\", \"Denney\", role=\"ctb\"), person(\"Dirk\", \"Schumacher\", role=\"ctb\"), person(\"András\", \"Svraka\", role=\"ctb\"), person(\"Sergey\", \"Fedorov\", role=\"ctb\"), person(\"Will\", \"Landau\", role=\"ctb\", comment = c(ORCID = \"0000-0003-1878-3253\")), person(\"Floris\", \"Vanderhaeghe\", role=\"ctb\", comment = c(ORCID = \"0000-0002-6378-6229\")), person(\"Kevin\", \"Tappe\", role=\"ctb\"), person(\"Harris\", \"McGehee\", role=\"ctb\"), person(\"Tim\", \"Mastny\", role=\"ctb\"), person(\"Aaron\", \"Peikert\", role=\"ctb\", comment = c(ORCID = \"0000-0001-7813-818X\")), person(\"Mark\", \"van der Loo\", role=\"ctb\", comment = c(ORCID = \"0000-0002-9807-4686\")), person(\"Chris\", \"Muir\", role=\"ctb\", comment = c(ORCID = \"0000-0003-2555-3878\")), person(\"Moritz\", \"Beller\", role=\"ctb\", comment = c(ORCID = \"0000-0003-4852-0526\")), person(\"Sebastian\", \"Campbell\", role=\"ctb\"), person(\"Winston\", \"Chang\", role=\"ctb\", comment = c(ORCID = \"0000-0002-1576-2126\")), person(\"Dean\", \"Attali\", role=\"ctb\", comment = c(ORCID = \"0000-0002-5645-3493\")), person(\"Michael\", \"Chirico\", role=\"ctb\", comment = c(ORCID = \"0000-0003-0787-087X\")), person(\"Kevin\", \"Ushey\", role=\"ctb\"))", + "Date": "2024-08-19", + "Title": "Create Compact Hash Digests of R Objects", + "Description": "Implementation of a function 'digest()' for the creation of hash digests of arbitrary R objects (using the 'md5', 'sha-1', 'sha-256', 'crc32', 'xxhash', 'murmurhash', 'spookyhash', 'blake3', 'crc32c', 'xxh3_64', and 'xxh3_128' algorithms) permitting easy comparison of R language objects, as well as functions such as'hmac()' to create hash-based message authentication code. Please note that this package is not meant to be deployed for cryptographic purposes for which more comprehensive (and widely tested) libraries such as 'OpenSSL' should be used.", + "URL": "https://github.com/eddelbuettel/digest, https://dirk.eddelbuettel.com/code/digest.html", + "BugReports": "https://github.com/eddelbuettel/digest/issues", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "utils" + ], + "License": "GPL (>= 2)", + "Suggests": [ + "tinytest", + "simplermarkdown" + ], + "VignetteBuilder": "simplermarkdown", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Dirk Eddelbuettel [aut, cre] (), Antoine Lucas [ctb], Jarek Tuszynski [ctb], Henrik Bengtsson [ctb] (), Simon Urbanek [ctb] (), Mario Frasca [ctb], Bryan Lewis [ctb], Murray Stokely [ctb], Hannes Muehleisen [ctb], Duncan Murdoch [ctb], Jim Hester [ctb], Wush Wu [ctb] (), Qiang Kou [ctb] (), Thierry Onkelinx [ctb] (), Michel Lang [ctb] (), Viliam Simko [ctb], Kurt Hornik [ctb] (), Radford Neal [ctb] (), Kendon Bell [ctb] (), Matthew de Queljoe [ctb], Dmitry Selivanov [ctb], Ion Suruceanu [ctb], Bill Denney [ctb], Dirk Schumacher [ctb], András Svraka [ctb], Sergey Fedorov [ctb], Will Landau [ctb] (), Floris Vanderhaeghe [ctb] (), Kevin Tappe [ctb], Harris McGehee [ctb], Tim Mastny [ctb], Aaron Peikert [ctb] (), Mark van der Loo [ctb] (), Chris Muir [ctb] (), Moritz Beller [ctb] (), Sebastian Campbell [ctb], Winston Chang [ctb] (), Dean Attali [ctb] (), Michael Chirico [ctb] (), Kevin Ushey [ctb]", + "Maintainer": "Dirk Eddelbuettel ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "downlit": { + "Package": "downlit", + "Version": "0.4.4", + "Source": "Repository", + "Title": "Syntax Highlighting and Automatic Linking", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Syntax highlighting of R code, specifically designed for the needs of 'RMarkdown' packages like 'pkgdown', 'hugodown', and 'bookdown'. It includes linking of function calls to their documentation on the web, and automatic translation of ANSI escapes in output to the equivalent HTML.", + "License": "MIT + file LICENSE", + "URL": "https://downlit.r-lib.org/, https://github.com/r-lib/downlit", + "BugReports": "https://github.com/r-lib/downlit/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Imports": [ + "brio", + "desc", + "digest", + "evaluate", + "fansi", + "memoise", + "rlang", + "vctrs", + "withr", + "yaml" + ], + "Suggests": [ + "covr", + "htmltools", + "jsonlite", + "MASS", + "MassSpecWavelet", + "pkgload", + "rmarkdown", + "testthat (>= 3.0.0)", + "xml2" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" + }, + "dplyr": { + "Package": "dplyr", + "Version": "1.1.4", + "Source": "Repository", + "Type": "Package", + "Title": "A Grammar of Data Manipulation", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Romain\", \"François\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Lionel\", \"Henry\", role = \"aut\"), person(\"Kirill\", \"Müller\", role = \"aut\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4777-038X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A fast, consistent tool for working with data frame like objects, both in memory and out of memory.", + "License": "MIT + file LICENSE", + "URL": "https://dplyr.tidyverse.org, https://github.com/tidyverse/dplyr", + "BugReports": "https://github.com/tidyverse/dplyr/issues", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "generics", + "glue (>= 1.3.2)", + "lifecycle (>= 1.0.3)", + "magrittr (>= 1.5)", + "methods", + "pillar (>= 1.9.0)", + "R6", + "rlang (>= 1.1.0)", + "tibble (>= 3.2.0)", + "tidyselect (>= 1.2.0)", + "utils", + "vctrs (>= 0.6.4)" + ], + "Suggests": [ + "bench", + "broom", + "callr", + "covr", + "DBI", + "dbplyr (>= 2.2.1)", + "ggplot2", + "knitr", + "Lahman", + "lobstr", + "microbenchmark", + "nycflights13", + "purrr", + "rmarkdown", + "RMySQL", + "RPostgreSQL", + "RSQLite", + "stringi (>= 1.7.6)", + "testthat (>= 3.1.5)", + "tidyr (>= 1.3.0)", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse, shiny, pkgdown, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre] (), Romain François [aut] (), Lionel Henry [aut], Kirill Müller [aut] (), Davis Vaughan [aut] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "https://p3m.dev/cran/latest" + }, + "evaluate": { + "Package": "evaluate", + "Version": "1.0.4", + "Source": "Repository", + "Type": "Package", + "Title": "Parsing and Evaluation Tools that Provide More Details than the Default", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Yihui\", \"Xie\", role = \"aut\", comment = c(ORCID = \"0000-0003-0645-5666\")), person(\"Michael\", \"Lawrence\", role = \"ctb\"), person(\"Thomas\", \"Kluyver\", role = \"ctb\"), person(\"Jeroen\", \"Ooms\", role = \"ctb\"), person(\"Barret\", \"Schloerke\", role = \"ctb\"), person(\"Adam\", \"Ryczkowski\", role = \"ctb\"), person(\"Hiroaki\", \"Yutani\", role = \"ctb\"), person(\"Michel\", \"Lang\", role = \"ctb\"), person(\"Karolis\", \"Koncevičius\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Parsing and evaluation tools that make it easy to recreate the command line behaviour of R.", + "License": "MIT + file LICENSE", + "URL": "https://evaluate.r-lib.org/, https://github.com/r-lib/evaluate", + "BugReports": "https://github.com/r-lib/evaluate/issues", + "Depends": [ + "R (>= 3.6.0)" + ], + "Suggests": [ + "callr", + "covr", + "ggplot2 (>= 3.3.6)", + "lattice", + "methods", + "pkgload", + "ragg (>= 1.4.0)", + "rlang (>= 1.1.5)", + "knitr", + "testthat (>= 3.0.0)", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre], Yihui Xie [aut] (ORCID: ), Michael Lawrence [ctb], Thomas Kluyver [ctb], Jeroen Ooms [ctb], Barret Schloerke [ctb], Adam Ryczkowski [ctb], Hiroaki Yutani [ctb], Michel Lang [ctb], Karolis Koncevičius [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM" + }, + "extrafont": { + "Package": "extrafont", + "Version": "0.19", + "Source": "Repository", + "Title": "Tools for Using Fonts", + "Author": "Winston Chang ", + "Maintainer": "Winston Chang ", + "Description": "Tools to using fonts other than the standard PostScript fonts. This package makes it easy to use system TrueType fonts and with PDF or PostScript output files, and with bitmap output files in Windows. extrafont can also be used with fonts packaged specifically to be used with, such as the fontcm package, which has Computer Modern PostScript fonts with math symbols.", + "Depends": [ + "R (>= 2.15)" + ], + "Imports": [ + "extrafontdb", + "grDevices", + "utils", + "Rttf2pt1" + ], + "Suggests": [ + "fontcm" + ], + "License": "GPL-2", + "URL": "https://github.com/wch/extrafont", + "RoxygenNote": "7.1.2", + "NeedsCompilation": "no", + "Repository": "CRAN", + "Encoding": "UTF-8" + }, + "extrafontdb": { + "Package": "extrafontdb", + "Version": "1.0", + "Source": "Repository", + "Title": "Package for holding the database for the extrafont package", + "Author": "Winston Chang ", + "Maintainer": "Winston Chang ", + "Description": "Package for holding the database for the extrafont package", + "Depends": [ + "R (>= 2.14)" + ], + "License": "GPL-2", + "URL": "https://github.com/wch/extrafontdb", + "Collate": "'extrafontdb.r'", + "Repository": "CRAN", + "Encoding": "UTF-8" + }, + "fansi": { + "Package": "fansi", + "Version": "1.0.6", + "Source": "Repository", + "Title": "ANSI Control Sequence Aware String Functions", + "Description": "Counterparts to R string manipulation functions that account for the effects of ANSI text formatting control sequences.", + "Authors@R": "c( person(\"Brodie\", \"Gaslam\", email=\"brodie.gaslam@yahoo.com\", role=c(\"aut\", \"cre\")), person(\"Elliott\", \"Sales De Andrade\", role=\"ctb\"), person(family=\"R Core Team\", email=\"R-core@r-project.org\", role=\"cph\", comment=\"UTF8 byte length calcs from src/util.c\" ))", + "Depends": [ + "R (>= 3.1.0)" + ], + "License": "GPL-2 | GPL-3", + "URL": "https://github.com/brodieG/fansi", + "BugReports": "https://github.com/brodieG/fansi/issues", + "VignetteBuilder": "knitr", + "Suggests": [ + "unitizer", + "knitr", + "rmarkdown" + ], + "Imports": [ + "grDevices", + "utils" + ], + "RoxygenNote": "7.2.3", + "Encoding": "UTF-8", + "Collate": "'constants.R' 'fansi-package.R' 'internal.R' 'load.R' 'misc.R' 'nchar.R' 'strwrap.R' 'strtrim.R' 'strsplit.R' 'substr2.R' 'trimws.R' 'tohtml.R' 'unhandled.R' 'normalize.R' 'sgr.R'", + "NeedsCompilation": "yes", + "Author": "Brodie Gaslam [aut, cre], Elliott Sales De Andrade [ctb], R Core Team [cph] (UTF8 byte length calcs from src/util.c)", + "Maintainer": "Brodie Gaslam ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "farver": { + "Package": "farver", + "Version": "2.1.2", + "Source": "Repository", + "Type": "Package", + "Title": "High Performance Colour Space Manipulation", + "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Berendea\", \"Nicolae\", role = \"aut\", comment = \"Author of the ColorSpace C++ library\"), person(\"Romain\", \"François\", , \"romain@purrple.cat\", role = \"aut\", comment = c(ORCID = \"0000-0002-2444-4226\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "The encoding of colour can be handled in many different ways, using different colour spaces. As different colour spaces have different uses, efficient conversion between these representations are important. The 'farver' package provides a set of functions that gives access to very fast colour space conversion and comparisons implemented in C++, and offers speed improvements over the 'convertColor' function in the 'grDevices' package.", + "License": "MIT + file LICENSE", + "URL": "https://farver.data-imaginist.com, https://github.com/thomasp85/farver", + "BugReports": "https://github.com/thomasp85/farver/issues", + "Suggests": [ + "covr", + "testthat (>= 3.0.0)" + ], + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "NeedsCompilation": "yes", + "Author": "Thomas Lin Pedersen [cre, aut] (), Berendea Nicolae [aut] (Author of the ColorSpace C++ library), Romain François [aut] (), Posit, PBC [cph, fnd]", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "fastmap": { + "Package": "fastmap", + "Version": "1.2.0", + "Source": "Repository", + "Title": "Fast Data Structures", + "Authors@R": "c( person(\"Winston\", \"Chang\", email = \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(given = \"Tessil\", role = \"cph\", comment = \"hopscotch_map library\") )", + "Description": "Fast implementation of data structures, including a key-value store, stack, and queue. Environments are commonly used as key-value stores in R, but every time a new key is used, it is added to R's global symbol table, causing a small amount of memory leakage. This can be problematic in cases where many different keys are used. Fastmap avoids this memory leak issue by implementing the map using data structures in C++.", + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "Suggests": [ + "testthat (>= 2.1.1)" + ], + "URL": "https://r-lib.github.io/fastmap/, https://github.com/r-lib/fastmap", + "BugReports": "https://github.com/r-lib/fastmap/issues", + "NeedsCompilation": "yes", + "Author": "Winston Chang [aut, cre], Posit Software, PBC [cph, fnd], Tessil [cph] (hopscotch_map library)", + "Maintainer": "Winston Chang ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "fontawesome": { + "Package": "fontawesome", + "Version": "0.5.3", + "Source": "Repository", + "Type": "Package", + "Title": "Easily Work with 'Font Awesome' Icons", + "Description": "Easily and flexibly insert 'Font Awesome' icons into 'R Markdown' documents and 'Shiny' apps. These icons can be inserted into HTML content through inline 'SVG' tags or 'i' tags. There is also a utility function for exporting 'Font Awesome' icons as 'PNG' images for those situations where raster graphics are needed.", + "Authors@R": "c( person(\"Richard\", \"Iannone\", , \"rich@posit.co\", c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-3925-190X\")), person(\"Christophe\", \"Dervieux\", , \"cderv@posit.co\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4474-2498\")), person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = \"ctb\"), person(\"Dave\", \"Gandy\", role = c(\"ctb\", \"cph\"), comment = \"Font-Awesome font\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "License": "MIT + file LICENSE", + "URL": "https://github.com/rstudio/fontawesome, https://rstudio.github.io/fontawesome/", + "BugReports": "https://github.com/rstudio/fontawesome/issues", + "Encoding": "UTF-8", + "ByteCompile": "true", + "RoxygenNote": "7.3.2", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "rlang (>= 1.0.6)", + "htmltools (>= 0.5.1.1)" + ], + "Suggests": [ + "covr", + "dplyr (>= 1.0.8)", + "gt (>= 0.9.0)", + "knitr (>= 1.31)", + "testthat (>= 3.0.0)", + "rsvg" + ], + "Config/testthat/edition": "3", + "NeedsCompilation": "no", + "Author": "Richard Iannone [aut, cre] (), Christophe Dervieux [ctb] (), Winston Chang [ctb], Dave Gandy [ctb, cph] (Font-Awesome font), Posit Software, PBC [cph, fnd]", + "Maintainer": "Richard Iannone ", + "Repository": "RSPM" + }, + "forcats": { + "Package": "forcats", + "Version": "1.0.0", + "Source": "Repository", + "Title": "Tools for Working with Categorical Variables (Factors)", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = c(\"aut\", \"cre\")), person(\"RStudio\", role = c(\"cph\", \"fnd\")) )", + "Description": "Helpers for reordering factor levels (including moving specified levels to front, ordering by first appearance, reversing, and randomly shuffling), and tools for modifying factor levels (including collapsing rare levels into other, 'anonymising', and manually 'recoding').", + "License": "MIT + file LICENSE", + "URL": "https://forcats.tidyverse.org/, https://github.com/tidyverse/forcats", + "BugReports": "https://github.com/tidyverse/forcats/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "glue", + "lifecycle", + "magrittr", + "rlang (>= 1.0.0)", + "tibble" + ], + "Suggests": [ + "covr", + "dplyr", + "ggplot2", + "knitr", + "readr", + "rmarkdown", + "testthat (>= 3.0.0)", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre], RStudio [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM" + }, + "foreign": { + "Package": "foreign", + "Version": "0.8-90", + "Source": "Repository", + "Priority": "recommended", + "Date": "2025-03-31", + "Title": "Read Data Stored by 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat', 'Weka', 'dBase', ...", + "Depends": [ + "R (>= 4.0.0)" + ], + "Imports": [ + "methods", + "utils", + "stats" + ], + "Authors@R": "c( person(\"R Core Team\", email = \"R-core@R-project.org\", role = c(\"aut\", \"cph\", \"cre\"), comment = c(ROR = \"02zz1nj61\")), person(\"Roger\", \"Bivand\", role = c(\"ctb\", \"cph\")), person(c(\"Vincent\", \"J.\"), \"Carey\", role = c(\"ctb\", \"cph\")), person(\"Saikat\", \"DebRoy\", role = c(\"ctb\", \"cph\")), person(\"Stephen\", \"Eglen\", role = c(\"ctb\", \"cph\")), person(\"Rajarshi\", \"Guha\", role = c(\"ctb\", \"cph\")), person(\"Swetlana\", \"Herbrandt\", role = \"ctb\"), person(\"Nicholas\", \"Lewin-Koh\", role = c(\"ctb\", \"cph\")), person(\"Mark\", \"Myatt\", role = c(\"ctb\", \"cph\")), person(\"Michael\", \"Nelson\", role = \"ctb\"), person(\"Ben\", \"Pfaff\", role = \"ctb\"), person(\"Brian\", \"Quistorff\", role = \"ctb\"), person(\"Frank\", \"Warmerdam\", role = c(\"ctb\", \"cph\")), person(\"Stephen\", \"Weigand\", role = c(\"ctb\", \"cph\")), person(\"Free Software Foundation, Inc.\", role = \"cph\"))", + "Contact": "see 'MailingList'", + "Copyright": "see file COPYRIGHTS", + "Description": "Reading and writing data stored by some versions of 'Epi Info', 'Minitab', 'S', 'SAS', 'SPSS', 'Stata', 'Systat', 'Weka', and for reading and writing some 'dBase' files.", + "ByteCompile": "yes", + "Biarch": "yes", + "License": "GPL (>= 2)", + "BugReports": "https://bugs.r-project.org", + "MailingList": "R-help@r-project.org", + "URL": "https://svn.r-project.org/R-packages/trunk/foreign/", + "NeedsCompilation": "yes", + "Author": "R Core Team [aut, cph, cre] (02zz1nj61), Roger Bivand [ctb, cph], Vincent J. Carey [ctb, cph], Saikat DebRoy [ctb, cph], Stephen Eglen [ctb, cph], Rajarshi Guha [ctb, cph], Swetlana Herbrandt [ctb], Nicholas Lewin-Koh [ctb, cph], Mark Myatt [ctb, cph], Michael Nelson [ctb], Ben Pfaff [ctb], Brian Quistorff [ctb], Frank Warmerdam [ctb, cph], Stephen Weigand [ctb, cph], Free Software Foundation, Inc. [cph]", + "Maintainer": "R Core Team ", + "Repository": "CRAN" + }, + "fs": { + "Package": "fs", + "Version": "1.6.6", + "Source": "Repository", + "Title": "Cross-Platform File System Operations Based on 'libuv'", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"libuv project contributors\", role = \"cph\", comment = \"libuv library\"), person(\"Joyent, Inc. and other Node contributors\", role = \"cph\", comment = \"libuv library\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A cross-platform interface to file system operations, built on top of the 'libuv' C library.", + "License": "MIT + file LICENSE", + "URL": "https://fs.r-lib.org, https://github.com/r-lib/fs", + "BugReports": "https://github.com/r-lib/fs/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "covr", + "crayon", + "knitr", + "pillar (>= 1.0.0)", + "rmarkdown", + "spelling", + "testthat (>= 3.0.0)", + "tibble (>= 1.1.0)", + "vctrs (>= 0.3.0)", + "withr" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Copyright": "file COPYRIGHTS", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.2.3", + "SystemRequirements": "GNU make", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut], Hadley Wickham [aut], Gábor Csárdi [aut, cre], libuv project contributors [cph] (libuv library), Joyent, Inc. and other Node contributors [cph] (libuv library), Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "generics": { + "Package": "generics", + "Version": "0.1.4", + "Source": "Repository", + "Title": "Common S3 Generics not Provided by Base R Methods Related to Model Fitting", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Max\", \"Kuhn\", , \"max@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"https://ror.org/03wc8by49\")) )", + "Description": "In order to reduce potential package dependencies and conflicts, generics provides a number of commonly used S3 generics.", + "License": "MIT + file LICENSE", + "URL": "https://generics.r-lib.org, https://github.com/r-lib/generics", + "BugReports": "https://github.com/r-lib/generics/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "covr", + "pkgload", + "testthat (>= 3.0.0)", + "tibble", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre] (ORCID: ), Max Kuhn [aut], Davis Vaughan [aut], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Hadley Wickham ", + "Repository": "https://p3m.dev/cran/latest" + }, + "ggalluvial": { + "Package": "ggalluvial", + "Version": "0.12.5", + "Source": "Repository", + "Type": "Package", + "Title": "Alluvial Plots in 'ggplot2'", + "Authors@R": "c( person(given = \"Jason Cory\", family = \"Brunson\", role = c(\"aut\", \"cre\"), email = \"cornelioid@gmail.com\"), person(given = \"Quentin D.\", family = \"Read\", role = 'aut'))", + "Maintainer": "Jason Cory Brunson ", + "Description": "Alluvial plots use variable-width ribbons and stacked bar plots to represent multi-dimensional or repeated-measures data with categorical or ordinal variables; see Riehmann, Hanfler, and Froehlich (2005) and Rosvall and Bergstrom (2010) . Alluvial plots are statistical graphics in the sense of Wilkinson (2006) ; they share elements with Sankey diagrams and parallel sets plots but are uniquely determined from the data and a small set of parameters. This package extends Wickham's (2010) layered grammar of graphics to generate alluvial plots from tidy data.", + "Depends": [ + "R (>= 3.6)", + "ggplot2 (>= 2.2)" + ], + "Imports": [ + "stats", + "dplyr (>= 0.7)", + "tidyr (>= 0.7)", + "lazyeval", + "rlang", + "tidyselect" + ], + "Suggests": [ + "grid", + "alluvial", + "testthat", + "knitr", + "rmarkdown", + "babynames", + "sessioninfo", + "ggrepel", + "shiny (>= 1.4.0.2)", + "htmltools", + "sp (>= 1.4-0)", + "ggfittext (>= 0.6)", + "vdiffr (>= 0.2)" + ], + "License": "GPL-3", + "LazyData": "true", + "URL": "http://corybrunson.github.io/ggalluvial/", + "BugReports": "https://github.com/corybrunson/ggalluvial/issues", + "VignetteBuilder": "knitr", + "RoxygenNote": "7.2.3", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Jason Cory Brunson [aut, cre], Quentin D. Read [aut]", + "Repository": "CRAN" + }, + "ggplot2": { + "Package": "ggplot2", + "Version": "3.5.2", + "Source": "Repository", + "Title": "Create Elegant Data Visualisations Using the Grammar of Graphics", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Winston\", \"Chang\", role = \"aut\", comment = c(ORCID = \"0000-0002-1576-2126\")), person(\"Lionel\", \"Henry\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Kohske\", \"Takahashi\", role = \"aut\"), person(\"Claus\", \"Wilke\", role = \"aut\", comment = c(ORCID = \"0000-0002-7470-9261\")), person(\"Kara\", \"Woo\", role = \"aut\", comment = c(ORCID = \"0000-0002-5125-4188\")), person(\"Hiroaki\", \"Yutani\", role = \"aut\", comment = c(ORCID = \"0000-0002-3385-7233\")), person(\"Dewey\", \"Dunnington\", role = \"aut\", comment = c(ORCID = \"0000-0002-9415-4582\")), person(\"Teun\", \"van den Brand\", role = \"aut\", comment = c(ORCID = \"0000-0002-9335-7468\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A system for 'declaratively' creating graphics, based on \"The Grammar of Graphics\". You provide the data, tell 'ggplot2' how to map variables to aesthetics, what graphical primitives to use, and it takes care of the details.", + "License": "MIT + file LICENSE", + "URL": "https://ggplot2.tidyverse.org, https://github.com/tidyverse/ggplot2", + "BugReports": "https://github.com/tidyverse/ggplot2/issues", + "Depends": [ + "R (>= 3.5)" + ], + "Imports": [ + "cli", + "glue", + "grDevices", + "grid", + "gtable (>= 0.1.1)", + "isoband", + "lifecycle (> 1.0.1)", + "MASS", + "mgcv", + "rlang (>= 1.1.0)", + "scales (>= 1.3.0)", + "stats", + "tibble", + "vctrs (>= 0.6.0)", + "withr (>= 2.5.0)" + ], + "Suggests": [ + "covr", + "dplyr", + "ggplot2movies", + "hexbin", + "Hmisc", + "knitr", + "mapproj", + "maps", + "multcomp", + "munsell", + "nlme", + "profvis", + "quantreg", + "ragg (>= 1.2.6)", + "RColorBrewer", + "rmarkdown", + "rpart", + "sf (>= 0.7-3)", + "svglite (>= 2.1.2)", + "testthat (>= 3.1.2)", + "vdiffr (>= 1.0.6)", + "xml2" + ], + "Enhances": [ + "sp" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "ggtext, tidyr, forcats, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.2", + "Collate": "'ggproto.R' 'ggplot-global.R' 'aaa-.R' 'aes-colour-fill-alpha.R' 'aes-evaluation.R' 'aes-group-order.R' 'aes-linetype-size-shape.R' 'aes-position.R' 'compat-plyr.R' 'utilities.R' 'aes.R' 'utilities-checks.R' 'legend-draw.R' 'geom-.R' 'annotation-custom.R' 'annotation-logticks.R' 'geom-polygon.R' 'geom-map.R' 'annotation-map.R' 'geom-raster.R' 'annotation-raster.R' 'annotation.R' 'autolayer.R' 'autoplot.R' 'axis-secondary.R' 'backports.R' 'bench.R' 'bin.R' 'coord-.R' 'coord-cartesian-.R' 'coord-fixed.R' 'coord-flip.R' 'coord-map.R' 'coord-munch.R' 'coord-polar.R' 'coord-quickmap.R' 'coord-radial.R' 'coord-sf.R' 'coord-transform.R' 'data.R' 'docs_layer.R' 'facet-.R' 'facet-grid-.R' 'facet-null.R' 'facet-wrap.R' 'fortify-lm.R' 'fortify-map.R' 'fortify-multcomp.R' 'fortify-spatial.R' 'fortify.R' 'stat-.R' 'geom-abline.R' 'geom-rect.R' 'geom-bar.R' 'geom-bin2d.R' 'geom-blank.R' 'geom-boxplot.R' 'geom-col.R' 'geom-path.R' 'geom-contour.R' 'geom-count.R' 'geom-crossbar.R' 'geom-segment.R' 'geom-curve.R' 'geom-defaults.R' 'geom-ribbon.R' 'geom-density.R' 'geom-density2d.R' 'geom-dotplot.R' 'geom-errorbar.R' 'geom-errorbarh.R' 'geom-freqpoly.R' 'geom-function.R' 'geom-hex.R' 'geom-histogram.R' 'geom-hline.R' 'geom-jitter.R' 'geom-label.R' 'geom-linerange.R' 'geom-point.R' 'geom-pointrange.R' 'geom-quantile.R' 'geom-rug.R' 'geom-sf.R' 'geom-smooth.R' 'geom-spoke.R' 'geom-text.R' 'geom-tile.R' 'geom-violin.R' 'geom-vline.R' 'ggplot2-package.R' 'grob-absolute.R' 'grob-dotstack.R' 'grob-null.R' 'grouping.R' 'theme-elements.R' 'guide-.R' 'guide-axis.R' 'guide-axis-logticks.R' 'guide-axis-stack.R' 'guide-axis-theta.R' 'guide-legend.R' 'guide-bins.R' 'guide-colorbar.R' 'guide-colorsteps.R' 'guide-custom.R' 'layer.R' 'guide-none.R' 'guide-old.R' 'guides-.R' 'guides-grid.R' 'hexbin.R' 'import-standalone-obj-type.R' 'import-standalone-types-check.R' 'labeller.R' 'labels.R' 'layer-sf.R' 'layout.R' 'limits.R' 'margins.R' 'performance.R' 'plot-build.R' 'plot-construction.R' 'plot-last.R' 'plot.R' 'position-.R' 'position-collide.R' 'position-dodge.R' 'position-dodge2.R' 'position-identity.R' 'position-jitter.R' 'position-jitterdodge.R' 'position-nudge.R' 'position-stack.R' 'quick-plot.R' 'reshape-add-margins.R' 'save.R' 'scale-.R' 'scale-alpha.R' 'scale-binned.R' 'scale-brewer.R' 'scale-colour.R' 'scale-continuous.R' 'scale-date.R' 'scale-discrete-.R' 'scale-expansion.R' 'scale-gradient.R' 'scale-grey.R' 'scale-hue.R' 'scale-identity.R' 'scale-linetype.R' 'scale-linewidth.R' 'scale-manual.R' 'scale-shape.R' 'scale-size.R' 'scale-steps.R' 'scale-type.R' 'scale-view.R' 'scale-viridis.R' 'scales-.R' 'stat-align.R' 'stat-bin.R' 'stat-bin2d.R' 'stat-bindot.R' 'stat-binhex.R' 'stat-boxplot.R' 'stat-contour.R' 'stat-count.R' 'stat-density-2d.R' 'stat-density.R' 'stat-ecdf.R' 'stat-ellipse.R' 'stat-function.R' 'stat-identity.R' 'stat-qq-line.R' 'stat-qq.R' 'stat-quantilemethods.R' 'stat-sf-coordinates.R' 'stat-sf.R' 'stat-smooth-methods.R' 'stat-smooth.R' 'stat-sum.R' 'stat-summary-2d.R' 'stat-summary-bin.R' 'stat-summary-hex.R' 'stat-summary.R' 'stat-unique.R' 'stat-ydensity.R' 'summarise-plot.R' 'summary.R' 'theme.R' 'theme-defaults.R' 'theme-current.R' 'utilities-break.R' 'utilities-grid.R' 'utilities-help.R' 'utilities-matrix.R' 'utilities-patterns.R' 'utilities-resolution.R' 'utilities-tidy-eval.R' 'zxx.R' 'zzz.R'", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut] (), Winston Chang [aut] (), Lionel Henry [aut], Thomas Lin Pedersen [aut, cre] (), Kohske Takahashi [aut], Claus Wilke [aut] (), Kara Woo [aut] (), Hiroaki Yutani [aut] (), Dewey Dunnington [aut] (), Teun van den Brand [aut] (), Posit, PBC [cph, fnd]", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM" + }, + "ggrepel": { + "Package": "ggrepel", + "Version": "0.9.6", + "Source": "Repository", + "Authors@R": "c( person(\"Kamil\", \"Slowikowski\", email = \"kslowikowski@gmail.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-2843-6370\")), person(\"Alicia\", \"Schep\", role = \"ctb\", comment = c(ORCID = \"0000-0002-3915-0618\")), person(\"Sean\", \"Hughes\", role = \"ctb\", comment = c(ORCID = \"0000-0002-9409-9405\")), person(\"Trung Kien\", \"Dang\", role = \"ctb\", comment = c(ORCID = \"0000-0001-7562-6495\")), person(\"Saulius\", \"Lukauskas\", role = \"ctb\"), person(\"Jean-Olivier\", \"Irisson\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4920-3880\")), person(\"Zhian N\", \"Kamvar\", role = \"ctb\", comment = c(ORCID = \"0000-0003-1458-7108\")), person(\"Thompson\", \"Ryan\", role = \"ctb\", comment = c(ORCID = \"0000-0002-0450-8181\")), person(\"Dervieux\", \"Christophe\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4474-2498\")), person(\"Yutani\", \"Hiroaki\", role = \"ctb\"), person(\"Pierre\", \"Gramme\", role = \"ctb\"), person(\"Amir Masoud\", \"Abdol\", role = \"ctb\"), person(\"Malcolm\", \"Barrett\", role = \"ctb\", comment = c(ORCID = \"0000-0003-0299-5825\")), person(\"Robrecht\", \"Cannoodt\", role = \"ctb\", comment = c(ORCID = \"0000-0003-3641-729X\")), person(\"Michał\", \"Krassowski\", role = \"ctb\", comment = c(ORCID = \"0000-0002-9638-7785\")), person(\"Michael\", \"Chirico\", role = \"ctb\", comment = c(ORCID = \"0000-0003-0787-087X\")), person(\"Pedro\", \"Aphalo\", role = \"ctb\", comment = c(ORCID = \"0000-0003-3385-972X\")), person(\"Francis\", \"Barton\", role = \"ctb\") )", + "Title": "Automatically Position Non-Overlapping Text Labels with 'ggplot2'", + "Description": "Provides text and label geoms for 'ggplot2' that help to avoid overlapping text labels. Labels repel away from each other and away from the data points.", + "Depends": [ + "R (>= 3.0.0)", + "ggplot2 (>= 2.2.0)" + ], + "Imports": [ + "grid", + "Rcpp", + "rlang (>= 0.3.0)", + "scales (>= 0.5.0)", + "withr (>= 2.5.0)" + ], + "Suggests": [ + "knitr", + "rmarkdown", + "testthat", + "svglite", + "vdiffr", + "gridExtra", + "ggpp", + "patchwork", + "devtools", + "prettydoc", + "ggbeeswarm", + "dplyr", + "magrittr", + "readr", + "stringr" + ], + "VignetteBuilder": "knitr", + "License": "GPL-3 | file LICENSE", + "URL": "https://ggrepel.slowkow.com/, https://github.com/slowkow/ggrepel", + "BugReports": "https://github.com/slowkow/ggrepel/issues", + "RoxygenNote": "7.3.1", + "LinkingTo": [ + "Rcpp" + ], + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Kamil Slowikowski [aut, cre] (), Alicia Schep [ctb] (), Sean Hughes [ctb] (), Trung Kien Dang [ctb] (), Saulius Lukauskas [ctb], Jean-Olivier Irisson [ctb] (), Zhian N Kamvar [ctb] (), Thompson Ryan [ctb] (), Dervieux Christophe [ctb] (), Yutani Hiroaki [ctb], Pierre Gramme [ctb], Amir Masoud Abdol [ctb], Malcolm Barrett [ctb] (), Robrecht Cannoodt [ctb] (), Michał Krassowski [ctb] (), Michael Chirico [ctb] (), Pedro Aphalo [ctb] (), Francis Barton [ctb]", + "Maintainer": "Kamil Slowikowski ", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "ggtext": { + "Package": "ggtext", + "Version": "0.1.2", + "Source": "Repository", + "Type": "Package", + "Title": "Improved Text Rendering Support for 'ggplot2'", + "Authors@R": "c( person( given = \"Claus O.\", family = \"Wilke\", role = c(\"aut\"), email = \"wilke@austin.utexas.edu\", comment = c(ORCID = \"0000-0002-7470-9261\") ), person( given = \"Brenton M.\", family = \"Wiernik\", role = c(\"aut\", \"cre\"), email = \"brenton@wiernik.org\", comment = c(ORCID = \"0000-0001-9560-6336\", Twitter = \"@bmwiernik\") ) )", + "Description": "A 'ggplot2' extension that enables the rendering of complex formatted plot labels (titles, subtitles, facet labels, axis labels, etc.). Text boxes with automatic word wrap are also supported.", + "URL": "https://wilkelab.org/ggtext/", + "BugReports": "https://github.com/wilkelab/ggtext/issues", + "License": "GPL-2", + "Depends": [ + "R (>= 3.5)" + ], + "Imports": [ + "ggplot2 (>= 3.3.0)", + "grid", + "gridtext", + "rlang", + "scales" + ], + "Suggests": [ + "cowplot", + "dplyr", + "glue", + "knitr", + "rmarkdown", + "testthat", + "vdiffr" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.1.1", + "VignetteBuilder": "knitr", + "NeedsCompilation": "no", + "Author": "Claus O. Wilke [aut] (), Brenton M. Wiernik [aut, cre] (, @bmwiernik)", + "Maintainer": "Brenton M. Wiernik ", + "Repository": "RSPM" + }, + "glue": { + "Package": "glue", + "Version": "1.8.0", + "Source": "Repository", + "Title": "Interpreted String Literals", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "An implementation of interpreted string literals, inspired by Python's Literal String Interpolation and Docstrings and Julia's Triple-Quoted String Literals .", + "License": "MIT + file LICENSE", + "URL": "https://glue.tidyverse.org/, https://github.com/tidyverse/glue", + "BugReports": "https://github.com/tidyverse/glue/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "methods" + ], + "Suggests": [ + "crayon", + "DBI (>= 1.2.0)", + "dplyr", + "knitr", + "magrittr", + "rlang", + "rmarkdown", + "RSQLite", + "testthat (>= 3.2.0)", + "vctrs (>= 0.3.0)", + "waldo (>= 0.5.3)", + "withr" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/Needs/website": "bench, forcats, ggbeeswarm, ggplot2, R.utils, rprintf, tidyr, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut] (), Jennifer Bryan [aut, cre] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Jennifer Bryan ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "gridExtra": { + "Package": "gridExtra", + "Version": "2.3", + "Source": "Repository", + "Authors@R": "c(person(\"Baptiste\", \"Auguie\", email = \"baptiste.auguie@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Anton\", \"Antonov\", email = \"tonytonov@gmail.com\", role = c(\"ctb\")))", + "License": "GPL (>= 2)", + "Title": "Miscellaneous Functions for \"Grid\" Graphics", + "Type": "Package", + "Description": "Provides a number of user-level functions to work with \"grid\" graphics, notably to arrange multiple grid-based plots on a page, and draw tables.", + "VignetteBuilder": "knitr", + "Imports": [ + "gtable", + "grid", + "grDevices", + "graphics", + "utils" + ], + "Suggests": [ + "ggplot2", + "egg", + "lattice", + "knitr", + "testthat" + ], + "RoxygenNote": "6.0.1", + "NeedsCompilation": "no", + "Author": "Baptiste Auguie [aut, cre], Anton Antonov [ctb]", + "Maintainer": "Baptiste Auguie ", + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "gridtext": { + "Package": "gridtext", + "Version": "0.1.5", + "Source": "Repository", + "Type": "Package", + "Title": "Improved Text Rendering Support for 'Grid' Graphics", + "Authors@R": "c( person( given = \"Claus O.\", family = \"Wilke\", role = c(\"aut\"), email = \"wilke@austin.utexas.edu\", comment = c(ORCID = \"0000-0002-7470-9261\") ), person( given = \"Brenton M.\", family = \"Wiernik\", role = c(\"aut\", \"cre\"), email = \"brenton@wiernik.org\", comment = c(ORCID = \"0000-0001-9560-6336\", Twitter = \"@bmwiernik\") ) )", + "Description": "Provides support for rendering of formatted text using 'grid' graphics. Text can be formatted via a minimal subset of 'Markdown', 'HTML', and inline 'CSS' directives, and it can be rendered both with and without word wrap.", + "URL": "https://wilkelab.org/gridtext/", + "BugReports": "https://github.com/wilkelab/gridtext/issues", + "License": "MIT + file LICENSE", + "Depends": [ + "R (>= 3.5)" + ], + "Imports": [ + "curl", + "grid", + "grDevices", + "markdown", + "rlang", + "Rcpp", + "png", + "jpeg", + "stringr", + "xml2" + ], + "Suggests": [ + "covr", + "knitr", + "rmarkdown", + "testthat", + "vdiffr" + ], + "LinkingTo": [ + "Rcpp" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.1.1", + "SystemRequirements": "C++11", + "NeedsCompilation": "yes", + "Author": "Claus O. Wilke [aut] (), Brenton M. Wiernik [aut, cre] (, @bmwiernik)", + "Maintainer": "Brenton M. Wiernik ", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "gtable": { + "Package": "gtable", + "Version": "0.3.6", + "Source": "Repository", + "Title": "Arrange 'Grobs' in Tables", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools to make it easier to work with \"tables\" of 'grobs'. The 'gtable' package defines a 'gtable' grob class that specifies a grid along with a list of grobs and their placement in the grid. Further the package makes it easy to manipulate and combine 'gtable' objects so that complex compositions can be built up sequentially.", + "License": "MIT + file LICENSE", + "URL": "https://gtable.r-lib.org, https://github.com/r-lib/gtable", + "BugReports": "https://github.com/r-lib/gtable/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ + "cli", + "glue", + "grid", + "lifecycle", + "rlang (>= 1.1.0)", + "stats" + ], + "Suggests": [ + "covr", + "ggplot2", + "knitr", + "profvis", + "rmarkdown", + "testthat (>= 3.0.0)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2024-10-25", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM" + }, + "haven": { + "Package": "haven", + "Version": "2.5.5", + "Source": "Repository", + "Title": "Import and Export 'SPSS', 'Stata' and 'SAS' Files", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Evan\", \"Miller\", role = c(\"aut\", \"cph\"), comment = \"Author of included ReadStat code\"), person(\"Danny\", \"Smith\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Import foreign statistical formats into R via the embedded 'ReadStat' C library, .", + "License": "MIT + file LICENSE", + "URL": "https://haven.tidyverse.org, https://github.com/tidyverse/haven, https://github.com/WizardMac/ReadStat", + "BugReports": "https://github.com/tidyverse/haven/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.0.0)", + "forcats (>= 0.2.0)", + "hms", + "lifecycle", + "methods", + "readr (>= 0.1.0)", + "rlang (>= 0.4.0)", + "tibble", + "tidyselect", + "vctrs (>= 0.3.0)" + ], + "Suggests": [ + "covr", + "crayon", + "fs", + "knitr", + "pillar (>= 1.4.0)", + "rmarkdown", + "testthat (>= 3.0.0)", + "utf8" + ], + "LinkingTo": [ + "cpp11" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "GNU make, zlib: zlib1g-dev (deb), zlib-devel (rpm)", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre], Evan Miller [aut, cph] (Author of included ReadStat code), Danny Smith [aut], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "highr": { + "Package": "highr", + "Version": "0.11", + "Source": "Repository", + "Type": "Package", + "Title": "Syntax Highlighting for R Source Code", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\")), person(\"Yixuan\", \"Qiu\", role = \"aut\"), person(\"Christopher\", \"Gandrud\", role = \"ctb\"), person(\"Qiang\", \"Li\", role = \"ctb\") )", + "Description": "Provides syntax highlighting for R source code. Currently it supports LaTeX and HTML output. Source code of other languages is supported via Andre Simon's highlight package ().", + "Depends": [ + "R (>= 3.3.0)" + ], + "Imports": [ + "xfun (>= 0.18)" + ], + "Suggests": [ + "knitr", + "markdown", + "testit" + ], + "License": "GPL", + "URL": "https://github.com/yihui/highr", + "BugReports": "https://github.com/yihui/highr/issues", + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut, cre] (), Yixuan Qiu [aut], Christopher Gandrud [ctb], Qiang Li [ctb]", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM" + }, + "hms": { + "Package": "hms", + "Version": "1.1.3", + "Source": "Repository", + "Title": "Pretty Time of Day", + "Date": "2023-03-21", + "Authors@R": "c( person(\"Kirill\", \"Müller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(\"R Consortium\", role = \"fnd\"), person(\"RStudio\", role = \"fnd\") )", + "Description": "Implements an S3 class for storing and formatting time-of-day values, based on the 'difftime' class.", + "Imports": [ + "lifecycle", + "methods", + "pkgconfig", + "rlang (>= 1.0.2)", + "vctrs (>= 0.3.8)" + ], + "Suggests": [ + "crayon", + "lubridate", + "pillar (>= 1.1.0)", + "testthat (>= 3.0.0)" + ], + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "URL": "https://hms.tidyverse.org/, https://github.com/tidyverse/hms", + "BugReports": "https://github.com/tidyverse/hms/issues", + "RoxygenNote": "7.2.3", + "Config/testthat/edition": "3", + "Config/autostyle/scope": "line_breaks", + "Config/autostyle/strict": "false", + "Config/Needs/website": "tidyverse/tidytemplate", + "NeedsCompilation": "no", + "Author": "Kirill Müller [aut, cre] (), R Consortium [fnd], RStudio [fnd]", + "Maintainer": "Kirill Müller ", + "Repository": "https://p3m.dev/cran/latest" + }, + "htmltools": { + "Package": "htmltools", + "Version": "0.5.8.1", + "Source": "Repository", + "Type": "Package", + "Title": "Tools for HTML", + "Authors@R": "c( person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = \"aut\"), person(\"Carson\", \"Sievert\", , \"carson@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Barret\", \"Schloerke\", , \"barret@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0001-9986-114X\")), person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0002-1576-2126\")), person(\"Yihui\", \"Xie\", , \"yihui@posit.co\", role = \"aut\"), person(\"Jeff\", \"Allen\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools for HTML generation and output.", + "License": "GPL (>= 2)", + "URL": "https://github.com/rstudio/htmltools, https://rstudio.github.io/htmltools/", + "BugReports": "https://github.com/rstudio/htmltools/issues", + "Depends": [ + "R (>= 2.14.1)" + ], + "Imports": [ + "base64enc", + "digest", + "fastmap (>= 1.1.0)", + "grDevices", + "rlang (>= 1.0.0)", + "utils" + ], + "Suggests": [ + "Cairo", + "markdown", + "ragg", + "shiny", + "testthat", + "withr" + ], + "Enhances": [ + "knitr" + ], + "Config/Needs/check": "knitr", + "Config/Needs/website": "rstudio/quillt, bench", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "Collate": "'colors.R' 'fill.R' 'html_dependency.R' 'html_escape.R' 'html_print.R' 'htmltools-package.R' 'images.R' 'known_tags.R' 'selector.R' 'staticimports.R' 'tag_query.R' 'utils.R' 'tags.R' 'template.R'", + "NeedsCompilation": "yes", + "Author": "Joe Cheng [aut], Carson Sievert [aut, cre] (), Barret Schloerke [aut] (), Winston Chang [aut] (), Yihui Xie [aut], Jeff Allen [aut], Posit Software, PBC [cph, fnd]", + "Maintainer": "Carson Sievert ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "htmlwidgets": { + "Package": "htmlwidgets", + "Version": "1.6.4", + "Source": "Repository", + "Type": "Package", + "Title": "HTML Widgets for R", + "Authors@R": "c( person(\"Ramnath\", \"Vaidyanathan\", role = c(\"aut\", \"cph\")), person(\"Yihui\", \"Xie\", role = \"aut\"), person(\"JJ\", \"Allaire\", role = \"aut\"), person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = \"aut\"), person(\"Carson\", \"Sievert\", , \"carson@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Kenton\", \"Russell\", role = c(\"aut\", \"cph\")), person(\"Ellis\", \"Hughes\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A framework for creating HTML widgets that render in various contexts including the R console, 'R Markdown' documents, and 'Shiny' web applications.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/ramnathv/htmlwidgets", + "BugReports": "https://github.com/ramnathv/htmlwidgets/issues", + "Imports": [ + "grDevices", + "htmltools (>= 0.5.7)", + "jsonlite (>= 0.9.16)", + "knitr (>= 1.8)", + "rmarkdown", + "yaml" + ], + "Suggests": [ + "testthat" + ], + "Enhances": [ + "shiny (>= 1.1)" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Ramnath Vaidyanathan [aut, cph], Yihui Xie [aut], JJ Allaire [aut], Joe Cheng [aut], Carson Sievert [aut, cre] (), Kenton Russell [aut, cph], Ellis Hughes [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Carson Sievert ", + "Repository": "RSPM" + }, + "httpuv": { + "Package": "httpuv", + "Version": "1.6.16", + "Source": "Repository", + "Type": "Package", + "Title": "HTTP and WebSocket Server Library", + "Authors@R": "c( person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit, PBC\", \"fnd\", role = \"cph\"), person(\"Hector\", \"Corrada Bravo\", role = \"ctb\"), person(\"Jeroen\", \"Ooms\", role = \"ctb\"), person(\"Andrzej\", \"Krzemienski\", role = \"cph\", comment = \"optional.hpp\"), person(\"libuv project contributors\", role = \"cph\", comment = \"libuv library, see src/libuv/AUTHORS file\"), person(\"Joyent, Inc. and other Node contributors\", role = \"cph\", comment = \"libuv library, see src/libuv/AUTHORS file; and http-parser library, see src/http-parser/AUTHORS file\"), person(\"Niels\", \"Provos\", role = \"cph\", comment = \"libuv subcomponent: tree.h\"), person(\"Internet Systems Consortium, Inc.\", role = \"cph\", comment = \"libuv subcomponent: inet_pton and inet_ntop, contained in src/libuv/src/inet.c\"), person(\"Alexander\", \"Chemeris\", role = \"cph\", comment = \"libuv subcomponent: stdint-msvc2008.h (from msinttypes)\"), person(\"Google, Inc.\", role = \"cph\", comment = \"libuv subcomponent: pthread-fixes.c\"), person(\"Sony Mobile Communcations AB\", role = \"cph\", comment = \"libuv subcomponent: pthread-fixes.c\"), person(\"Berkeley Software Design Inc.\", role = \"cph\", comment = \"libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c\"), person(\"Kenneth\", \"MacKay\", role = \"cph\", comment = \"libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c\"), person(\"Emergya (Cloud4all, FP7/2007-2013, grant agreement no 289016)\", role = \"cph\", comment = \"libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c\"), person(\"Steve\", \"Reid\", role = \"aut\", comment = \"SHA-1 implementation\"), person(\"James\", \"Brown\", role = \"aut\", comment = \"SHA-1 implementation\"), person(\"Bob\", \"Trower\", role = \"aut\", comment = \"base64 implementation\"), person(\"Alexander\", \"Peslyak\", role = \"aut\", comment = \"MD5 implementation\"), person(\"Trantor Standard Systems\", role = \"cph\", comment = \"base64 implementation\"), person(\"Igor\", \"Sysoev\", role = \"cph\", comment = \"http-parser\") )", + "Description": "Provides low-level socket and protocol support for handling HTTP and WebSocket requests directly from within R. It is primarily intended as a building block for other packages, rather than making it particularly easy to create complete web applications using httpuv alone. httpuv is built on top of the libuv and http-parser C libraries, both of which were developed by Joyent, Inc. (See LICENSE file for libuv and http-parser license information.)", + "License": "GPL (>= 2) | file LICENSE", + "URL": "https://github.com/rstudio/httpuv", + "BugReports": "https://github.com/rstudio/httpuv/issues", + "Depends": [ + "R (>= 2.15.1)" + ], + "Imports": [ + "later (>= 0.8.0)", + "promises", + "R6", + "Rcpp (>= 1.0.7)", + "utils" + ], + "Suggests": [ + "callr", + "curl", + "jsonlite", + "testthat", + "websocket" + ], + "LinkingTo": [ + "later", + "Rcpp" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "GNU make, zlib", + "Collate": "'RcppExports.R' 'httpuv.R' 'random_port.R' 'server.R' 'staticServer.R' 'static_paths.R' 'utils.R'", + "NeedsCompilation": "yes", + "Author": "Joe Cheng [aut], Winston Chang [aut, cre], Posit, PBC fnd [cph], Hector Corrada Bravo [ctb], Jeroen Ooms [ctb], Andrzej Krzemienski [cph] (optional.hpp), libuv project contributors [cph] (libuv library, see src/libuv/AUTHORS file), Joyent, Inc. and other Node contributors [cph] (libuv library, see src/libuv/AUTHORS file; and http-parser library, see src/http-parser/AUTHORS file), Niels Provos [cph] (libuv subcomponent: tree.h), Internet Systems Consortium, Inc. [cph] (libuv subcomponent: inet_pton and inet_ntop, contained in src/libuv/src/inet.c), Alexander Chemeris [cph] (libuv subcomponent: stdint-msvc2008.h (from msinttypes)), Google, Inc. [cph] (libuv subcomponent: pthread-fixes.c), Sony Mobile Communcations AB [cph] (libuv subcomponent: pthread-fixes.c), Berkeley Software Design Inc. [cph] (libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c), Kenneth MacKay [cph] (libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c), Emergya (Cloud4all, FP7/2007-2013, grant agreement no 289016) [cph] (libuv subcomponent: android-ifaddrs.h, android-ifaddrs.c), Steve Reid [aut] (SHA-1 implementation), James Brown [aut] (SHA-1 implementation), Bob Trower [aut] (base64 implementation), Alexander Peslyak [aut] (MD5 implementation), Trantor Standard Systems [cph] (base64 implementation), Igor Sysoev [cph] (http-parser)", + "Maintainer": "Winston Chang ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "httr2": { + "Package": "httr2", + "Version": "1.1.2", + "Source": "Repository", + "Title": "Perform HTTP Requests and Process the Responses", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"Maximilian\", \"Girlich\", role = \"ctb\") )", + "Description": "Tools for creating and modifying HTTP requests, then performing them and processing the results. 'httr2' is a modern re-imagining of 'httr' that uses a pipe-based interface and solves more of the problems that API wrapping packages face.", + "License": "MIT + file LICENSE", + "URL": "https://httr2.r-lib.org, https://github.com/r-lib/httr2", + "BugReports": "https://github.com/r-lib/httr2/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ + "cli (>= 3.0.0)", + "curl (>= 6.2.1)", + "glue", + "lifecycle", + "magrittr", + "openssl", + "R6", + "rappdirs", + "rlang (>= 1.1.0)", + "vctrs (>= 0.6.3)", + "withr" + ], + "Suggests": [ + "askpass", + "bench", + "clipr", + "covr", + "docopt", + "httpuv", + "jose", + "jsonlite", + "knitr", + "later (>= 1.4.0)", + "nanonext", + "paws.common", + "promises", + "rmarkdown", + "testthat (>= 3.1.8)", + "tibble", + "webfakes", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "multi-req, resp-stream, req-perform", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre], Posit Software, PBC [cph, fnd], Maximilian Girlich [ctb]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" + }, + "isoband": { + "Package": "isoband", + "Version": "0.2.7", + "Source": "Repository", + "Title": "Generate Isolines and Isobands from Regularly Spaced Elevation Grids", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Claus O.\", \"Wilke\", , \"wilke@austin.utexas.edu\", role = \"aut\", comment = c(\"Original author\", ORCID = \"0000-0002-7470-9261\")), person(\"Thomas Lin\", \"Pedersen\", , \"thomasp85@gmail.com\", role = \"aut\", comment = c(ORCID = \"0000-0002-5147-4711\")) )", + "Description": "A fast C++ implementation to generate contour lines (isolines) and contour polygons (isobands) from regularly spaced grids containing elevation data.", + "License": "MIT + file LICENSE", + "URL": "https://isoband.r-lib.org", + "BugReports": "https://github.com/r-lib/isoband/issues", + "Imports": [ + "grid", + "utils" + ], + "Suggests": [ + "covr", + "ggplot2", + "knitr", + "magick", + "microbenchmark", + "rmarkdown", + "sf", + "testthat", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "SystemRequirements": "C++11", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre] (), Claus O. Wilke [aut] (Original author, ), Thomas Lin Pedersen [aut] ()", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "jpeg": { + "Package": "jpeg", + "Version": "0.1-11", + "Source": "Repository", + "Title": "Read and write JPEG images", + "Author": "Simon Urbanek [aut, cre, cph] (https://urbanek.org, )", + "Authors@R": "person(\"Simon\", \"Urbanek\", role=c(\"aut\",\"cre\",\"cph\"), email=\"Simon.Urbanek@r-project.org\", comment=c(\"https://urbanek.org\", ORCID=\"0000-0003-2297-1732\"))", + "Maintainer": "Simon Urbanek ", + "Depends": [ + "R (>= 2.9.0)" + ], + "Description": "This package provides an easy and simple way to read, write and display bitmap images stored in the JPEG format. It can read and write both files and in-memory raw vectors.", + "License": "GPL-2 | GPL-3", + "SystemRequirements": "libjpeg", + "URL": "https://www.rforge.net/jpeg/", + "BugReports": "https://github.com/s-u/jpeg/issues", + "NeedsCompilation": "yes", + "Repository": "CRAN", + "Encoding": "UTF-8", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "jquerylib": { + "Package": "jquerylib", + "Version": "0.1.4", + "Source": "Repository", + "Title": "Obtain 'jQuery' as an HTML Dependency Object", + "Authors@R": "c( person(\"Carson\", \"Sievert\", role = c(\"aut\", \"cre\"), email = \"carson@rstudio.com\", comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Joe\", \"Cheng\", role = \"aut\", email = \"joe@rstudio.com\"), person(family = \"RStudio\", role = \"cph\"), person(family = \"jQuery Foundation\", role = \"cph\", comment = \"jQuery library and jQuery UI library\"), person(family = \"jQuery contributors\", role = c(\"ctb\", \"cph\"), comment = \"jQuery library; authors listed in inst/lib/jquery-AUTHORS.txt\") )", + "Description": "Obtain any major version of 'jQuery' () and use it in any webpage generated by 'htmltools' (e.g. 'shiny', 'htmlwidgets', and 'rmarkdown'). Most R users don't need to use this package directly, but other R packages (e.g. 'shiny', 'rmarkdown', etc.) depend on this package to avoid bundling redundant copies of 'jQuery'.", + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "Config/testthat/edition": "3", + "RoxygenNote": "7.0.2", + "Imports": [ + "htmltools" + ], + "Suggests": [ + "testthat" + ], + "NeedsCompilation": "no", + "Author": "Carson Sievert [aut, cre] (), Joe Cheng [aut], RStudio [cph], jQuery Foundation [cph] (jQuery library and jQuery UI library), jQuery contributors [ctb, cph] (jQuery library; authors listed in inst/lib/jquery-AUTHORS.txt)", + "Maintainer": "Carson Sievert ", + "Repository": "RSPM" + }, + "jsonlite": { + "Package": "jsonlite", + "Version": "2.0.0", + "Source": "Repository", + "Title": "A Simple and Robust JSON Parser and Generator for R", + "License": "MIT + file LICENSE", + "Depends": [ + "methods" + ], + "Authors@R": "c( person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Duncan\", \"Temple Lang\", role = \"ctb\"), person(\"Lloyd\", \"Hilaiel\", role = \"cph\", comment=\"author of bundled libyajl\"))", + "URL": "https://jeroen.r-universe.dev/jsonlite https://arxiv.org/abs/1403.2805", + "BugReports": "https://github.com/jeroen/jsonlite/issues", + "Maintainer": "Jeroen Ooms ", + "VignetteBuilder": "knitr, R.rsp", + "Description": "A reasonably fast JSON parser and generator, optimized for statistical data and the web. Offers simple, flexible tools for working with JSON in R, and is particularly powerful for building pipelines and interacting with a web API. The implementation is based on the mapping described in the vignette (Ooms, 2014). In addition to converting JSON data from/to R objects, 'jsonlite' contains functions to stream, validate, and prettify JSON data. The unit tests included with the package verify that all edge cases are encoded and decoded consistently for use with dynamic data in systems and applications.", + "Suggests": [ + "httr", + "vctrs", + "testthat", + "knitr", + "rmarkdown", + "R.rsp", + "sf" + ], + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (), Duncan Temple Lang [ctb], Lloyd Hilaiel [cph] (author of bundled libyajl)", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "knitr": { + "Package": "knitr", + "Version": "1.50", + "Source": "Repository", + "Type": "Package", + "Title": "A General-Purpose Package for Dynamic Report Generation in R", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\", URL = \"https://yihui.org\")), person(\"Abhraneel\", \"Sarma\", role = \"ctb\"), person(\"Adam\", \"Vogt\", role = \"ctb\"), person(\"Alastair\", \"Andrew\", role = \"ctb\"), person(\"Alex\", \"Zvoleff\", role = \"ctb\"), person(\"Amar\", \"Al-Zubaidi\", role = \"ctb\"), person(\"Andre\", \"Simon\", role = \"ctb\", comment = \"the CSS files under inst/themes/ were derived from the Highlight package http://www.andre-simon.de\"), person(\"Aron\", \"Atkins\", role = \"ctb\"), person(\"Aaron\", \"Wolen\", role = \"ctb\"), person(\"Ashley\", \"Manton\", role = \"ctb\"), person(\"Atsushi\", \"Yasumoto\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8335-495X\")), person(\"Ben\", \"Baumer\", role = \"ctb\"), person(\"Brian\", \"Diggs\", role = \"ctb\"), person(\"Brian\", \"Zhang\", role = \"ctb\"), person(\"Bulat\", \"Yapparov\", role = \"ctb\"), person(\"Cassio\", \"Pereira\", role = \"ctb\"), person(\"Christophe\", \"Dervieux\", role = \"ctb\"), person(\"David\", \"Hall\", role = \"ctb\"), person(\"David\", \"Hugh-Jones\", role = \"ctb\"), person(\"David\", \"Robinson\", role = \"ctb\"), person(\"Doug\", \"Hemken\", role = \"ctb\"), person(\"Duncan\", \"Murdoch\", role = \"ctb\"), person(\"Elio\", \"Campitelli\", role = \"ctb\"), person(\"Ellis\", \"Hughes\", role = \"ctb\"), person(\"Emily\", \"Riederer\", role = \"ctb\"), person(\"Fabian\", \"Hirschmann\", role = \"ctb\"), person(\"Fitch\", \"Simeon\", role = \"ctb\"), person(\"Forest\", \"Fang\", role = \"ctb\"), person(c(\"Frank\", \"E\", \"Harrell\", \"Jr\"), role = \"ctb\", comment = \"the Sweavel package at inst/misc/Sweavel.sty\"), person(\"Garrick\", \"Aden-Buie\", role = \"ctb\"), person(\"Gregoire\", \"Detrez\", role = \"ctb\"), person(\"Hadley\", \"Wickham\", role = \"ctb\"), person(\"Hao\", \"Zhu\", role = \"ctb\"), person(\"Heewon\", \"Jeon\", role = \"ctb\"), person(\"Henrik\", \"Bengtsson\", role = \"ctb\"), person(\"Hiroaki\", \"Yutani\", role = \"ctb\"), person(\"Ian\", \"Lyttle\", role = \"ctb\"), person(\"Hodges\", \"Daniel\", role = \"ctb\"), person(\"Jacob\", \"Bien\", role = \"ctb\"), person(\"Jake\", \"Burkhead\", role = \"ctb\"), person(\"James\", \"Manton\", role = \"ctb\"), person(\"Jared\", \"Lander\", role = \"ctb\"), person(\"Jason\", \"Punyon\", role = \"ctb\"), person(\"Javier\", \"Luraschi\", role = \"ctb\"), person(\"Jeff\", \"Arnold\", role = \"ctb\"), person(\"Jenny\", \"Bryan\", role = \"ctb\"), person(\"Jeremy\", \"Ashkenas\", role = c(\"ctb\", \"cph\"), comment = \"the CSS file at inst/misc/docco-classic.css\"), person(\"Jeremy\", \"Stephens\", role = \"ctb\"), person(\"Jim\", \"Hester\", role = \"ctb\"), person(\"Joe\", \"Cheng\", role = \"ctb\"), person(\"Johannes\", \"Ranke\", role = \"ctb\"), person(\"John\", \"Honaker\", role = \"ctb\"), person(\"John\", \"Muschelli\", role = \"ctb\"), person(\"Jonathan\", \"Keane\", role = \"ctb\"), person(\"JJ\", \"Allaire\", role = \"ctb\"), person(\"Johan\", \"Toloe\", role = \"ctb\"), person(\"Jonathan\", \"Sidi\", role = \"ctb\"), person(\"Joseph\", \"Larmarange\", role = \"ctb\"), person(\"Julien\", \"Barnier\", role = \"ctb\"), person(\"Kaiyin\", \"Zhong\", role = \"ctb\"), person(\"Kamil\", \"Slowikowski\", role = \"ctb\"), person(\"Karl\", \"Forner\", role = \"ctb\"), person(c(\"Kevin\", \"K.\"), \"Smith\", role = \"ctb\"), person(\"Kirill\", \"Mueller\", role = \"ctb\"), person(\"Kohske\", \"Takahashi\", role = \"ctb\"), person(\"Lorenz\", \"Walthert\", role = \"ctb\"), person(\"Lucas\", \"Gallindo\", role = \"ctb\"), person(\"Marius\", \"Hofert\", role = \"ctb\"), person(\"Martin\", \"Modrák\", role = \"ctb\"), person(\"Michael\", \"Chirico\", role = \"ctb\"), person(\"Michael\", \"Friendly\", role = \"ctb\"), person(\"Michal\", \"Bojanowski\", role = \"ctb\"), person(\"Michel\", \"Kuhlmann\", role = \"ctb\"), person(\"Miller\", \"Patrick\", role = \"ctb\"), person(\"Nacho\", \"Caballero\", role = \"ctb\"), person(\"Nick\", \"Salkowski\", role = \"ctb\"), person(\"Niels Richard\", \"Hansen\", role = \"ctb\"), person(\"Noam\", \"Ross\", role = \"ctb\"), person(\"Obada\", \"Mahdi\", role = \"ctb\"), person(\"Pavel N.\", \"Krivitsky\", role = \"ctb\", comment=c(ORCID = \"0000-0002-9101-3362\")), person(\"Pedro\", \"Faria\", role = \"ctb\"), person(\"Qiang\", \"Li\", role = \"ctb\"), person(\"Ramnath\", \"Vaidyanathan\", role = \"ctb\"), person(\"Richard\", \"Cotton\", role = \"ctb\"), person(\"Robert\", \"Krzyzanowski\", role = \"ctb\"), person(\"Rodrigo\", \"Copetti\", role = \"ctb\"), person(\"Romain\", \"Francois\", role = \"ctb\"), person(\"Ruaridh\", \"Williamson\", role = \"ctb\"), person(\"Sagiru\", \"Mati\", role = \"ctb\", comment = c(ORCID = \"0000-0003-1413-3974\")), person(\"Scott\", \"Kostyshak\", role = \"ctb\"), person(\"Sebastian\", \"Meyer\", role = \"ctb\"), person(\"Sietse\", \"Brouwer\", role = \"ctb\"), person(c(\"Simon\", \"de\"), \"Bernard\", role = \"ctb\"), person(\"Sylvain\", \"Rousseau\", role = \"ctb\"), person(\"Taiyun\", \"Wei\", role = \"ctb\"), person(\"Thibaut\", \"Assus\", role = \"ctb\"), person(\"Thibaut\", \"Lamadon\", role = \"ctb\"), person(\"Thomas\", \"Leeper\", role = \"ctb\"), person(\"Tim\", \"Mastny\", role = \"ctb\"), person(\"Tom\", \"Torsney-Weir\", role = \"ctb\"), person(\"Trevor\", \"Davis\", role = \"ctb\"), person(\"Viktoras\", \"Veitas\", role = \"ctb\"), person(\"Weicheng\", \"Zhu\", role = \"ctb\"), person(\"Wush\", \"Wu\", role = \"ctb\"), person(\"Zachary\", \"Foster\", role = \"ctb\"), person(\"Zhian N.\", \"Kamvar\", role = \"ctb\", comment = c(ORCID = \"0000-0003-1458-7108\")), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Provides a general-purpose tool for dynamic report generation in R using Literate Programming techniques.", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ + "evaluate (>= 0.15)", + "highr (>= 0.11)", + "methods", + "tools", + "xfun (>= 0.51)", + "yaml (>= 2.1.19)" + ], + "Suggests": [ + "bslib", + "codetools", + "DBI (>= 0.4-1)", + "digest", + "formatR", + "gifski", + "gridSVG", + "htmlwidgets (>= 0.7)", + "jpeg", + "JuliaCall (>= 0.11.1)", + "magick", + "litedown", + "markdown (>= 1.3)", + "png", + "ragg", + "reticulate (>= 1.4)", + "rgl (>= 0.95.1201)", + "rlang", + "rmarkdown", + "sass", + "showtext", + "styler (>= 1.2.0)", + "targets (>= 0.6.0)", + "testit", + "tibble", + "tikzDevice (>= 0.10)", + "tinytex (>= 0.56)", + "webshot", + "rstudioapi", + "svglite" + ], + "License": "GPL", + "URL": "https://yihui.org/knitr/", + "BugReports": "https://github.com/yihui/knitr/issues", + "Encoding": "UTF-8", + "VignetteBuilder": "litedown, knitr", + "SystemRequirements": "Package vignettes based on R Markdown v2 or reStructuredText require Pandoc (http://pandoc.org). The function rst2pdf() requires rst2pdf (https://github.com/rst2pdf/rst2pdf).", + "Collate": "'block.R' 'cache.R' 'citation.R' 'hooks-html.R' 'plot.R' 'utils.R' 'defaults.R' 'concordance.R' 'engine.R' 'highlight.R' 'themes.R' 'header.R' 'hooks-asciidoc.R' 'hooks-chunk.R' 'hooks-extra.R' 'hooks-latex.R' 'hooks-md.R' 'hooks-rst.R' 'hooks-textile.R' 'hooks.R' 'output.R' 'package.R' 'pandoc.R' 'params.R' 'parser.R' 'pattern.R' 'rocco.R' 'spin.R' 'table.R' 'template.R' 'utils-conversion.R' 'utils-rd2html.R' 'utils-string.R' 'utils-sweave.R' 'utils-upload.R' 'utils-vignettes.R' 'zzz.R'", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut, cre] (, https://yihui.org), Abhraneel Sarma [ctb], Adam Vogt [ctb], Alastair Andrew [ctb], Alex Zvoleff [ctb], Amar Al-Zubaidi [ctb], Andre Simon [ctb] (the CSS files under inst/themes/ were derived from the Highlight package http://www.andre-simon.de), Aron Atkins [ctb], Aaron Wolen [ctb], Ashley Manton [ctb], Atsushi Yasumoto [ctb] (), Ben Baumer [ctb], Brian Diggs [ctb], Brian Zhang [ctb], Bulat Yapparov [ctb], Cassio Pereira [ctb], Christophe Dervieux [ctb], David Hall [ctb], David Hugh-Jones [ctb], David Robinson [ctb], Doug Hemken [ctb], Duncan Murdoch [ctb], Elio Campitelli [ctb], Ellis Hughes [ctb], Emily Riederer [ctb], Fabian Hirschmann [ctb], Fitch Simeon [ctb], Forest Fang [ctb], Frank E Harrell Jr [ctb] (the Sweavel package at inst/misc/Sweavel.sty), Garrick Aden-Buie [ctb], Gregoire Detrez [ctb], Hadley Wickham [ctb], Hao Zhu [ctb], Heewon Jeon [ctb], Henrik Bengtsson [ctb], Hiroaki Yutani [ctb], Ian Lyttle [ctb], Hodges Daniel [ctb], Jacob Bien [ctb], Jake Burkhead [ctb], James Manton [ctb], Jared Lander [ctb], Jason Punyon [ctb], Javier Luraschi [ctb], Jeff Arnold [ctb], Jenny Bryan [ctb], Jeremy Ashkenas [ctb, cph] (the CSS file at inst/misc/docco-classic.css), Jeremy Stephens [ctb], Jim Hester [ctb], Joe Cheng [ctb], Johannes Ranke [ctb], John Honaker [ctb], John Muschelli [ctb], Jonathan Keane [ctb], JJ Allaire [ctb], Johan Toloe [ctb], Jonathan Sidi [ctb], Joseph Larmarange [ctb], Julien Barnier [ctb], Kaiyin Zhong [ctb], Kamil Slowikowski [ctb], Karl Forner [ctb], Kevin K. Smith [ctb], Kirill Mueller [ctb], Kohske Takahashi [ctb], Lorenz Walthert [ctb], Lucas Gallindo [ctb], Marius Hofert [ctb], Martin Modrák [ctb], Michael Chirico [ctb], Michael Friendly [ctb], Michal Bojanowski [ctb], Michel Kuhlmann [ctb], Miller Patrick [ctb], Nacho Caballero [ctb], Nick Salkowski [ctb], Niels Richard Hansen [ctb], Noam Ross [ctb], Obada Mahdi [ctb], Pavel N. Krivitsky [ctb] (), Pedro Faria [ctb], Qiang Li [ctb], Ramnath Vaidyanathan [ctb], Richard Cotton [ctb], Robert Krzyzanowski [ctb], Rodrigo Copetti [ctb], Romain Francois [ctb], Ruaridh Williamson [ctb], Sagiru Mati [ctb] (), Scott Kostyshak [ctb], Sebastian Meyer [ctb], Sietse Brouwer [ctb], Simon de Bernard [ctb], Sylvain Rousseau [ctb], Taiyun Wei [ctb], Thibaut Assus [ctb], Thibaut Lamadon [ctb], Thomas Leeper [ctb], Tim Mastny [ctb], Tom Torsney-Weir [ctb], Trevor Davis [ctb], Viktoras Veitas [ctb], Weicheng Zhu [ctb], Wush Wu [ctb], Zachary Foster [ctb], Zhian N. Kamvar [ctb] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM" + }, + "labeling": { + "Package": "labeling", + "Version": "0.4.3", + "Source": "Repository", + "Type": "Package", + "Title": "Axis Labeling", + "Date": "2023-08-29", + "Author": "Justin Talbot,", + "Maintainer": "Nuno Sempere ", + "Description": "Functions which provide a range of axis labeling algorithms.", + "License": "MIT + file LICENSE | Unlimited", + "Collate": "'labeling.R'", + "NeedsCompilation": "no", + "Imports": [ + "stats", + "graphics" + ], + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "later": { + "Package": "later", + "Version": "1.4.2", + "Source": "Repository", + "Type": "Package", + "Title": "Utilities for Scheduling Functions to Execute Later with Event Loops", + "Authors@R": "c( person(\"Winston\", \"Chang\", role = c(\"aut\", \"cre\"), email = \"winston@posit.co\"), person(\"Joe\", \"Cheng\", role = c(\"aut\"), email = \"joe@posit.co\"), person(\"Charlie\", \"Gao\", role = c(\"aut\"), email = \"charlie.gao@shikokuchuo.net\", comment = c(ORCID = \"0000-0002-0750-061X\")), person(family = \"Posit Software, PBC\", role = \"cph\"), person(\"Marcus\", \"Geelnard\", role = c(\"ctb\", \"cph\"), comment = \"TinyCThread library, https://tinycthread.github.io/\"), person(\"Evan\", \"Nemerson\", role = c(\"ctb\", \"cph\"), comment = \"TinyCThread library, https://tinycthread.github.io/\") )", + "Description": "Executes arbitrary R or C functions some time after the current time, after the R execution stack has emptied. The functions are scheduled in an event loop.", + "URL": "https://r-lib.github.io/later/, https://github.com/r-lib/later", + "BugReports": "https://github.com/r-lib/later/issues", + "License": "MIT + file LICENSE", + "Imports": [ + "Rcpp (>= 0.12.9)", + "rlang" + ], + "LinkingTo": [ + "Rcpp" + ], + "RoxygenNote": "7.3.2", + "Suggests": [ + "knitr", + "nanonext", + "R6", + "rmarkdown", + "testthat (>= 2.1.0)" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Winston Chang [aut, cre], Joe Cheng [aut], Charlie Gao [aut] (), Posit Software, PBC [cph], Marcus Geelnard [ctb, cph] (TinyCThread library, https://tinycthread.github.io/), Evan Nemerson [ctb, cph] (TinyCThread library, https://tinycthread.github.io/)", + "Maintainer": "Winston Chang ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "lattice": { + "Package": "lattice", + "Version": "0.22-7", + "Source": "Repository", + "Date": "2025-03-31", + "Priority": "recommended", + "Title": "Trellis Graphics for R", + "Authors@R": "c(person(\"Deepayan\", \"Sarkar\", role = c(\"aut\", \"cre\"), email = \"deepayan.sarkar@r-project.org\", comment = c(ORCID = \"0000-0003-4107-1553\")), person(\"Felix\", \"Andrews\", role = \"ctb\"), person(\"Kevin\", \"Wright\", role = \"ctb\", comment = \"documentation\"), person(\"Neil\", \"Klepeis\", role = \"ctb\"), person(\"Johan\", \"Larsson\", role = \"ctb\", comment = \"miscellaneous improvements\"), person(\"Zhijian (Jason)\", \"Wen\", role = \"cph\", comment = \"filled contour code\"), person(\"Paul\", \"Murrell\", role = \"ctb\", email = \"paul@stat.auckland.ac.nz\"), person(\"Stefan\", \"Eng\", role = \"ctb\", comment = \"violin plot improvements\"), person(\"Achim\", \"Zeileis\", role = \"ctb\", comment = \"modern colors\"), person(\"Alexandre\", \"Courtiol\", role = \"ctb\", comment = \"generics for larrows, lpolygon, lrect and lsegments\") )", + "Description": "A powerful and elegant high-level data visualization system inspired by Trellis graphics, with an emphasis on multivariate data. Lattice is sufficient for typical graphics needs, and is also flexible enough to handle most nonstandard requirements. See ?Lattice for an introduction.", + "Depends": [ + "R (>= 4.0.0)" + ], + "Suggests": [ + "KernSmooth", + "MASS", + "latticeExtra", + "colorspace" + ], + "Imports": [ + "grid", + "grDevices", + "graphics", + "stats", + "utils" + ], + "Enhances": [ + "chron", + "zoo" + ], + "LazyLoad": "yes", + "LazyData": "yes", + "License": "GPL (>= 2)", + "URL": "https://lattice.r-forge.r-project.org/", + "BugReports": "https://github.com/deepayan/lattice/issues", + "NeedsCompilation": "yes", + "Author": "Deepayan Sarkar [aut, cre] (), Felix Andrews [ctb], Kevin Wright [ctb] (documentation), Neil Klepeis [ctb], Johan Larsson [ctb] (miscellaneous improvements), Zhijian (Jason) Wen [cph] (filled contour code), Paul Murrell [ctb], Stefan Eng [ctb] (violin plot improvements), Achim Zeileis [ctb] (modern colors), Alexandre Courtiol [ctb] (generics for larrows, lpolygon, lrect and lsegments)", + "Maintainer": "Deepayan Sarkar ", + "Repository": "CRAN" + }, + "lazyeval": { + "Package": "lazyeval", + "Version": "0.2.2", + "Source": "Repository", + "Title": "Lazy (Non-Standard) Evaluation", + "Description": "An alternative approach to non-standard evaluation using formulas. Provides a full implementation of LISP style 'quasiquotation', making it easier to generate code with other code.", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", ,\"hadley@rstudio.com\", c(\"aut\", \"cre\")), person(\"RStudio\", role = \"cph\") )", + "License": "GPL-3", + "LazyData": "true", + "Depends": [ + "R (>= 3.1.0)" + ], + "Suggests": [ + "knitr", + "rmarkdown (>= 0.2.65)", + "testthat", + "covr" + ], + "VignetteBuilder": "knitr", + "RoxygenNote": "6.1.1", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre], RStudio [cph]", + "Maintainer": "Hadley Wickham ", + "Repository": "https://p3m.dev/cran/latest", + "Encoding": "UTF-8" + }, + "lifecycle": { + "Package": "lifecycle", + "Version": "1.0.4", + "Source": "Repository", + "Title": "Manage the Life Cycle of your Package Functions", + "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Manage the life cycle of your exported functions with shared conventions, documentation badges, and user-friendly deprecation warnings.", + "License": "MIT + file LICENSE", + "URL": "https://lifecycle.r-lib.org/, https://github.com/r-lib/lifecycle", + "BugReports": "https://github.com/r-lib/lifecycle/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "glue", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "covr", + "crayon", + "knitr", + "lintr", + "rmarkdown", + "testthat (>= 3.0.1)", + "tibble", + "tidyverse", + "tools", + "vctrs", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate, usethis", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.1", + "NeedsCompilation": "no", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "RSPM" + }, + "litedown": { + "Package": "litedown", + "Version": "0.7", + "Source": "Repository", + "Type": "Package", + "Title": "A Lightweight Version of R Markdown", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\", URL = \"https://yihui.org\")), person(\"Tim\", \"Taylor\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8587-7113\")), person() )", + "Description": "Render R Markdown to Markdown (without using 'knitr'), and Markdown to lightweight HTML or 'LaTeX' documents with the 'commonmark' package (instead of 'Pandoc'). Some missing Markdown features in 'commonmark' are also supported, such as raw HTML or 'LaTeX' blocks, 'LaTeX' math, superscripts, subscripts, footnotes, element attributes, and appendices, but not all 'Pandoc' Markdown features are (or will be) supported. With additional JavaScript and CSS, you can also create HTML slides and articles. This package can be viewed as a trimmed-down version of R Markdown and 'knitr'. It does not aim at rich Markdown features or a large variety of output formats (the primary formats are HTML and 'LaTeX'). Book and website projects of multiple input documents are also supported.", + "Depends": [ + "R (>= 3.2.0)" + ], + "Imports": [ + "utils", + "commonmark (>= 1.9.5)", + "xfun (>= 0.52)" + ], + "Suggests": [ + "rbibutils", + "rstudioapi", + "tinytex" + ], + "License": "MIT + file LICENSE", + "URL": "https://github.com/yihui/litedown", + "BugReports": "https://github.com/yihui/litedown/issues", + "VignetteBuilder": "litedown", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut, cre] (, https://yihui.org), Tim Taylor [ctb] ()", + "Maintainer": "Yihui Xie ", + "Repository": "CRAN" + }, + "magrittr": { + "Package": "magrittr", + "Version": "2.0.3", + "Source": "Repository", + "Type": "Package", + "Title": "A Forward-Pipe Operator for R", + "Authors@R": "c( person(\"Stefan Milton\", \"Bache\", , \"stefan@stefanbache.dk\", role = c(\"aut\", \"cph\"), comment = \"Original author and creator of magrittr\"), person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@rstudio.com\", role = \"cre\"), person(\"RStudio\", role = c(\"cph\", \"fnd\")) )", + "Description": "Provides a mechanism for chaining commands with a new forward-pipe operator, %>%. This operator will forward a value, or the result of an expression, into the next function call/expression. There is flexible support for the type of right-hand side expressions. For more information, see package vignette. To quote Rene Magritte, \"Ceci n'est pas un pipe.\"", + "License": "MIT + file LICENSE", + "URL": "https://magrittr.tidyverse.org, https://github.com/tidyverse/magrittr", + "BugReports": "https://github.com/tidyverse/magrittr/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Suggests": [ + "covr", + "knitr", + "rlang", + "rmarkdown", + "testthat" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "Yes", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.1.2", + "NeedsCompilation": "yes", + "Author": "Stefan Milton Bache [aut, cph] (Original author and creator of magrittr), Hadley Wickham [aut], Lionel Henry [cre], RStudio [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "markdown": { + "Package": "markdown", + "Version": "2.0", + "Source": "Repository", + "Type": "Package", + "Title": "Render Markdown with 'commonmark'", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\")), person(\"JJ\", \"Allaire\", role = \"aut\"), person(\"Jeffrey\", \"Horner\", role = \"aut\"), person(\"Henrik\", \"Bengtsson\", role = \"ctb\"), person(\"Jim\", \"Hester\", role = \"ctb\"), person(\"Yixuan\", \"Qiu\", role = \"ctb\"), person(\"Kohske\", \"Takahashi\", role = \"ctb\"), person(\"Adam\", \"November\", role = \"ctb\"), person(\"Nacho\", \"Caballero\", role = \"ctb\"), person(\"Jeroen\", \"Ooms\", role = \"ctb\"), person(\"Thomas\", \"Leeper\", role = \"ctb\"), person(\"Joe\", \"Cheng\", role = \"ctb\"), person(\"Andrzej\", \"Oles\", role = \"ctb\"), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Render Markdown to full and lightweight HTML/LaTeX documents with the 'commonmark' package. This package has been superseded by 'litedown'.", + "Depends": [ + "R (>= 2.11.1)" + ], + "Imports": [ + "utils", + "xfun", + "litedown (>= 0.6)" + ], + "Suggests": [ + "knitr", + "rmarkdown (>= 2.18)", + "yaml", + "RCurl" + ], + "License": "MIT + file LICENSE", + "URL": "https://github.com/rstudio/markdown", + "BugReports": "https://github.com/rstudio/markdown/issues", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut, cre] (), JJ Allaire [aut], Jeffrey Horner [aut], Henrik Bengtsson [ctb], Jim Hester [ctb], Yixuan Qiu [ctb], Kohske Takahashi [ctb], Adam November [ctb], Nacho Caballero [ctb], Jeroen Ooms [ctb], Thomas Leeper [ctb], Joe Cheng [ctb], Andrzej Oles [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Yihui Xie ", + "Repository": "CRAN" + }, + "memoise": { + "Package": "memoise", + "Version": "2.0.1", + "Source": "Repository", + "Title": "'Memoisation' of Functions", + "Authors@R": "c(person(given = \"Hadley\", family = \"Wickham\", role = \"aut\", email = \"hadley@rstudio.com\"), person(given = \"Jim\", family = \"Hester\", role = \"aut\"), person(given = \"Winston\", family = \"Chang\", role = c(\"aut\", \"cre\"), email = \"winston@rstudio.com\"), person(given = \"Kirill\", family = \"Müller\", role = \"aut\", email = \"krlmlr+r@mailbox.org\"), person(given = \"Daniel\", family = \"Cook\", role = \"aut\", email = \"danielecook@gmail.com\"), person(given = \"Mark\", family = \"Edmondson\", role = \"ctb\", email = \"r@sunholo.com\"))", + "Description": "Cache the results of a function so that when you call it again with the same arguments it returns the previously computed value.", + "License": "MIT + file LICENSE", + "URL": "https://memoise.r-lib.org, https://github.com/r-lib/memoise", + "BugReports": "https://github.com/r-lib/memoise/issues", + "Imports": [ + "rlang (>= 0.4.10)", + "cachem" + ], + "Suggests": [ + "digest", + "aws.s3", + "covr", + "googleAuthR", + "googleCloudStorageR", + "httr", + "testthat" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.1.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Jim Hester [aut], Winston Chang [aut, cre], Kirill Müller [aut], Daniel Cook [aut], Mark Edmondson [ctb]", + "Maintainer": "Winston Chang ", + "Repository": "RSPM" + }, + "mgcv": { + "Package": "mgcv", + "Version": "1.9-3", + "Source": "Repository", + "Authors@R": "person(given = \"Simon\", family = \"Wood\", role = c(\"aut\", \"cre\"), email = \"simon.wood@r-project.org\")", + "Title": "Mixed GAM Computation Vehicle with Automatic Smoothness Estimation", + "Description": "Generalized additive (mixed) models, some of their extensions and other generalized ridge regression with multiple smoothing parameter estimation by (Restricted) Marginal Likelihood, Generalized Cross Validation and similar, or using iterated nested Laplace approximation for fully Bayesian inference. See Wood (2017) for an overview. Includes a gam() function, a wide variety of smoothers, 'JAGS' support and distributions beyond the exponential family.", + "Priority": "recommended", + "Depends": [ + "R (>= 3.6.0)", + "nlme (>= 3.1-64)" + ], + "Imports": [ + "methods", + "stats", + "graphics", + "Matrix", + "splines", + "utils" + ], + "Suggests": [ + "parallel", + "survival", + "MASS" + ], + "LazyLoad": "yes", + "ByteCompile": "yes", + "License": "GPL (>= 2)", + "NeedsCompilation": "yes", + "Author": "Simon Wood [aut, cre]", + "Maintainer": "Simon Wood ", + "Repository": "CRAN" + }, + "mime": { + "Package": "mime", + "Version": "0.13", + "Source": "Repository", + "Type": "Package", + "Title": "Map Filenames to MIME Types", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\", URL = \"https://yihui.org\")), person(\"Jeffrey\", \"Horner\", role = \"ctb\"), person(\"Beilei\", \"Bian\", role = \"ctb\") )", + "Description": "Guesses the MIME type from a filename extension using the data derived from /etc/mime.types in UNIX-type systems.", + "Imports": [ + "tools" + ], + "License": "GPL", + "URL": "https://github.com/yihui/mime", + "BugReports": "https://github.com/yihui/mime/issues", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Yihui Xie [aut, cre] (, https://yihui.org), Jeffrey Horner [ctb], Beilei Bian [ctb]", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "mockery": { + "Package": "mockery", + "Version": "0.4.4", + "Source": "Repository", + "Title": "Mocking Library for R", + "Authors@R": "c( person(\"Noam\", \"Finkelstein\", role = \"aut\"), person(\"Lukasz\", \"Bartnik\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = c(\"aut\", \"cre\")) )", + "Description": "The two main functionalities of this package are creating mock objects (functions) and selectively intercepting calls to a given function that originate in some other function. It can be used with any testing framework available for R. Mock objects can be injected with either this package's own stub() function or a similar with_mock() facility present in the 'testthat' package.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/mockery", + "BugReports": "https://github.com/r-lib/mockery/issues", + "Imports": [ + "testthat" + ], + "Suggests": [ + "knitr", + "R6", + "rmarkdown (>= 1.0)" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "Collate": "'expectations.R' 'mockery.R' 'mock-object.R' 'stub.R'", + "NeedsCompilation": "no", + "Author": "Noam Finkelstein [aut], Lukasz Bartnik [aut], Jim Hester [aut], Hadley Wickham [aut, cre]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM" + }, + "nlme": { + "Package": "nlme", + "Version": "3.1-168", + "Source": "Repository", + "Date": "2025-03-31", + "Priority": "recommended", + "Title": "Linear and Nonlinear Mixed Effects Models", + "Authors@R": "c(person(\"José\", \"Pinheiro\", role = \"aut\", comment = \"S version\"), person(\"Douglas\", \"Bates\", role = \"aut\", comment = \"up to 2007\"), person(\"Saikat\", \"DebRoy\", role = \"ctb\", comment = \"up to 2002\"), person(\"Deepayan\", \"Sarkar\", role = \"ctb\", comment = \"up to 2005\"), person(\"EISPACK authors\", role = \"ctb\", comment = \"src/rs.f\"), person(\"Siem\", \"Heisterkamp\", role = \"ctb\", comment = \"Author fixed sigma\"), person(\"Bert\", \"Van Willigen\",role = \"ctb\", comment = \"Programmer fixed sigma\"), person(\"Johannes\", \"Ranke\", role = \"ctb\", comment = \"varConstProp()\"), person(\"R Core Team\", email = \"R-core@R-project.org\", role = c(\"aut\", \"cre\"), comment = c(ROR = \"02zz1nj61\")))", + "Contact": "see 'MailingList'", + "Description": "Fit and compare Gaussian linear and nonlinear mixed-effects models.", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ + "graphics", + "stats", + "utils", + "lattice" + ], + "Suggests": [ + "MASS", + "SASmixed" + ], + "LazyData": "yes", + "Encoding": "UTF-8", + "License": "GPL (>= 2)", + "BugReports": "https://bugs.r-project.org", + "MailingList": "R-help@r-project.org", + "URL": "https://svn.r-project.org/R-packages/trunk/nlme/", + "NeedsCompilation": "yes", + "Author": "José Pinheiro [aut] (S version), Douglas Bates [aut] (up to 2007), Saikat DebRoy [ctb] (up to 2002), Deepayan Sarkar [ctb] (up to 2005), EISPACK authors [ctb] (src/rs.f), Siem Heisterkamp [ctb] (Author fixed sigma), Bert Van Willigen [ctb] (Programmer fixed sigma), Johannes Ranke [ctb] (varConstProp()), R Core Team [aut, cre] (02zz1nj61)", + "Maintainer": "R Core Team ", + "Repository": "CRAN" + }, + "openssl": { + "Package": "openssl", + "Version": "2.3.3", + "Source": "Repository", + "Type": "Package", + "Title": "Toolkit for Encryption, Signatures and Certificates Based on OpenSSL", + "Authors@R": "c(person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Oliver\", \"Keyes\", role = \"ctb\"))", + "Description": "Bindings to OpenSSL libssl and libcrypto, plus custom SSH key parsers. Supports RSA, DSA and EC curves P-256, P-384, P-521, and curve25519. Cryptographic signatures can either be created and verified manually or via x509 certificates. AES can be used in cbc, ctr or gcm mode for symmetric encryption; RSA for asymmetric (public key) encryption or EC for Diffie Hellman. High-level envelope functions combine RSA and AES for encrypting arbitrary sized data. Other utilities include key generators, hash functions (md5, sha1, sha256, etc), base64 encoder, a secure random number generator, and 'bignum' math methods for manually performing crypto calculations on large multibyte integers.", + "License": "MIT + file LICENSE", + "URL": "https://jeroen.r-universe.dev/openssl", + "BugReports": "https://github.com/jeroen/openssl/issues", + "SystemRequirements": "OpenSSL >= 1.0.2", + "VignetteBuilder": "knitr", + "Imports": [ + "askpass" + ], + "Suggests": [ + "curl", + "testthat (>= 2.1.0)", + "digest", + "knitr", + "rmarkdown", + "jsonlite", + "jose", + "sodium" + ], + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (ORCID: ), Oliver Keyes [ctb]", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "palmerpenguins": { + "Package": "palmerpenguins", + "Version": "0.1.1", + "Source": "Repository", + "Title": "Palmer Archipelago (Antarctica) Penguin Data", + "Date": "2022-08-12", + "Authors@R": "c( person(given = \"Allison\", family = \"Horst\", role = c(\"aut\", \"cre\"), email = \"ahorst@ucsb.edu\", comment = c(ORCID = \"0000-0002-6047-5564\")), person(given = \"Alison\", family = \"Hill\", role = c(\"aut\"), email = \"apresstats@gmail.com\", comment = c(ORCID = \"0000-0002-8082-1890\")), person(given = \"Kristen\", family = \"Gorman\", role = c(\"aut\"), email = \"kbgorman@alaska.edu\", comment = c(ORCID = \"0000-0002-0258-9264\")) )", + "Description": "Size measurements, clutch observations, and blood isotope ratios for adult foraging Adélie, Chinstrap, and Gentoo penguins observed on islands in the Palmer Archipelago near Palmer Station, Antarctica. Data were collected and made available by Dr. Kristen Gorman and the Palmer Station Long Term Ecological Research (LTER) Program.", + "License": "CC0", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.1.9000", + "Depends": [ + "R (>= 2.10)" + ], + "Suggests": [ + "knitr", + "rmarkdown", + "tibble", + "ggplot2", + "dplyr", + "tidyr", + "recipes" + ], + "URL": "https://allisonhorst.github.io/palmerpenguins/, https://github.com/allisonhorst/palmerpenguins", + "BugReports": "https://github.com/allisonhorst/palmerpenguins/issues", + "NeedsCompilation": "no", + "Author": "Allison Horst [aut, cre] (), Alison Hill [aut] (), Kristen Gorman [aut] ()", + "Maintainer": "Allison Horst ", + "Repository": "CRAN" + }, + "pillar": { + "Package": "pillar", + "Version": "1.10.2", + "Source": "Repository", + "Title": "Coloured Formatting for Columns", + "Authors@R": "c(person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Hadley\", family = \"Wickham\", role = \"aut\"), person(given = \"RStudio\", role = \"cph\"))", + "Description": "Provides 'pillar' and 'colonnade' generics designed for formatting columns of data using the full range of colours provided by modern terminals.", + "License": "MIT + file LICENSE", + "URL": "https://pillar.r-lib.org/, https://github.com/r-lib/pillar", + "BugReports": "https://github.com/r-lib/pillar/issues", + "Imports": [ + "cli (>= 2.3.0)", + "glue", + "lifecycle", + "rlang (>= 1.0.2)", + "utf8 (>= 1.1.0)", + "utils", + "vctrs (>= 0.5.0)" + ], + "Suggests": [ + "bit64", + "DBI", + "debugme", + "DiagrammeR", + "dplyr", + "formattable", + "ggplot2", + "knitr", + "lubridate", + "nanotime", + "nycflights13", + "palmerpenguins", + "rmarkdown", + "scales", + "stringi", + "survival", + "testthat (>= 3.1.1)", + "tibble", + "units (>= 0.7.2)", + "vdiffr", + "withr" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2.9000", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "format_multi_fuzz, format_multi_fuzz_2, format_multi, ctl_colonnade, ctl_colonnade_1, ctl_colonnade_2", + "Config/autostyle/scope": "line_breaks", + "Config/autostyle/strict": "true", + "Config/gha/extra-packages": "units=?ignore-before-r=4.3.0", + "Config/Needs/website": "tidyverse/tidytemplate", + "NeedsCompilation": "no", + "Author": "Kirill Müller [aut, cre] (), Hadley Wickham [aut], RStudio [cph]", + "Maintainer": "Kirill Müller ", + "Repository": "RSPM" + }, + "pkgbuild": { + "Package": "pkgbuild", + "Version": "1.4.8", + "Source": "Repository", + "Title": "Find Tools Needed to Build R Packages", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides functions used to build R packages. Locates compilers needed to build R packages on various platforms and ensures the PATH is configured appropriately so R can use them.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/pkgbuild, https://pkgbuild.r-lib.org", + "BugReports": "https://github.com/r-lib/pkgbuild/issues", + "Depends": [ + "R (>= 3.5)" + ], + "Imports": [ + "callr (>= 3.2.0)", + "cli (>= 3.4.0)", + "desc", + "processx", + "R6" + ], + "Suggests": [ + "covr", + "cpp11", + "knitr", + "Rcpp", + "rmarkdown", + "testthat (>= 3.2.0)", + "withr (>= 2.3.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-04-30", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Jim Hester [aut], Gábor Csárdi [aut, cre], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM" + }, + "pkgconfig": { + "Package": "pkgconfig", + "Version": "2.0.3", + "Source": "Repository", + "Title": "Private Configuration for 'R' Packages", + "Author": "Gábor Csárdi", + "Maintainer": "Gábor Csárdi ", + "Description": "Set configuration options on a per-package basis. Options set by a given package only apply to that package, other packages are unaffected.", + "License": "MIT + file LICENSE", + "LazyData": "true", + "Imports": [ + "utils" + ], + "Suggests": [ + "covr", + "testthat", + "disposables (>= 1.0.3)" + ], + "URL": "https://github.com/r-lib/pkgconfig#readme", + "BugReports": "https://github.com/r-lib/pkgconfig/issues", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Repository": "RSPM" + }, + "pkgdown": { + "Package": "pkgdown", + "Version": "2.1.3", + "Source": "Repository", + "Title": "Make Static HTML Documentation for a Package", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Jay\", \"Hesselberth\", role = \"aut\", comment = c(ORCID = \"0000-0002-6299-179X\")), person(\"Maëlle\", \"Salmon\", role = \"aut\", comment = c(ORCID = \"0000-0002-2815-0399\")), person(\"Olivier\", \"Roy\", role = \"aut\"), person(\"Salim\", \"Brüggemann\", role = \"aut\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Generate an attractive and useful website from a source package. 'pkgdown' converts your documentation, vignettes, 'README', and more to 'HTML' making it easy to share information about your package online.", + "License": "MIT + file LICENSE", + "URL": "https://pkgdown.r-lib.org/, https://github.com/r-lib/pkgdown", + "BugReports": "https://github.com/r-lib/pkgdown/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Imports": [ + "bslib (>= 0.5.1)", + "callr (>= 3.7.3)", + "cli (>= 3.6.1)", + "desc (>= 1.4.0)", + "downlit (>= 0.4.4)", + "fontawesome", + "fs (>= 1.4.0)", + "httr2 (>= 1.0.2)", + "jsonlite", + "openssl", + "purrr (>= 1.0.0)", + "ragg (>= 1.4.0)", + "rlang (>= 1.1.4)", + "rmarkdown (>= 2.27)", + "tibble", + "whisker", + "withr (>= 2.4.3)", + "xml2 (>= 1.3.1)", + "yaml" + ], + "Suggests": [ + "covr", + "diffviewer", + "evaluate (>= 0.24.0)", + "gert", + "gt", + "htmltools", + "htmlwidgets", + "knitr (>= 1.50)", + "lifecycle", + "magick", + "methods", + "pkgload (>= 1.0.2)", + "quarto", + "rsconnect", + "rstudioapi", + "rticles", + "sass", + "testthat (>= 3.1.3)", + "tools" + ], + "VignetteBuilder": "knitr, quarto", + "Config/Needs/website": "usethis, servr", + "Config/potools/style": "explicit", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "build-article, build-quarto-article, build-reference", + "Encoding": "UTF-8", + "SystemRequirements": "pandoc", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre] (ORCID: ), Jay Hesselberth [aut] (ORCID: ), Maëlle Salmon [aut] (ORCID: ), Olivier Roy [aut], Salim Brüggemann [aut] (ORCID: ), Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN" + }, + "pkgload": { + "Package": "pkgload", + "Version": "1.4.0", + "Source": "Repository", + "Title": "Simulate Package Installation and Attach", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", role = \"aut\"), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"R Core team\", role = \"ctb\", comment = \"Some namespace and vignette code extracted from base R\") )", + "Description": "Simulates the process of installing a package and then attaching it. This is a key part of the 'devtools' package as it allows you to rapidly iterate while developing a package.", + "License": "GPL-3", + "URL": "https://github.com/r-lib/pkgload, https://pkgload.r-lib.org", + "BugReports": "https://github.com/r-lib/pkgload/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Imports": [ + "cli (>= 3.3.0)", + "desc", + "fs", + "glue", + "lifecycle", + "methods", + "pkgbuild", + "processx", + "rlang (>= 1.1.1)", + "rprojroot", + "utils", + "withr (>= 2.4.3)" + ], + "Suggests": [ + "bitops", + "jsonlite", + "mathjaxr", + "pak", + "Rcpp", + "remotes", + "rstudioapi", + "testthat (>= 3.2.1.1)", + "usethis" + ], + "Config/Needs/website": "tidyverse/tidytemplate, ggplot2", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "TRUE", + "Config/testthat/start-first": "dll", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Winston Chang [aut], Jim Hester [aut], Lionel Henry [aut, cre], Posit Software, PBC [cph, fnd], R Core team [ctb] (Some namespace and vignette code extracted from base R)", + "Maintainer": "Lionel Henry ", + "Repository": "RSPM" + }, + "plyr": { + "Package": "plyr", + "Version": "1.8.9", + "Source": "Repository", + "Title": "Tools for Splitting, Applying and Combining Data", + "Authors@R": "person(\"Hadley\", \"Wickham\", , \"hadley@rstudio.com\", role = c(\"aut\", \"cre\"))", + "Description": "A set of tools that solves a common set of problems: you need to break a big problem down into manageable pieces, operate on each piece and then put all the pieces back together. For example, you might want to fit a model to each spatial location or time point in your study, summarise data by panels or collapse high-dimensional arrays to simpler summary statistics. The development of 'plyr' has been generously supported by 'Becton Dickinson'.", + "License": "MIT + file LICENSE", + "URL": "http://had.co.nz/plyr, https://github.com/hadley/plyr", + "BugReports": "https://github.com/hadley/plyr/issues", + "Depends": [ + "R (>= 3.1.0)" + ], + "Imports": [ + "Rcpp (>= 0.11.0)" + ], + "Suggests": [ + "abind", + "covr", + "doParallel", + "foreach", + "iterators", + "itertools", + "tcltk", + "testthat" + ], + "LinkingTo": [ + "Rcpp" + ], + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre]", + "Maintainer": "Hadley Wickham ", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "png": { + "Package": "png", + "Version": "0.1-8", + "Source": "Repository", + "Title": "Read and write PNG images", + "Author": "Simon Urbanek ", + "Maintainer": "Simon Urbanek ", + "Depends": [ + "R (>= 2.9.0)" + ], + "Description": "This package provides an easy and simple way to read, write and display bitmap images stored in the PNG format. It can read and write both files and in-memory raw vectors.", + "License": "GPL-2 | GPL-3", + "SystemRequirements": "libpng", + "URL": "http://www.rforge.net/png/", + "NeedsCompilation": "yes", + "Repository": "CRAN", + "Encoding": "UTF-8", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_27" + }, + "praise": { + "Package": "praise", + "Version": "1.0.0", + "Source": "Repository", + "Title": "Praise Users", + "Author": "Gabor Csardi, Sindre Sorhus", + "Maintainer": "Gabor Csardi ", + "Description": "Build friendly R packages that praise their users if they have done something good, or they just need it to feel better.", + "License": "MIT + file LICENSE", + "LazyData": "true", + "URL": "https://github.com/gaborcsardi/praise", + "BugReports": "https://github.com/gaborcsardi/praise/issues", + "Suggests": [ + "testthat" + ], + "Collate": "'adjective.R' 'adverb.R' 'exclamation.R' 'verb.R' 'rpackage.R' 'package.R'", + "NeedsCompilation": "no", + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "prettyunits": { + "Package": "prettyunits", + "Version": "1.2.0", + "Source": "Repository", + "Title": "Pretty, Human Readable Formatting of Quantities", + "Authors@R": "c( person(\"Gabor\", \"Csardi\", email=\"csardi.gabor@gmail.com\", role=c(\"aut\", \"cre\")), person(\"Bill\", \"Denney\", email=\"wdenney@humanpredictions.com\", role=c(\"ctb\"), comment=c(ORCID=\"0000-0002-5759-428X\")), person(\"Christophe\", \"Regouby\", email=\"christophe.regouby@free.fr\", role=c(\"ctb\")) )", + "Description": "Pretty, human readable formatting of quantities. Time intervals: '1337000' -> '15d 11h 23m 20s'. Vague time intervals: '2674000' -> 'about a month ago'. Bytes: '1337' -> '1.34 kB'. Rounding: '99' with 3 significant digits -> '99.0' p-values: '0.00001' -> '<0.0001'. Colors: '#FF0000' -> 'red'. Quantities: '1239437' -> '1.24 M'.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/prettyunits", + "BugReports": "https://github.com/r-lib/prettyunits/issues", + "Depends": [ + "R(>= 2.10)" + ], + "Suggests": [ + "codetools", + "covr", + "testthat" + ], + "RoxygenNote": "7.2.3", + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Author": "Gabor Csardi [aut, cre], Bill Denney [ctb] (), Christophe Regouby [ctb]", + "Maintainer": "Gabor Csardi ", + "Repository": "RSPM" + }, + "processx": { + "Package": "processx", + "Version": "3.8.6", + "Source": "Repository", + "Title": "Execute and Control System Processes", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\", \"cph\"), comment = c(ORCID = \"0000-0001-7098-9676\")), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"Ascent Digital Services\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools to run system processes in the background. It can check if a background process is running; wait on a background process to finish; get the exit status of finished processes; kill background processes. It can read the standard output and error of the processes, using non-blocking connections. 'processx' can poll a process for standard output or error, with a timeout. It can also poll several processes at once.", + "License": "MIT + file LICENSE", + "URL": "https://processx.r-lib.org, https://github.com/r-lib/processx", + "BugReports": "https://github.com/r-lib/processx/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Imports": [ + "ps (>= 1.2.0)", + "R6", + "utils" + ], + "Suggests": [ + "callr (>= 3.7.3)", + "cli (>= 3.3.0)", + "codetools", + "covr", + "curl", + "debugme", + "parallel", + "rlang (>= 1.0.2)", + "testthat (>= 3.0.0)", + "webfakes", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1.9000", + "NeedsCompilation": "yes", + "Author": "Gábor Csárdi [aut, cre, cph] (), Winston Chang [aut], Posit Software, PBC [cph, fnd], Ascent Digital Services [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "progress": { + "Package": "progress", + "Version": "1.2.3", + "Source": "Repository", + "Title": "Terminal Progress Bars", + "Authors@R": "c( person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Rich\", \"FitzJohn\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Configurable Progress bars, they may include percentage, elapsed time, and/or the estimated completion time. They work in terminals, in 'Emacs' 'ESS', 'RStudio', 'Windows' 'Rgui' and the 'macOS' 'R.app'. The package also provides a 'C++' 'API', that works with or without 'Rcpp'.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/progress#readme, http://r-lib.github.io/progress/", + "BugReports": "https://github.com/r-lib/progress/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "crayon", + "hms", + "prettyunits", + "R6" + ], + "Suggests": [ + "Rcpp", + "testthat (>= 3.0.0)", + "withr" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Gábor Csárdi [aut, cre], Rich FitzJohn [aut], Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "https://p3m.dev/cran/latest" + }, + "promises": { + "Package": "promises", + "Version": "1.3.3", + "Source": "Repository", + "Type": "Package", + "Title": "Abstractions for Promise-Based Asynchronous Programming", + "Authors@R": "c( person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides fundamental abstractions for doing asynchronous programming in R using promises. Asynchronous programming is useful for allowing a single R process to orchestrate multiple tasks in the background while also attending to something else. Semantics are similar to 'JavaScript' promises, but with a syntax that is idiomatic R.", + "License": "MIT + file LICENSE", + "URL": "https://rstudio.github.io/promises/, https://github.com/rstudio/promises", + "BugReports": "https://github.com/rstudio/promises/issues", + "Imports": [ + "fastmap (>= 1.1.0)", + "later", + "magrittr (>= 1.5)", + "R6", + "Rcpp", + "rlang", + "stats" + ], + "Suggests": [ + "future (>= 1.21.0)", + "knitr", + "purrr", + "rmarkdown", + "spelling", + "testthat (>= 3.0.0)", + "vembedr" + ], + "LinkingTo": [ + "later", + "Rcpp" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "rsconnect, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-05-27", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Joe Cheng [aut, cre], Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Joe Cheng ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "ps": { + "Package": "ps", + "Version": "1.9.1", + "Source": "Repository", + "Title": "List, Query, Manipulate System Processes", + "Authors@R": "c( person(\"Jay\", \"Loden\", role = \"aut\"), person(\"Dave\", \"Daeschler\", role = \"aut\"), person(\"Giampaolo\", \"Rodola'\", role = \"aut\"), person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "List, query and manipulate all system processes, on 'Windows', 'Linux' and 'macOS'.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/ps, https://ps.r-lib.org/", + "BugReports": "https://github.com/r-lib/ps/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "callr", + "covr", + "curl", + "pillar", + "pingr", + "processx (>= 3.1.0)", + "R6", + "rlang", + "testthat (>= 3.0.0)", + "webfakes", + "withr" + ], + "Biarch": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Jay Loden [aut], Dave Daeschler [aut], Giampaolo Rodola' [aut], Gábor Csárdi [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Gábor Csárdi ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "purrr": { + "Package": "purrr", + "Version": "1.0.4", + "Source": "Repository", + "Title": "Functional Programming Tools", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "A complete and consistent functional programming toolkit for R.", + "License": "MIT + file LICENSE", + "URL": "https://purrr.tidyverse.org/, https://github.com/tidyverse/purrr", + "BugReports": "https://github.com/tidyverse/purrr/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ + "cli (>= 3.6.1)", + "lifecycle (>= 1.0.3)", + "magrittr (>= 1.5.0)", + "rlang (>= 1.1.1)", + "vctrs (>= 0.6.3)" + ], + "Suggests": [ + "covr", + "dplyr (>= 0.7.8)", + "httr", + "knitr", + "lubridate", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble", + "tidyselect" + ], + "LinkingTo": [ + "cli" + ], + "VignetteBuilder": "knitr", + "Biarch": "true", + "Config/build/compilation-database": "true", + "Config/Needs/website": "tidyverse/tidytemplate, tidyr", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "TRUE", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre] (), Lionel Henry [aut], Posit Software, PBC [cph, fnd] (03wc8by49)", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "ragg": { + "Package": "ragg", + "Version": "1.4.0", + "Source": "Repository", + "Type": "Package", + "Title": "Graphic Devices Based on AGG", + "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Maxim\", \"Shemanarev\", role = c(\"aut\", \"cph\"), comment = \"Author of AGG\"), person(\"Tony\", \"Juricic\", , \"tonygeek@yahoo.com\", role = c(\"ctb\", \"cph\"), comment = \"Contributor to AGG\"), person(\"Milan\", \"Marusinec\", , \"milan@marusinec.sk\", role = c(\"ctb\", \"cph\"), comment = \"Contributor to AGG\"), person(\"Spencer\", \"Garrett\", role = \"ctb\", comment = \"Contributor to AGG\"), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "Maintainer": "Thomas Lin Pedersen ", + "Description": "Anti-Grain Geometry (AGG) is a high-quality and high-performance 2D drawing library. The 'ragg' package provides a set of graphic devices based on AGG to use as alternative to the raster devices provided through the 'grDevices' package.", + "License": "MIT + file LICENSE", + "URL": "https://ragg.r-lib.org, https://github.com/r-lib/ragg", + "BugReports": "https://github.com/r-lib/ragg/issues", + "Imports": [ + "systemfonts (>= 1.0.3)", + "textshaping (>= 0.3.0)" + ], + "Suggests": [ + "covr", + "graphics", + "grid", + "testthat (>= 3.0.0)" + ], + "LinkingTo": [ + "systemfonts", + "textshaping" + ], + "Config/Needs/website": "ggplot2, devoid, magick, bench, tidyr, ggridges, hexbin, sessioninfo, pkgdown, tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "freetype2, libpng, libtiff, libjpeg", + "Config/testthat/edition": "3", + "Config/build/compilation-database": "true", + "NeedsCompilation": "yes", + "Author": "Thomas Lin Pedersen [cre, aut] (), Maxim Shemanarev [aut, cph] (Author of AGG), Tony Juricic [ctb, cph] (Contributor to AGG), Milan Marusinec [ctb, cph] (Contributor to AGG), Spencer Garrett [ctb] (Contributor to AGG), Posit, PBC [cph, fnd]", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_27" + }, + "rappdirs": { + "Package": "rappdirs", + "Version": "0.3.3", + "Source": "Repository", + "Type": "Package", + "Title": "Application Directories: Determine Where to Save Data, Caches, and Logs", + "Authors@R": "c(person(given = \"Hadley\", family = \"Wickham\", role = c(\"trl\", \"cre\", \"cph\"), email = \"hadley@rstudio.com\"), person(given = \"RStudio\", role = \"cph\"), person(given = \"Sridhar\", family = \"Ratnakumar\", role = \"aut\"), person(given = \"Trent\", family = \"Mick\", role = \"aut\"), person(given = \"ActiveState\", role = \"cph\", comment = \"R/appdir.r, R/cache.r, R/data.r, R/log.r translated from appdirs\"), person(given = \"Eddy\", family = \"Petrisor\", role = \"ctb\"), person(given = \"Trevor\", family = \"Davis\", role = c(\"trl\", \"aut\")), person(given = \"Gabor\", family = \"Csardi\", role = \"ctb\"), person(given = \"Gregory\", family = \"Jefferis\", role = \"ctb\"))", + "Description": "An easy way to determine which directories on the users computer you should use to save data, caches and logs. A port of Python's 'Appdirs' () to R.", + "License": "MIT + file LICENSE", + "URL": "https://rappdirs.r-lib.org, https://github.com/r-lib/rappdirs", + "BugReports": "https://github.com/r-lib/rappdirs/issues", + "Depends": [ + "R (>= 3.2)" + ], + "Suggests": [ + "roxygen2", + "testthat (>= 3.0.0)", + "covr", + "withr" + ], + "Copyright": "Original python appdirs module copyright (c) 2010 ActiveState Software Inc. R port copyright Hadley Wickham, RStudio. See file LICENSE for details.", + "Encoding": "UTF-8", + "RoxygenNote": "7.1.1", + "Config/testthat/edition": "3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [trl, cre, cph], RStudio [cph], Sridhar Ratnakumar [aut], Trent Mick [aut], ActiveState [cph] (R/appdir.r, R/cache.r, R/data.r, R/log.r translated from appdirs), Eddy Petrisor [ctb], Trevor Davis [trl, aut], Gabor Csardi [ctb], Gregory Jefferis [ctb]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "readr": { + "Package": "readr", + "Version": "2.1.5", + "Source": "Repository", + "Title": "Read Rectangular Text Data", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Romain\", \"Francois\", role = \"ctb\"), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Shelby\", \"Bearrows\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"https://github.com/mandreyel/\", role = \"cph\", comment = \"mio library\"), person(\"Jukka\", \"Jylänki\", role = c(\"ctb\", \"cph\"), comment = \"grisu3 implementation\"), person(\"Mikkel\", \"Jørgensen\", role = c(\"ctb\", \"cph\"), comment = \"grisu3 implementation\") )", + "Description": "The goal of 'readr' is to provide a fast and friendly way to read rectangular data (like 'csv', 'tsv', and 'fwf'). It is designed to flexibly parse many types of data found in the wild, while still cleanly failing when data unexpectedly changes.", + "License": "MIT + file LICENSE", + "URL": "https://readr.tidyverse.org, https://github.com/tidyverse/readr", + "BugReports": "https://github.com/tidyverse/readr/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.2.0)", + "clipr", + "crayon", + "hms (>= 0.4.1)", + "lifecycle (>= 0.2.0)", + "methods", + "R6", + "rlang", + "tibble", + "utils", + "vroom (>= 1.6.0)" + ], + "Suggests": [ + "covr", + "curl", + "datasets", + "knitr", + "rmarkdown", + "spelling", + "stringi", + "testthat (>= 3.2.0)", + "tzdb (>= 0.1.1)", + "waldo", + "withr", + "xml2" + ], + "LinkingTo": [ + "cpp11", + "tzdb (>= 0.1.1)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "false", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut], Jim Hester [aut], Romain Francois [ctb], Jennifer Bryan [aut, cre] (), Shelby Bearrows [ctb], Posit Software, PBC [cph, fnd], https://github.com/mandreyel/ [cph] (mio library), Jukka Jylänki [ctb, cph] (grisu3 implementation), Mikkel Jørgensen [ctb, cph] (grisu3 implementation)", + "Maintainer": "Jennifer Bryan ", + "Repository": "https://p3m.dev/cran/latest" + }, + "readxl": { + "Package": "readxl", + "Version": "1.4.5", + "Source": "Repository", + "Title": "Read Excel Files", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Posit, PBC\", role = c(\"cph\", \"fnd\"), comment = \"Copyright holder of all R code and all C/C++ code without explicit copyright attribution\"), person(\"Marcin\", \"Kalicinski\", role = c(\"ctb\", \"cph\"), comment = \"Author of included RapidXML code\"), person(\"Komarov Valery\", role = c(\"ctb\", \"cph\"), comment = \"Author of included libxls code\"), person(\"Christophe Leitienne\", role = c(\"ctb\", \"cph\"), comment = \"Author of included libxls code\"), person(\"Bob Colbert\", role = c(\"ctb\", \"cph\"), comment = \"Author of included libxls code\"), person(\"David Hoerl\", role = c(\"ctb\", \"cph\"), comment = \"Author of included libxls code\"), person(\"Evan Miller\", role = c(\"ctb\", \"cph\"), comment = \"Author of included libxls code\") )", + "Description": "Import excel files into R. Supports '.xls' via the embedded 'libxls' C library and '.xlsx' via the embedded 'RapidXML' C++ library . Works on Windows, Mac and Linux without external dependencies.", + "License": "MIT + file LICENSE", + "URL": "https://readxl.tidyverse.org, https://github.com/tidyverse/readxl", + "BugReports": "https://github.com/tidyverse/readxl/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cellranger", + "tibble (>= 2.0.1)", + "utils" + ], + "Suggests": [ + "covr", + "knitr", + "rmarkdown", + "testthat (>= 3.1.6)", + "withr" + ], + "LinkingTo": [ + "cpp11 (>= 0.4.0)", + "progress" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate, tidyverse", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "Note": "libxls v1.6.3 c199d13", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut] (), Jennifer Bryan [aut, cre] (), Posit, PBC [cph, fnd] (Copyright holder of all R code and all C/C++ code without explicit copyright attribution), Marcin Kalicinski [ctb, cph] (Author of included RapidXML code), Komarov Valery [ctb, cph] (Author of included libxls code), Christophe Leitienne [ctb, cph] (Author of included libxls code), Bob Colbert [ctb, cph] (Author of included libxls code), David Hoerl [ctb, cph] (Author of included libxls code), Evan Miller [ctb, cph] (Author of included libxls code)", + "Maintainer": "Jennifer Bryan ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "rematch": { + "Package": "rematch", + "Version": "2.0.0", + "Source": "Repository", + "Title": "Match Regular Expressions with a Nicer 'API'", + "Author": "Gabor Csardi", + "Maintainer": "Gabor Csardi ", + "Description": "A small wrapper on 'regexpr' to extract the matches and captured groups from the match of a regular expression to a character vector.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/gaborcsardi/rematch", + "BugReports": "https://github.com/gaborcsardi/rematch/issues", + "RoxygenNote": "5.0.1.9000", + "Suggests": [ + "covr", + "testthat" + ], + "Encoding": "UTF-8", + "NeedsCompilation": "no", + "Repository": "RSPM" + }, + "renv": { + "Package": "renv", + "Version": "1.1.4", + "Source": "Repository", + "Type": "Package", + "Title": "Project Environments", + "Authors@R": "c( person(\"Kevin\", \"Ushey\", role = c(\"aut\", \"cre\"), email = \"kevin@rstudio.com\", comment = c(ORCID = \"0000-0003-2880-7407\")), person(\"Hadley\", \"Wickham\", role = c(\"aut\"), email = \"hadley@rstudio.com\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A dependency management toolkit for R. Using 'renv', you can create and manage project-local R libraries, save the state of these libraries to a 'lockfile', and later restore your library as required. Together, these tools can help make your projects more isolated, portable, and reproducible.", + "License": "MIT + file LICENSE", + "URL": "https://rstudio.github.io/renv/, https://github.com/rstudio/renv", + "BugReports": "https://github.com/rstudio/renv/issues", + "Imports": [ + "utils" + ], + "Suggests": [ + "BiocManager", + "cli", + "compiler", + "covr", + "cpp11", + "devtools", + "gitcreds", + "jsonlite", + "jsonvalidate", + "knitr", + "miniUI", + "modules", + "packrat", + "pak", + "R6", + "remotes", + "reticulate", + "rmarkdown", + "rstudioapi", + "shiny", + "testthat", + "uuid", + "waldo", + "yaml", + "webfakes" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "bioconductor,python,install,restore,snapshot,retrieve,remotes", + "NeedsCompilation": "no", + "Author": "Kevin Ushey [aut, cre] (), Hadley Wickham [aut] (), Posit Software, PBC [cph, fnd]", + "Maintainer": "Kevin Ushey ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "rio": { + "Package": "rio", + "Version": "1.2.3", + "Source": "Repository", + "Type": "Package", + "Title": "A Swiss-Army Knife for Data I/O", + "Authors@R": "c(person(\"Jason\", \"Becker\", role = \"aut\", email = \"jason@jbecker.co\"), person(\"Chung-hong\", \"Chan\", role = c(\"aut\", \"cre\"), email = \"chainsawtiney@gmail.com\", comment = c(ORCID = \"0000-0002-6232-7530\")), person(\"David\", \"Schoch\", email = \"david@schochastics.net\", role = c(\"aut\"), comment = c(ORCID = \"0000-0003-2952-4812\")), person(\"Geoffrey CH\", \"Chan\", role = \"ctb\", email = \"gefchchan@gmail.com\"), person(\"Thomas J.\", \"Leeper\", role = \"aut\", email = \"thosjleeper@gmail.com\", comment = c(ORCID = \"0000-0003-4097-6326\")), person(\"Christopher\", \"Gandrud\", role = \"ctb\"), person(\"Andrew\", \"MacDonald\", role = \"ctb\"), person(\"Ista\", \"Zahn\", role = \"ctb\"), person(\"Stanislaus\", \"Stadlmann\", role = \"ctb\"), person(\"Ruaridh\", \"Williamson\", role = \"ctb\", email = \"ruaridh.williamson@gmail.com\"), person(\"Patrick\", \"Kennedy\", role = \"ctb\"), person(\"Ryan\", \"Price\", email = \"ryapric@gmail.com\", role = \"ctb\"), person(\"Trevor L\", \"Davis\", email = \"trevor.l.davis@gmail.com\", role = \"ctb\"), person(\"Nathan\", \"Day\", email = \"nathancday@gmail.com\", role = \"ctb\"), person(\"Bill\", \"Denney\", email=\"wdenney@humanpredictions.com\", role=\"ctb\", comment=c(ORCID=\"0000-0002-5759-428X\")), person(\"Alex\", \"Bokov\", email = \"alex.bokov@gmail.com\", role = \"ctb\", comment=c(ORCID=\"0000-0002-0511-9815\")), person(\"Hugo\", \"Gruson\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4094-1476\")) )", + "Description": "Streamlined data import and export by making assumptions that the user is probably willing to make: 'import()' and 'export()' determine the data format from the file extension, reasonable defaults are used for data import and export, web-based import is natively supported (including from SSL/HTTPS), compressed files can be read directly, and fast import packages are used where appropriate. An additional convenience function, 'convert()', provides a simple method for converting between file types.", + "URL": "https://gesistsa.github.io/rio/, https://github.com/gesistsa/rio", + "BugReports": "https://github.com/gesistsa/rio/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ + "tools", + "stats", + "utils", + "foreign", + "haven (>= 1.1.2)", + "curl (>= 0.6)", + "data.table (>= 1.11.2)", + "readxl (>= 0.1.1)", + "tibble", + "writexl", + "lifecycle", + "R.utils", + "readr" + ], + "Suggests": [ + "datasets", + "bit64", + "testthat", + "knitr", + "magrittr", + "clipr", + "fst", + "hexView", + "jsonlite", + "pzfx", + "readODS (>= 2.1.0)", + "rmarkdown", + "rmatio", + "xml2 (>= 1.2.0)", + "yaml", + "qs", + "arrow (>= 0.17.0)", + "stringi", + "withr", + "nanoparquet" + ], + "License": "GPL-2", + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.1", + "Config/Needs/website": "gesistsa/tsatemplate", + "NeedsCompilation": "no", + "Author": "Jason Becker [aut], Chung-hong Chan [aut, cre] (), David Schoch [aut] (), Geoffrey CH Chan [ctb], Thomas J. Leeper [aut] (), Christopher Gandrud [ctb], Andrew MacDonald [ctb], Ista Zahn [ctb], Stanislaus Stadlmann [ctb], Ruaridh Williamson [ctb], Patrick Kennedy [ctb], Ryan Price [ctb], Trevor L Davis [ctb], Nathan Day [ctb], Bill Denney [ctb] (), Alex Bokov [ctb] (), Hugo Gruson [ctb] ()", + "Maintainer": "Chung-hong Chan ", + "Repository": "CRAN" + }, + "rlang": { + "Package": "rlang", + "Version": "1.1.6", + "Source": "Repository", + "Title": "Functions for Base Types and Core R and 'Tidyverse' Features", + "Description": "A toolbox for working with base types, core R features like the condition system, and core 'Tidyverse' features like tidy evaluation.", + "Authors@R": "c( person(\"Lionel\", \"Henry\", ,\"lionel@posit.co\", c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", ,\"hadley@posit.co\", \"aut\"), person(given = \"mikefc\", email = \"mikefc@coolbutuseless.com\", role = \"cph\", comment = \"Hash implementation based on Mike's xxhashlite\"), person(given = \"Yann\", family = \"Collet\", role = \"cph\", comment = \"Author of the embedded xxHash library\"), person(given = \"Posit, PBC\", role = c(\"cph\", \"fnd\")) )", + "License": "MIT + file LICENSE", + "ByteCompile": "true", + "Biarch": "true", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "utils" + ], + "Suggests": [ + "cli (>= 3.1.0)", + "covr", + "crayon", + "desc", + "fs", + "glue", + "knitr", + "magrittr", + "methods", + "pillar", + "pkgload", + "rmarkdown", + "stats", + "testthat (>= 3.2.0)", + "tibble", + "usethis", + "vctrs (>= 0.2.3)", + "withr" + ], + "Enhances": [ + "winch" + ], + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "URL": "https://rlang.r-lib.org, https://github.com/r-lib/rlang", + "BugReports": "https://github.com/r-lib/rlang/issues", + "Config/build/compilation-database": "true", + "Config/testthat/edition": "3", + "Config/Needs/website": "dplyr, tidyverse/tidytemplate", + "NeedsCompilation": "yes", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], mikefc [cph] (Hash implementation based on Mike's xxhashlite), Yann Collet [cph] (Author of the embedded xxHash library), Posit, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "rmarkdown": { + "Package": "rmarkdown", + "Version": "2.29", + "Source": "Repository", + "Type": "Package", + "Title": "Dynamic Documents for R", + "Authors@R": "c( person(\"JJ\", \"Allaire\", , \"jj@posit.co\", role = \"aut\"), person(\"Yihui\", \"Xie\", , \"xie@yihui.name\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0003-0645-5666\")), person(\"Christophe\", \"Dervieux\", , \"cderv@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4474-2498\")), person(\"Jonathan\", \"McPherson\", , \"jonathan@posit.co\", role = \"aut\"), person(\"Javier\", \"Luraschi\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevin@posit.co\", role = \"aut\"), person(\"Aron\", \"Atkins\", , \"aron@posit.co\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Joe\", \"Cheng\", , \"joe@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", , \"winston@posit.co\", role = \"aut\"), person(\"Richard\", \"Iannone\", , \"rich@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-3925-190X\")), person(\"Andrew\", \"Dunning\", role = \"ctb\", comment = c(ORCID = \"0000-0003-0464-5036\")), person(\"Atsushi\", \"Yasumoto\", role = c(\"ctb\", \"cph\"), comment = c(ORCID = \"0000-0002-8335-495X\", cph = \"Number sections Lua filter\")), person(\"Barret\", \"Schloerke\", role = \"ctb\"), person(\"Carson\", \"Sievert\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Devon\", \"Ryan\", , \"dpryan79@gmail.com\", role = \"ctb\", comment = c(ORCID = \"0000-0002-8549-0971\")), person(\"Frederik\", \"Aust\", , \"frederik.aust@uni-koeln.de\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4900-788X\")), person(\"Jeff\", \"Allen\", , \"jeff@posit.co\", role = \"ctb\"), person(\"JooYoung\", \"Seo\", role = \"ctb\", comment = c(ORCID = \"0000-0002-4064-6012\")), person(\"Malcolm\", \"Barrett\", role = \"ctb\"), person(\"Rob\", \"Hyndman\", , \"Rob.Hyndman@monash.edu\", role = \"ctb\"), person(\"Romain\", \"Lesur\", role = \"ctb\"), person(\"Roy\", \"Storey\", role = \"ctb\"), person(\"Ruben\", \"Arslan\", , \"ruben.arslan@uni-goettingen.de\", role = \"ctb\"), person(\"Sergio\", \"Oller\", role = \"ctb\"), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(, \"jQuery UI contributors\", role = c(\"ctb\", \"cph\"), comment = \"jQuery UI library; authors listed in inst/rmd/h/jqueryui/AUTHORS.txt\"), person(\"Mark\", \"Otto\", role = \"ctb\", comment = \"Bootstrap library\"), person(\"Jacob\", \"Thornton\", role = \"ctb\", comment = \"Bootstrap library\"), person(, \"Bootstrap contributors\", role = \"ctb\", comment = \"Bootstrap library\"), person(, \"Twitter, Inc\", role = \"cph\", comment = \"Bootstrap library\"), person(\"Alexander\", \"Farkas\", role = c(\"ctb\", \"cph\"), comment = \"html5shiv library\"), person(\"Scott\", \"Jehl\", role = c(\"ctb\", \"cph\"), comment = \"Respond.js library\"), person(\"Ivan\", \"Sagalaev\", role = c(\"ctb\", \"cph\"), comment = \"highlight.js library\"), person(\"Greg\", \"Franko\", role = c(\"ctb\", \"cph\"), comment = \"tocify library\"), person(\"John\", \"MacFarlane\", role = c(\"ctb\", \"cph\"), comment = \"Pandoc templates\"), person(, \"Google, Inc.\", role = c(\"ctb\", \"cph\"), comment = \"ioslides library\"), person(\"Dave\", \"Raggett\", role = \"ctb\", comment = \"slidy library\"), person(, \"W3C\", role = \"cph\", comment = \"slidy library\"), person(\"Dave\", \"Gandy\", role = c(\"ctb\", \"cph\"), comment = \"Font-Awesome\"), person(\"Ben\", \"Sperry\", role = \"ctb\", comment = \"Ionicons\"), person(, \"Drifty\", role = \"cph\", comment = \"Ionicons\"), person(\"Aidan\", \"Lister\", role = c(\"ctb\", \"cph\"), comment = \"jQuery StickyTabs\"), person(\"Benct Philip\", \"Jonsson\", role = c(\"ctb\", \"cph\"), comment = \"pagebreak Lua filter\"), person(\"Albert\", \"Krewinkel\", role = c(\"ctb\", \"cph\"), comment = \"pagebreak Lua filter\") )", + "Description": "Convert R Markdown documents into a variety of formats.", + "License": "GPL-3", + "URL": "https://github.com/rstudio/rmarkdown, https://pkgs.rstudio.com/rmarkdown/", + "BugReports": "https://github.com/rstudio/rmarkdown/issues", + "Depends": [ + "R (>= 3.0)" + ], + "Imports": [ + "bslib (>= 0.2.5.1)", + "evaluate (>= 0.13)", + "fontawesome (>= 0.5.0)", + "htmltools (>= 0.5.1)", + "jquerylib", + "jsonlite", + "knitr (>= 1.43)", + "methods", + "tinytex (>= 0.31)", + "tools", + "utils", + "xfun (>= 0.36)", + "yaml (>= 2.1.19)" + ], + "Suggests": [ + "digest", + "dygraphs", + "fs", + "rsconnect", + "downlit (>= 0.4.0)", + "katex (>= 1.4.0)", + "sass (>= 0.4.0)", + "shiny (>= 1.6.0)", + "testthat (>= 3.0.3)", + "tibble", + "vctrs", + "cleanrmd", + "withr (>= 2.4.2)", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "rstudio/quillt, pkgdown", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "pandoc (>= 1.14) - http://pandoc.org", + "NeedsCompilation": "no", + "Author": "JJ Allaire [aut], Yihui Xie [aut, cre] (), Christophe Dervieux [aut] (), Jonathan McPherson [aut], Javier Luraschi [aut], Kevin Ushey [aut], Aron Atkins [aut], Hadley Wickham [aut], Joe Cheng [aut], Winston Chang [aut], Richard Iannone [aut] (), Andrew Dunning [ctb] (), Atsushi Yasumoto [ctb, cph] (, Number sections Lua filter), Barret Schloerke [ctb], Carson Sievert [ctb] (), Devon Ryan [ctb] (), Frederik Aust [ctb] (), Jeff Allen [ctb], JooYoung Seo [ctb] (), Malcolm Barrett [ctb], Rob Hyndman [ctb], Romain Lesur [ctb], Roy Storey [ctb], Ruben Arslan [ctb], Sergio Oller [ctb], Posit Software, PBC [cph, fnd], jQuery UI contributors [ctb, cph] (jQuery UI library; authors listed in inst/rmd/h/jqueryui/AUTHORS.txt), Mark Otto [ctb] (Bootstrap library), Jacob Thornton [ctb] (Bootstrap library), Bootstrap contributors [ctb] (Bootstrap library), Twitter, Inc [cph] (Bootstrap library), Alexander Farkas [ctb, cph] (html5shiv library), Scott Jehl [ctb, cph] (Respond.js library), Ivan Sagalaev [ctb, cph] (highlight.js library), Greg Franko [ctb, cph] (tocify library), John MacFarlane [ctb, cph] (Pandoc templates), Google, Inc. [ctb, cph] (ioslides library), Dave Raggett [ctb] (slidy library), W3C [cph] (slidy library), Dave Gandy [ctb, cph] (Font-Awesome), Ben Sperry [ctb] (Ionicons), Drifty [cph] (Ionicons), Aidan Lister [ctb, cph] (jQuery StickyTabs), Benct Philip Jonsson [ctb, cph] (pagebreak Lua filter), Albert Krewinkel [ctb, cph] (pagebreak Lua filter)", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM" + }, + "rprojroot": { + "Package": "rprojroot", + "Version": "2.0.4", + "Source": "Repository", + "Title": "Finding Files in Project Subdirectories", + "Authors@R": "person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\"))", + "Description": "Robust, reliable and flexible paths to files below a project root. The 'root' of a project is defined as a directory that matches a certain criterion, e.g., it contains a certain regular file.", + "License": "MIT + file LICENSE", + "URL": "https://rprojroot.r-lib.org/, https://github.com/r-lib/rprojroot", + "BugReports": "https://github.com/r-lib/rprojroot/issues", + "Depends": [ + "R (>= 3.0.0)" + ], + "Suggests": [ + "covr", + "knitr", + "lifecycle", + "mockr", + "rlang", + "rmarkdown", + "testthat (>= 3.0.0)", + "withr" + ], + "VignetteBuilder": "knitr", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Kirill Müller [aut, cre] ()", + "Maintainer": "Kirill Müller ", + "Repository": "RSPM" + }, + "sass": { + "Package": "sass", + "Version": "0.4.10", + "Source": "Repository", + "Type": "Package", + "Title": "Syntactically Awesome Style Sheets ('Sass')", + "Description": "An 'SCSS' compiler, powered by the 'LibSass' library. With this, R developers can use variables, inheritance, and functions to generate dynamic style sheets. The package uses the 'Sass CSS' extension language, which is stable, powerful, and CSS compatible.", + "Authors@R": "c( person(\"Joe\", \"Cheng\", , \"joe@rstudio.com\", \"aut\"), person(\"Timothy\", \"Mastny\", , \"tim.mastny@gmail.com\", \"aut\"), person(\"Richard\", \"Iannone\", , \"rich@rstudio.com\", \"aut\", comment = c(ORCID = \"0000-0003-3925-190X\")), person(\"Barret\", \"Schloerke\", , \"barret@rstudio.com\", \"aut\", comment = c(ORCID = \"0000-0001-9986-114X\")), person(\"Carson\", \"Sievert\", , \"carson@rstudio.com\", c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4958-2844\")), person(\"Christophe\", \"Dervieux\", , \"cderv@rstudio.com\", c(\"ctb\"), comment = c(ORCID = \"0000-0003-4474-2498\")), person(family = \"RStudio\", role = c(\"cph\", \"fnd\")), person(family = \"Sass Open Source Foundation\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Greter\", \"Marcel\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Mifsud\", \"Michael\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Hampton\", \"Catlin\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Natalie\", \"Weizenbaum\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Chris\", \"Eppstein\", role = c(\"ctb\", \"cph\"), comment = \"LibSass library\"), person(\"Adams\", \"Joseph\", role = c(\"ctb\", \"cph\"), comment = \"json.cpp\"), person(\"Trifunovic\", \"Nemanja\", role = c(\"ctb\", \"cph\"), comment = \"utf8.h\") )", + "License": "MIT + file LICENSE", + "URL": "https://rstudio.github.io/sass/, https://github.com/rstudio/sass", + "BugReports": "https://github.com/rstudio/sass/issues", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "GNU make", + "Imports": [ + "fs (>= 1.2.4)", + "rlang (>= 0.4.10)", + "htmltools (>= 0.5.1)", + "R6", + "rappdirs" + ], + "Suggests": [ + "testthat", + "knitr", + "rmarkdown", + "withr", + "shiny", + "curl" + ], + "VignetteBuilder": "knitr", + "Config/testthat/edition": "3", + "NeedsCompilation": "yes", + "Author": "Joe Cheng [aut], Timothy Mastny [aut], Richard Iannone [aut] (), Barret Schloerke [aut] (), Carson Sievert [aut, cre] (), Christophe Dervieux [ctb] (), RStudio [cph, fnd], Sass Open Source Foundation [ctb, cph] (LibSass library), Greter Marcel [ctb, cph] (LibSass library), Mifsud Michael [ctb, cph] (LibSass library), Hampton Catlin [ctb, cph] (LibSass library), Natalie Weizenbaum [ctb, cph] (LibSass library), Chris Eppstein [ctb, cph] (LibSass library), Adams Joseph [ctb, cph] (json.cpp), Trifunovic Nemanja [ctb, cph] (utf8.h)", + "Maintainer": "Carson Sievert ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "scales": { + "Package": "scales", + "Version": "1.4.0", + "Source": "Repository", + "Title": "Scale Functions for Visualization", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Dana\", \"Seidel\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Graphical scales map data to aesthetics, and provide methods for automatically determining breaks and labels for axes and legends.", + "License": "MIT + file LICENSE", + "URL": "https://scales.r-lib.org, https://github.com/r-lib/scales", + "BugReports": "https://github.com/r-lib/scales/issues", + "Depends": [ + "R (>= 4.1)" + ], + "Imports": [ + "cli", + "farver (>= 2.0.3)", + "glue", + "labeling", + "lifecycle", + "R6", + "RColorBrewer", + "rlang (>= 1.1.0)", + "viridisLite" + ], + "Suggests": [ + "bit64", + "covr", + "dichromat", + "ggplot2", + "hms (>= 0.5.0)", + "stringi", + "testthat (>= 3.0.0)" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-04-23", + "Encoding": "UTF-8", + "LazyLoad": "yes", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut], Thomas Lin Pedersen [cre, aut] (), Dana Seidel [aut], Posit Software, PBC [cph, fnd] (03wc8by49)", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM" + }, + "stringi": { + "Package": "stringi", + "Version": "1.8.7", + "Source": "Repository", + "Date": "2025-03-27", + "Title": "Fast and Portable Character String Processing Facilities", + "Description": "A collection of character string/text/natural language processing tools for pattern searching (e.g., with 'Java'-like regular expressions or the 'Unicode' collation algorithm), random string generation, case mapping, string transliteration, concatenation, sorting, padding, wrapping, Unicode normalisation, date-time formatting and parsing, and many more. They are fast, consistent, convenient, and - thanks to 'ICU' (International Components for Unicode) - portable across all locales and platforms. Documentation about 'stringi' is provided via its website at and the paper by Gagolewski (2022, ).", + "URL": "https://stringi.gagolewski.com/, https://github.com/gagolews/stringi, https://icu.unicode.org/", + "BugReports": "https://github.com/gagolews/stringi/issues", + "SystemRequirements": "ICU4C (>= 61, optional)", + "Type": "Package", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "tools", + "utils", + "stats" + ], + "Biarch": "TRUE", + "License": "file LICENSE", + "Authors@R": "c(person(given = \"Marek\", family = \"Gagolewski\", role = c(\"aut\", \"cre\", \"cph\"), email = \"marek@gagolewski.com\", comment = c(ORCID = \"0000-0003-0637-6028\")), person(given = \"Bartek\", family = \"Tartanus\", role = \"ctb\"), person(\"Unicode, Inc. and others\", role=\"ctb\", comment = \"ICU4C source code, Unicode Character Database\") )", + "RoxygenNote": "7.3.2", + "Encoding": "UTF-8", + "NeedsCompilation": "yes", + "Author": "Marek Gagolewski [aut, cre, cph] (), Bartek Tartanus [ctb], Unicode, Inc. and others [ctb] (ICU4C source code, Unicode Character Database)", + "Maintainer": "Marek Gagolewski ", + "License_is_FOSS": "yes", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_27" + }, + "stringr": { + "Package": "stringr", + "Version": "1.5.1", + "Source": "Repository", + "Title": "Simple, Consistent Wrappers for Common String Operations", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\", \"cph\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A consistent, simple and easy to use set of wrappers around the fantastic 'stringi' package. All function and argument names (and positions) are consistent, all functions deal with \"NA\"'s and zero length vectors in the same way, and the output from one function is easy to feed into the input of another.", + "License": "MIT + file LICENSE", + "URL": "https://stringr.tidyverse.org, https://github.com/tidyverse/stringr", + "BugReports": "https://github.com/tidyverse/stringr/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli", + "glue (>= 1.6.1)", + "lifecycle (>= 1.0.3)", + "magrittr", + "rlang (>= 1.0.0)", + "stringi (>= 1.5.3)", + "vctrs (>= 0.4.0)" + ], + "Suggests": [ + "covr", + "dplyr", + "gt", + "htmltools", + "htmlwidgets", + "knitr", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre, cph], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM" + }, + "sys": { + "Package": "sys", + "Version": "3.4.3", + "Source": "Repository", + "Type": "Package", + "Title": "Powerful and Reliable Tools for Running System Commands in R", + "Authors@R": "c(person(\"Jeroen\", \"Ooms\", role = c(\"aut\", \"cre\"), email = \"jeroenooms@gmail.com\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Gábor\", \"Csárdi\", , \"csardi.gabor@gmail.com\", role = \"ctb\"))", + "Description": "Drop-in replacements for the base system2() function with fine control and consistent behavior across platforms. Supports clean interruption, timeout, background tasks, and streaming STDIN / STDOUT / STDERR over binary or text connections. Arguments on Windows automatically get encoded and quoted to work on different locales.", + "License": "MIT + file LICENSE", + "URL": "https://jeroen.r-universe.dev/sys", + "BugReports": "https://github.com/jeroen/sys/issues", + "Encoding": "UTF-8", + "RoxygenNote": "7.1.1", + "Suggests": [ + "unix (>= 1.4)", + "spelling", + "testthat" + ], + "Language": "en-US", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (), Gábor Csárdi [ctb]", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "systemfonts": { + "Package": "systemfonts", + "Version": "1.2.3", + "Source": "Repository", + "Type": "Package", + "Title": "System Native Font Finding", + "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Jeroen\", \"Ooms\", , \"jeroen@berkeley.edu\", role = \"aut\", comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"Devon\", \"Govett\", role = \"aut\", comment = \"Author of font-manager\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides system native access to the font catalogue. As font handling varies between systems it is difficult to correctly locate installed fonts across different operating systems. The 'systemfonts' package provides bindings to the native libraries on Windows, macOS and Linux for finding font files that can then be used further by e.g. graphic devices. The main use is intended to be from compiled code but 'systemfonts' also provides access from R.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/systemfonts, https://systemfonts.r-lib.org", + "BugReports": "https://github.com/r-lib/systemfonts/issues", + "Depends": [ + "R (>= 3.2.0)" + ], + "Imports": [ + "base64enc", + "grid", + "jsonlite", + "lifecycle", + "tools", + "utils" + ], + "Suggests": [ + "covr", + "farver", + "graphics", + "knitr", + "rmarkdown", + "testthat (>= 2.1.0)" + ], + "LinkingTo": [ + "cpp11 (>= 0.2.1)" + ], + "VignetteBuilder": "knitr", + "Config/build/compilation-database": "true", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/usethis/last-upkeep": "2025-04-23", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "fontconfig, freetype2", + "NeedsCompilation": "yes", + "Author": "Thomas Lin Pedersen [aut, cre] (ORCID: ), Jeroen Ooms [aut] (ORCID: ), Devon Govett [aut] (Author of font-manager), Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_28" + }, + "testthat": { + "Package": "testthat", + "Version": "3.2.3", + "Source": "Repository", + "Title": "Unit Testing for R", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"R Core team\", role = \"ctb\", comment = \"Implementation of utils::recover()\") )", + "Description": "Software testing is important, but, in part because it is frustrating and boring, many of us avoid it. 'testthat' is a testing framework for R that is easy to learn and use, and integrates with your existing 'workflow'.", + "License": "MIT + file LICENSE", + "URL": "https://testthat.r-lib.org, https://github.com/r-lib/testthat", + "BugReports": "https://github.com/r-lib/testthat/issues", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ + "brio (>= 1.1.3)", + "callr (>= 3.7.3)", + "cli (>= 3.6.1)", + "desc (>= 1.4.2)", + "digest (>= 0.6.33)", + "evaluate (>= 1.0.1)", + "jsonlite (>= 1.8.7)", + "lifecycle (>= 1.0.3)", + "magrittr (>= 2.0.3)", + "methods", + "pkgload (>= 1.3.2.1)", + "praise (>= 1.0.0)", + "processx (>= 3.8.2)", + "ps (>= 1.7.5)", + "R6 (>= 2.5.1)", + "rlang (>= 1.1.1)", + "utils", + "waldo (>= 0.6.0)", + "withr (>= 3.0.2)" + ], + "Suggests": [ + "covr", + "curl (>= 0.9.5)", + "diffviewer (>= 0.1.0)", + "knitr", + "rmarkdown", + "rstudioapi", + "S7", + "shiny", + "usethis", + "vctrs (>= 0.1.0)", + "xml2" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "watcher, parallel*", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre], Posit Software, PBC [cph, fnd], R Core team [ctb] (Implementation of utils::recover())", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_24" + }, + "textshaping": { + "Package": "textshaping", + "Version": "1.0.1", + "Source": "Repository", + "Title": "Bindings to the 'HarfBuzz' and 'Fribidi' Libraries for Text Shaping", + "Authors@R": "c( person(\"Thomas Lin\", \"Pedersen\", , \"thomas.pedersen@posit.co\", role = c(\"cre\", \"aut\"), comment = c(ORCID = \"0000-0002-5147-4711\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\"), comment = c(ROR = \"03wc8by49\")) )", + "Description": "Provides access to the text shaping functionality in the 'HarfBuzz' library and the bidirectional algorithm in the 'Fribidi' library. 'textshaping' is a low-level utility package mainly for graphic devices that expands upon the font tool-set provided by the 'systemfonts' package.", + "License": "MIT + file LICENSE", + "URL": "https://github.com/r-lib/textshaping", + "BugReports": "https://github.com/r-lib/textshaping/issues", + "Depends": [ + "R (>= 3.2.0)" + ], + "Imports": [ + "lifecycle", + "stats", + "stringi", + "systemfonts (>= 1.1.0)", + "utils" + ], + "Suggests": [ + "covr", + "grDevices", + "grid", + "knitr", + "rmarkdown", + "testthat (>= 3.0.0)" + ], + "LinkingTo": [ + "cpp11 (>= 0.2.1)", + "systemfonts (>= 1.0.0)" + ], + "VignetteBuilder": "knitr", + "Config/build/compilation-database": "true", + "Config/testthat/edition": "3", + "Config/usethis/last-upkeep": "2025-04-23", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "SystemRequirements": "freetype2, harfbuzz, fribidi", + "NeedsCompilation": "yes", + "Author": "Thomas Lin Pedersen [cre, aut] (ORCID: ), Posit Software, PBC [cph, fnd] (ROR: )", + "Maintainer": "Thomas Lin Pedersen ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_27" + }, + "tibble": { + "Package": "tibble", + "Version": "3.3.0", + "Source": "Repository", + "Title": "Simple Data Frames", + "Authors@R": "c(person(given = \"Kirill\", family = \"M\\u00fcller\", role = c(\"aut\", \"cre\"), email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Hadley\", family = \"Wickham\", role = \"aut\", email = \"hadley@rstudio.com\"), person(given = \"Romain\", family = \"Francois\", role = \"ctb\", email = \"romain@r-enthusiasts.com\"), person(given = \"Jennifer\", family = \"Bryan\", role = \"ctb\", email = \"jenny@rstudio.com\"), person(given = \"RStudio\", role = c(\"cph\", \"fnd\")))", + "Description": "Provides a 'tbl_df' class (the 'tibble') with stricter checking and better formatting than the traditional data frame.", + "License": "MIT + file LICENSE", + "URL": "https://tibble.tidyverse.org/, https://github.com/tidyverse/tibble", + "BugReports": "https://github.com/tidyverse/tibble/issues", + "Depends": [ + "R (>= 3.4.0)" + ], + "Imports": [ + "cli", + "lifecycle (>= 1.0.0)", + "magrittr", + "methods", + "pillar (>= 1.8.1)", + "pkgconfig", + "rlang (>= 1.0.2)", + "utils", + "vctrs (>= 0.5.0)" + ], + "Suggests": [ + "bench", + "bit64", + "blob", + "brio", + "callr", + "DiagrammeR", + "dplyr", + "evaluate", + "formattable", + "ggplot2", + "here", + "hms", + "htmltools", + "knitr", + "lubridate", + "nycflights13", + "pkgload", + "purrr", + "rmarkdown", + "stringi", + "testthat (>= 3.0.2)", + "tidyr", + "withr" + ], + "VignetteBuilder": "knitr", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2.9000", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "true", + "Config/testthat/start-first": "vignette-formats, as_tibble, add, invariants", + "Config/autostyle/scope": "line_breaks", + "Config/autostyle/strict": "true", + "Config/autostyle/rmd": "false", + "Config/Needs/website": "tidyverse/tidytemplate", + "NeedsCompilation": "yes", + "Author": "Kirill Müller [aut, cre] (ORCID: ), Hadley Wickham [aut], Romain Francois [ctb], Jennifer Bryan [ctb], RStudio [cph, fnd]", + "Maintainer": "Kirill Müller ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "tidyr": { + "Package": "tidyr", + "Version": "1.3.1", + "Source": "Repository", + "Title": "Tidy Messy Data", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = \"aut\"), person(\"Maximilian\", \"Girlich\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevin@posit.co\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Tools to help to create tidy data, where each column is a variable, each row is an observation, and each cell contains a single value. 'tidyr' contains tools for changing the shape (pivoting) and hierarchy (nesting and 'unnesting') of a dataset, turning deeply nested lists into rectangular data frames ('rectangling'), and extracting values out of string columns. It also includes tools for working with missing values (both implicit and explicit).", + "License": "MIT + file LICENSE", + "URL": "https://tidyr.tidyverse.org, https://github.com/tidyverse/tidyr", + "BugReports": "https://github.com/tidyverse/tidyr/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "cli (>= 3.4.1)", + "dplyr (>= 1.0.10)", + "glue", + "lifecycle (>= 1.0.3)", + "magrittr", + "purrr (>= 1.0.1)", + "rlang (>= 1.1.1)", + "stringr (>= 1.5.0)", + "tibble (>= 2.1.1)", + "tidyselect (>= 1.2.0)", + "utils", + "vctrs (>= 0.5.2)" + ], + "Suggests": [ + "covr", + "data.table", + "knitr", + "readr", + "repurrrsive (>= 1.1.0)", + "rmarkdown", + "testthat (>= 3.0.0)" + ], + "LinkingTo": [ + "cpp11 (>= 0.4.0)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "LazyData": "true", + "RoxygenNote": "7.3.0", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut, cre], Davis Vaughan [aut], Maximilian Girlich [aut], Kevin Ushey [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "https://p3m.dev/cran/latest" + }, + "tidyselect": { + "Package": "tidyselect", + "Version": "1.2.1", + "Source": "Repository", + "Title": "Select from a Set of Strings", + "Authors@R": "c( person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A backend for the selecting functions of the 'tidyverse'. It makes it easy to implement select-like functions in your own packages in a way that is consistent with other 'tidyverse' interfaces for selection.", + "License": "MIT + file LICENSE", + "URL": "https://tidyselect.r-lib.org, https://github.com/r-lib/tidyselect", + "BugReports": "https://github.com/r-lib/tidyselect/issues", + "Depends": [ + "R (>= 3.4)" + ], + "Imports": [ + "cli (>= 3.3.0)", + "glue (>= 1.3.0)", + "lifecycle (>= 1.0.3)", + "rlang (>= 1.0.4)", + "vctrs (>= 0.5.2)", + "withr" + ], + "Suggests": [ + "covr", + "crayon", + "dplyr", + "knitr", + "magrittr", + "rmarkdown", + "stringr", + "testthat (>= 3.1.1)", + "tibble (>= 2.1.3)" + ], + "VignetteBuilder": "knitr", + "ByteCompile": "true", + "Config/testthat/edition": "3", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.0.9000", + "NeedsCompilation": "yes", + "Author": "Lionel Henry [aut, cre], Hadley Wickham [aut], Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "https://p3m.dev/cran/latest" + }, + "tinytex": { + "Package": "tinytex", + "Version": "0.57", + "Source": "Repository", + "Type": "Package", + "Title": "Helper Functions to Install and Maintain TeX Live, and Compile LaTeX Documents", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\", \"cph\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\")), person(given = \"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"Christophe\", \"Dervieux\", role = \"ctb\", comment = c(ORCID = \"0000-0003-4474-2498\")), person(\"Devon\", \"Ryan\", role = \"ctb\", email = \"dpryan79@gmail.com\", comment = c(ORCID = \"0000-0002-8549-0971\")), person(\"Ethan\", \"Heinzen\", role = \"ctb\"), person(\"Fernando\", \"Cagua\", role = \"ctb\"), person() )", + "Description": "Helper functions to install and maintain the 'LaTeX' distribution named 'TinyTeX' (), a lightweight, cross-platform, portable, and easy-to-maintain version of 'TeX Live'. This package also contains helper functions to compile 'LaTeX' documents, and install missing 'LaTeX' packages automatically.", + "Imports": [ + "xfun (>= 0.48)" + ], + "Suggests": [ + "testit", + "rstudioapi" + ], + "License": "MIT + file LICENSE", + "URL": "https://github.com/rstudio/tinytex", + "BugReports": "https://github.com/rstudio/tinytex/issues", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Yihui Xie [aut, cre, cph] (), Posit Software, PBC [cph, fnd], Christophe Dervieux [ctb] (), Devon Ryan [ctb] (), Ethan Heinzen [ctb], Fernando Cagua [ctb]", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM" + }, + "tzdb": { + "Package": "tzdb", + "Version": "0.5.0", + "Source": "Repository", + "Title": "Time Zone Database Information", + "Authors@R": "c( person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = c(\"aut\", \"cre\")), person(\"Howard\", \"Hinnant\", role = \"cph\", comment = \"Author of the included date library\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Provides an up-to-date copy of the Internet Assigned Numbers Authority (IANA) Time Zone Database. It is updated periodically to reflect changes made by political bodies to time zone boundaries, UTC offsets, and daylight saving time rules. Additionally, this package provides a C++ interface for working with the 'date' library. 'date' provides comprehensive support for working with dates and date-times, which this package exposes to make it easier for other R packages to utilize. Headers are provided for calendar specific calculations, along with a limited interface for time zone manipulations.", + "License": "MIT + file LICENSE", + "URL": "https://tzdb.r-lib.org, https://github.com/r-lib/tzdb", + "BugReports": "https://github.com/r-lib/tzdb/issues", + "Depends": [ + "R (>= 4.0.0)" + ], + "Suggests": [ + "covr", + "testthat (>= 3.0.0)" + ], + "LinkingTo": [ + "cpp11 (>= 0.5.2)" + ], + "Biarch": "yes", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "yes", + "Author": "Davis Vaughan [aut, cre], Howard Hinnant [cph] (Author of the included date library), Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "https://p3m.dev/cran/latest" + }, + "utf8": { + "Package": "utf8", + "Version": "1.2.6", + "Source": "Repository", + "Title": "Unicode Text Processing", + "Authors@R": "c(person(given = c(\"Patrick\", \"O.\"), family = \"Perry\", role = c(\"aut\", \"cph\")), person(given = \"Kirill\", family = \"M\\u00fcller\", role = \"cre\", email = \"kirill@cynkra.com\", comment = c(ORCID = \"0000-0002-1416-3412\")), person(given = \"Unicode, Inc.\", role = c(\"cph\", \"dtc\"), comment = \"Unicode Character Database\"))", + "Description": "Process and print 'UTF-8' encoded international text (Unicode). Input, validate, normalize, encode, format, and display.", + "License": "Apache License (== 2.0) | file LICENSE", + "URL": "https://krlmlr.github.io/utf8/, https://github.com/krlmlr/utf8", + "BugReports": "https://github.com/krlmlr/utf8/issues", + "Depends": [ + "R (>= 2.10)" + ], + "Suggests": [ + "cli", + "covr", + "knitr", + "rlang", + "rmarkdown", + "testthat (>= 3.0.0)", + "withr" + ], + "VignetteBuilder": "knitr, rmarkdown", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2.9000", + "NeedsCompilation": "yes", + "Author": "Patrick O. Perry [aut, cph], Kirill Müller [cre] (ORCID: ), Unicode, Inc. [cph, dtc] (Unicode Character Database)", + "Maintainer": "Kirill Müller ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "vctrs": { + "Package": "vctrs", + "Version": "0.6.5", + "Source": "Repository", + "Title": "Vector Helpers", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = \"aut\"), person(\"Davis\", \"Vaughan\", , \"davis@posit.co\", role = c(\"aut\", \"cre\")), person(\"data.table team\", role = \"cph\", comment = \"Radix sort based on data.table's forder() and their contribution to R's order()\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Defines new notions of prototype and size that are used to provide tools for consistent and well-founded type-coercion and size-recycling, and are in turn connected to ideas of type- and size-stability useful for analysing function interfaces.", + "License": "MIT + file LICENSE", + "URL": "https://vctrs.r-lib.org/, https://github.com/r-lib/vctrs", + "BugReports": "https://github.com/r-lib/vctrs/issues", + "Depends": [ + "R (>= 3.5.0)" + ], + "Imports": [ + "cli (>= 3.4.0)", + "glue", + "lifecycle (>= 1.0.3)", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "bit64", + "covr", + "crayon", + "dplyr (>= 0.8.5)", + "generics", + "knitr", + "pillar (>= 1.4.4)", + "pkgdown (>= 2.0.1)", + "rmarkdown", + "testthat (>= 3.0.0)", + "tibble (>= 3.1.3)", + "waldo (>= 0.2.0)", + "withr", + "xml2", + "zeallot" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "Language": "en-GB", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut], Lionel Henry [aut], Davis Vaughan [aut, cre], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), Posit Software, PBC [cph, fnd]", + "Maintainer": "Davis Vaughan ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "viridisLite": { + "Package": "viridisLite", + "Version": "0.4.2", + "Source": "Repository", + "Type": "Package", + "Title": "Colorblind-Friendly Color Maps (Lite Version)", + "Date": "2023-05-02", + "Authors@R": "c( person(\"Simon\", \"Garnier\", email = \"garnier@njit.edu\", role = c(\"aut\", \"cre\")), person(\"Noam\", \"Ross\", email = \"noam.ross@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Bob\", \"Rudis\", email = \"bob@rud.is\", role = c(\"ctb\", \"cph\")), person(\"Marco\", \"Sciaini\", email = \"sciaini.marco@gmail.com\", role = c(\"ctb\", \"cph\")), person(\"Antônio Pedro\", \"Camargo\", role = c(\"ctb\", \"cph\")), person(\"Cédric\", \"Scherer\", email = \"scherer@izw-berlin.de\", role = c(\"ctb\", \"cph\")) )", + "Maintainer": "Simon Garnier ", + "Description": "Color maps designed to improve graph readability for readers with common forms of color blindness and/or color vision deficiency. The color maps are also perceptually-uniform, both in regular form and also when converted to black-and-white for printing. This is the 'lite' version of the 'viridis' package that also contains 'ggplot2' bindings for discrete and continuous color and fill scales and can be found at .", + "License": "MIT + file LICENSE", + "Encoding": "UTF-8", + "Depends": [ + "R (>= 2.10)" + ], + "Suggests": [ + "hexbin (>= 1.27.0)", + "ggplot2 (>= 1.0.1)", + "testthat", + "covr" + ], + "URL": "https://sjmgarnier.github.io/viridisLite/, https://github.com/sjmgarnier/viridisLite/", + "BugReports": "https://github.com/sjmgarnier/viridisLite/issues/", + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Simon Garnier [aut, cre], Noam Ross [ctb, cph], Bob Rudis [ctb, cph], Marco Sciaini [ctb, cph], Antônio Pedro Camargo [ctb, cph], Cédric Scherer [ctb, cph]", + "Repository": "RSPM" + }, + "vroom": { + "Package": "vroom", + "Version": "1.6.5", + "Source": "Repository", + "Title": "Read and Write Rectangular Text Data Quickly", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\", comment = c(ORCID = \"0000-0002-2739-7082\")), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\", comment = c(ORCID = \"0000-0003-4757-117X\")), person(\"Jennifer\", \"Bryan\", , \"jenny@posit.co\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-6983-2759\")), person(\"Shelby\", \"Bearrows\", role = \"ctb\"), person(\"https://github.com/mandreyel/\", role = \"cph\", comment = \"mio library\"), person(\"Jukka\", \"Jylänki\", role = \"cph\", comment = \"grisu3 implementation\"), person(\"Mikkel\", \"Jørgensen\", role = \"cph\", comment = \"grisu3 implementation\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "The goal of 'vroom' is to read and write data (like 'csv', 'tsv' and 'fwf') quickly. When reading it uses a quick initial indexing step, then reads the values lazily , so only the data you actually use needs to be read. The writer formats the data in parallel and writes to disk asynchronously from formatting.", + "License": "MIT + file LICENSE", + "URL": "https://vroom.r-lib.org, https://github.com/tidyverse/vroom", + "BugReports": "https://github.com/tidyverse/vroom/issues", + "Depends": [ + "R (>= 3.6)" + ], + "Imports": [ + "bit64", + "cli (>= 3.2.0)", + "crayon", + "glue", + "hms", + "lifecycle (>= 1.0.3)", + "methods", + "rlang (>= 0.4.2)", + "stats", + "tibble (>= 2.0.0)", + "tidyselect", + "tzdb (>= 0.1.1)", + "vctrs (>= 0.2.0)", + "withr" + ], + "Suggests": [ + "archive", + "bench (>= 1.1.0)", + "covr", + "curl", + "dplyr", + "forcats", + "fs", + "ggplot2", + "knitr", + "patchwork", + "prettyunits", + "purrr", + "rmarkdown", + "rstudioapi", + "scales", + "spelling", + "testthat (>= 2.1.0)", + "tidyr", + "utils", + "waldo", + "xml2" + ], + "LinkingTo": [ + "cpp11 (>= 0.2.0)", + "progress (>= 1.2.1)", + "tzdb (>= 0.1.1)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "nycflights13, tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Config/testthat/parallel": "false", + "Copyright": "file COPYRIGHTS", + "Encoding": "UTF-8", + "Language": "en-US", + "RoxygenNote": "7.2.3.9000", + "NeedsCompilation": "yes", + "Author": "Jim Hester [aut] (), Hadley Wickham [aut] (), Jennifer Bryan [aut, cre] (), Shelby Bearrows [ctb], https://github.com/mandreyel/ [cph] (mio library), Jukka Jylänki [cph] (grisu3 implementation), Mikkel Jørgensen [cph] (grisu3 implementation), Posit Software, PBC [cph, fnd]", + "Maintainer": "Jennifer Bryan ", + "Repository": "https://p3m.dev/cran/latest" + }, + "waffle": { + "Package": "waffle", + "Version": "1.0.2", + "Source": "Repository", + "Type": "Package", + "Title": "Create Waffle Chart Visualizations", + "Date": "2023-09-30", + "Authors@R": "c( person(\"Bob\", \"Rudis\", email = \"bob@rud.is\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0001-5670-2640\")), person(\"Dave\", \"Gandy\", role = \"aut\", comment = \"Font Awesome\"), person(\"Andrew\", \"Breza\", email = \"andrew.breza@gmail.com\", role = \"ctb\"), person(\"Matthias\", \"Jütte\", role = \"ctb\"), person(\"Paul\", \"Campbell\", email = \"pacampbell91@gmail.com\", role = \"ctb\", comment = \"geom_bar flip\") )", + "Maintainer": "Bob Rudis ", + "Description": "Square pie charts (a.k.a. waffle charts) can be used to communicate parts of a whole for categorical quantities. To emulate the percentage view of a pie chart, a 10x10 grid should be used with each square representing 1% of the total. Modern uses of waffle charts do not necessarily adhere to this rule and can be created with a grid of any rectangular shape. Best practices suggest keeping the number of categories small, just as should be done when creating pie charts. Tools are provided to create waffle charts as well as stitch them together, and to use glyphs for making isotype pictograms.", + "Encoding": "UTF-8", + "Copyright": "file inst/COPYRIGHTS", + "Suggests": [ + "knitr", + "rmarkdown", + "dplyr", + "ggthemes" + ], + "Depends": [ + "R (>= 3.5.0)", + "ggplot2 (>= 3.1.0)" + ], + "License": "GPL (>= 2)", + "Imports": [ + "RColorBrewer", + "grid", + "gridExtra", + "gtable", + "extrafont", + "curl", + "stringr", + "stats", + "htmlwidgets", + "DT", + "plyr", + "rlang", + "utils" + ], + "RoxygenNote": "7.2.3", + "NeedsCompilation": "no", + "Author": "Bob Rudis [aut, cre] (), Dave Gandy [aut] (Font Awesome), Andrew Breza [ctb], Matthias Jütte [ctb], Paul Campbell [ctb] (geom_bar flip)", + "Repository": "CRAN" + }, + "waldo": { + "Package": "waldo", + "Version": "0.6.1", + "Source": "Repository", + "Title": "Find Differences Between R Objects", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "Compare complex R objects and reveal the key differences. Designed particularly for use in testing packages where being able to quickly isolate key differences makes understanding test failures much easier.", + "License": "MIT + file LICENSE", + "URL": "https://waldo.r-lib.org, https://github.com/r-lib/waldo", + "BugReports": "https://github.com/r-lib/waldo/issues", + "Depends": [ + "R (>= 4.0)" + ], + "Imports": [ + "cli", + "diffobj (>= 0.3.4)", + "glue", + "methods", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "bit64", + "R6", + "S7", + "testthat (>= 3.0.0)", + "withr", + "xml2" + ], + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "NeedsCompilation": "no", + "Author": "Hadley Wickham [aut, cre], Posit Software, PBC [cph, fnd]", + "Maintainer": "Hadley Wickham ", + "Repository": "RSPM" + }, + "whisker": { + "Package": "whisker", + "Version": "0.4.1", + "Source": "Repository", + "Maintainer": "Edwin de Jonge ", + "License": "GPL-3", + "Title": "{{mustache}} for R, Logicless Templating", + "Type": "Package", + "LazyLoad": "yes", + "Author": "Edwin de Jonge", + "Description": "Implements 'Mustache' logicless templating.", + "URL": "https://github.com/edwindj/whisker", + "Suggests": [ + "markdown" + ], + "RoxygenNote": "6.1.1", + "NeedsCompilation": "no", + "Repository": "RSPM", + "Encoding": "UTF-8" + }, + "withr": { + "Package": "withr", + "Version": "3.0.2", + "Source": "Repository", + "Title": "Run Code 'With' Temporarily Modified Global State", + "Authors@R": "c( person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Lionel\", \"Henry\", , \"lionel@posit.co\", role = c(\"aut\", \"cre\")), person(\"Kirill\", \"Müller\", , \"krlmlr+r@mailbox.org\", role = \"aut\"), person(\"Kevin\", \"Ushey\", , \"kevinushey@gmail.com\", role = \"aut\"), person(\"Hadley\", \"Wickham\", , \"hadley@posit.co\", role = \"aut\"), person(\"Winston\", \"Chang\", role = \"aut\"), person(\"Jennifer\", \"Bryan\", role = \"ctb\"), person(\"Richard\", \"Cotton\", role = \"ctb\"), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")) )", + "Description": "A set of functions to run code 'with' safely and temporarily modified global state. Many of these functions were originally a part of the 'devtools' package, this provides a simple package with limited dependencies to provide access to these functions.", + "License": "MIT + file LICENSE", + "URL": "https://withr.r-lib.org, https://github.com/r-lib/withr#readme", + "BugReports": "https://github.com/r-lib/withr/issues", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ + "graphics", + "grDevices" + ], + "Suggests": [ + "callr", + "DBI", + "knitr", + "methods", + "rlang", + "rmarkdown (>= 2.12)", + "RSQLite", + "testthat (>= 3.0.0)" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Config/testthat/edition": "3", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "Collate": "'aaa.R' 'collate.R' 'connection.R' 'db.R' 'defer-exit.R' 'standalone-defer.R' 'defer.R' 'devices.R' 'local_.R' 'with_.R' 'dir.R' 'env.R' 'file.R' 'language.R' 'libpaths.R' 'locale.R' 'makevars.R' 'namespace.R' 'options.R' 'par.R' 'path.R' 'rng.R' 'seed.R' 'wrap.R' 'sink.R' 'tempfile.R' 'timezone.R' 'torture.R' 'utils.R' 'with.R'", + "NeedsCompilation": "no", + "Author": "Jim Hester [aut], Lionel Henry [aut, cre], Kirill Müller [aut], Kevin Ushey [aut], Hadley Wickham [aut], Winston Chang [aut], Jennifer Bryan [ctb], Richard Cotton [ctb], Posit Software, PBC [cph, fnd]", + "Maintainer": "Lionel Henry ", + "Repository": "RSPM" + }, + "writexl": { + "Package": "writexl", + "Version": "1.5.4", + "Source": "Repository", + "Type": "Package", + "Title": "Export Data Frames to Excel 'xlsx' Format", + "Authors@R": "c( person(\"Jeroen\", \"Ooms\", ,\"jeroenooms@gmail.com\", role = c(\"aut\", \"cre\"), comment = c(ORCID = \"0000-0002-4035-0289\")), person(\"John McNamara\", role = \"cph\", comment = \"Author of libxlsxwriter (see AUTHORS and COPYRIGHT files for details)\"))", + "Description": "Zero-dependency data frame to xlsx exporter based on 'libxlsxwriter' . Fast and no Java or Excel required.", + "License": "BSD_2_clause + file LICENSE", + "Encoding": "UTF-8", + "URL": "https://ropensci.r-universe.dev/writexl https://docs.ropensci.org/writexl/", + "BugReports": "https://github.com/ropensci/writexl/issues", + "RoxygenNote": "7.0.2", + "Suggests": [ + "spelling", + "readxl", + "nycflights13", + "testthat", + "bit64" + ], + "Language": "en-US", + "SystemRequirements": "zlib", + "NeedsCompilation": "yes", + "Author": "Jeroen Ooms [aut, cre] (), John McNamara [cph] (Author of libxlsxwriter (see AUTHORS and COPYRIGHT files for details))", + "Maintainer": "Jeroen Ooms ", + "Repository": "CRAN", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + }, + "xfun": { + "Package": "xfun", + "Version": "0.52", + "Source": "Repository", + "Type": "Package", + "Title": "Supporting Functions for Packages Maintained by 'Yihui Xie'", + "Authors@R": "c( person(\"Yihui\", \"Xie\", role = c(\"aut\", \"cre\", \"cph\"), email = \"xie@yihui.name\", comment = c(ORCID = \"0000-0003-0645-5666\", URL = \"https://yihui.org\")), person(\"Wush\", \"Wu\", role = \"ctb\"), person(\"Daijiang\", \"Li\", role = \"ctb\"), person(\"Xianying\", \"Tan\", role = \"ctb\"), person(\"Salim\", \"Brüggemann\", role = \"ctb\", email = \"salim-b@pm.me\", comment = c(ORCID = \"0000-0002-5329-5987\")), person(\"Christophe\", \"Dervieux\", role = \"ctb\"), person() )", + "Description": "Miscellaneous functions commonly used in other packages maintained by 'Yihui Xie'.", + "Depends": [ + "R (>= 3.2.0)" + ], + "Imports": [ + "grDevices", + "stats", + "tools" + ], + "Suggests": [ + "testit", + "parallel", + "codetools", + "methods", + "rstudioapi", + "tinytex (>= 0.30)", + "mime", + "litedown (>= 0.4)", + "commonmark", + "knitr (>= 1.50)", + "remotes", + "pak", + "curl", + "xml2", + "jsonlite", + "magick", + "yaml", + "qs" + ], + "License": "MIT + file LICENSE", + "URL": "https://github.com/yihui/xfun", + "BugReports": "https://github.com/yihui/xfun/issues", + "Encoding": "UTF-8", + "RoxygenNote": "7.3.2", + "VignetteBuilder": "litedown", + "NeedsCompilation": "yes", + "Author": "Yihui Xie [aut, cre, cph] (, https://yihui.org), Wush Wu [ctb], Daijiang Li [ctb], Xianying Tan [ctb], Salim Brüggemann [ctb] (), Christophe Dervieux [ctb]", + "Maintainer": "Yihui Xie ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_5" + }, + "xml2": { + "Package": "xml2", + "Version": "1.3.8", + "Source": "Repository", + "Title": "Parse XML", + "Authors@R": "c( person(\"Hadley\", \"Wickham\", role = \"aut\"), person(\"Jim\", \"Hester\", role = \"aut\"), person(\"Jeroen\", \"Ooms\", email = \"jeroenooms@gmail.com\", role = c(\"aut\", \"cre\")), person(\"Posit Software, PBC\", role = c(\"cph\", \"fnd\")), person(\"R Foundation\", role = \"ctb\", comment = \"Copy of R-project homepage cached as example\") )", + "Description": "Bindings to 'libxml2' for working with XML data using a simple, consistent interface based on 'XPath' expressions. Also supports XML schema validation; for 'XSLT' transformations see the 'xslt' package.", + "License": "MIT + file LICENSE", + "URL": "https://xml2.r-lib.org, https://r-lib.r-universe.dev/xml2", + "BugReports": "https://github.com/r-lib/xml2/issues", + "Depends": [ + "R (>= 3.6.0)" + ], + "Imports": [ + "cli", + "methods", + "rlang (>= 1.1.0)" + ], + "Suggests": [ + "covr", + "curl", + "httr", + "knitr", + "magrittr", + "mockery", + "rmarkdown", + "testthat (>= 3.2.0)", + "xslt" + ], + "VignetteBuilder": "knitr", + "Config/Needs/website": "tidyverse/tidytemplate", + "Encoding": "UTF-8", + "RoxygenNote": "7.2.3", + "SystemRequirements": "libxml2: libxml2-dev (deb), libxml2-devel (rpm)", + "Collate": "'S4.R' 'as_list.R' 'xml_parse.R' 'as_xml_document.R' 'classes.R' 'format.R' 'import-standalone-obj-type.R' 'import-standalone-purrr.R' 'import-standalone-types-check.R' 'init.R' 'nodeset_apply.R' 'paths.R' 'utils.R' 'xml2-package.R' 'xml_attr.R' 'xml_children.R' 'xml_document.R' 'xml_find.R' 'xml_missing.R' 'xml_modify.R' 'xml_name.R' 'xml_namespaces.R' 'xml_node.R' 'xml_nodeset.R' 'xml_path.R' 'xml_schema.R' 'xml_serialize.R' 'xml_structure.R' 'xml_text.R' 'xml_type.R' 'xml_url.R' 'xml_write.R' 'zzz.R'", + "Config/testthat/edition": "3", + "NeedsCompilation": "yes", + "Author": "Hadley Wickham [aut], Jim Hester [aut], Jeroen Ooms [aut, cre], Posit Software, PBC [cph, fnd], R Foundation [ctb] (Copy of R-project homepage cached as example)", + "Maintainer": "Jeroen Ooms ", + "Repository": "RSPM", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_28" + }, + "yaml": { + "Package": "yaml", + "Version": "2.3.10", + "Source": "Repository", + "Type": "Package", + "Title": "Methods to Convert R Data to YAML and Back", + "Date": "2024-07-22", + "Suggests": [ + "RUnit" + ], + "Author": "Shawn P Garbett [aut], Jeremy Stephens [aut, cre], Kirill Simonov [aut], Yihui Xie [ctb], Zhuoer Dong [ctb], Hadley Wickham [ctb], Jeffrey Horner [ctb], reikoch [ctb], Will Beasley [ctb], Brendan O'Connor [ctb], Gregory R. Warnes [ctb], Michael Quinn [ctb], Zhian N. Kamvar [ctb], Charlie Gao [ctb]", + "Maintainer": "Shawn Garbett ", + "License": "BSD_3_clause + file LICENSE", + "Description": "Implements the 'libyaml' 'YAML' 1.1 parser and emitter () for R.", + "URL": "https://github.com/vubiostat/r-yaml/", + "BugReports": "https://github.com/vubiostat/r-yaml/issues", + "NeedsCompilation": "yes", + "Repository": "RSPM", + "Encoding": "UTF-8", + "Platform": "x86_64-pc-linux-gnu-manylinux_2_17" + } + } +} diff --git a/renv/.gitignore b/renv/.gitignore new file mode 100644 index 0000000..0ec0cbb --- /dev/null +++ b/renv/.gitignore @@ -0,0 +1,7 @@ +library/ +local/ +cellar/ +lock/ +python/ +sandbox/ +staging/ diff --git a/renv/activate.R b/renv/activate.R new file mode 100644 index 0000000..90b251c --- /dev/null +++ b/renv/activate.R @@ -0,0 +1,1334 @@ + +local({ + + # the requested version of renv + version <- "1.1.4" + attr(version, "sha") <- NULL + + # the project directory + project <- Sys.getenv("RENV_PROJECT") + if (!nzchar(project)) + project <- getwd() + + # use start-up diagnostics if enabled + diagnostics <- Sys.getenv("RENV_STARTUP_DIAGNOSTICS", unset = "FALSE") + if (diagnostics) { + start <- Sys.time() + profile <- tempfile("renv-startup-", fileext = ".Rprof") + utils::Rprof(profile) + on.exit({ + utils::Rprof(NULL) + elapsed <- signif(difftime(Sys.time(), start, units = "auto"), digits = 2L) + writeLines(sprintf("- renv took %s to run the autoloader.", format(elapsed))) + writeLines(sprintf("- Profile: %s", profile)) + print(utils::summaryRprof(profile)) + }, add = TRUE) + } + + # figure out whether the autoloader is enabled + enabled <- local({ + + # first, check config option + override <- getOption("renv.config.autoloader.enabled") + if (!is.null(override)) + return(override) + + # if we're being run in a context where R_LIBS is already set, + # don't load -- presumably we're being run as a sub-process and + # the parent process has already set up library paths for us + rcmd <- Sys.getenv("R_CMD", unset = NA) + rlibs <- Sys.getenv("R_LIBS", unset = NA) + if (!is.na(rlibs) && !is.na(rcmd)) + return(FALSE) + + # next, check environment variables + # prefer using the configuration one in the future + envvars <- c( + "RENV_CONFIG_AUTOLOADER_ENABLED", + "RENV_AUTOLOADER_ENABLED", + "RENV_ACTIVATE_PROJECT" + ) + + for (envvar in envvars) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(tolower(envval) %in% c("true", "t", "1")) + } + + # enable by default + TRUE + + }) + + # bail if we're not enabled + if (!enabled) { + + # if we're not enabled, we might still need to manually load + # the user profile here + profile <- Sys.getenv("R_PROFILE_USER", unset = "~/.Rprofile") + if (file.exists(profile)) { + cfg <- Sys.getenv("RENV_CONFIG_USER_PROFILE", unset = "TRUE") + if (tolower(cfg) %in% c("true", "t", "1")) + sys.source(profile, envir = globalenv()) + } + + return(FALSE) + + } + + # avoid recursion + if (identical(getOption("renv.autoloader.running"), TRUE)) { + warning("ignoring recursive attempt to run renv autoloader") + return(invisible(TRUE)) + } + + # signal that we're loading renv during R startup + options(renv.autoloader.running = TRUE) + on.exit(options(renv.autoloader.running = NULL), add = TRUE) + + # signal that we've consented to use renv + options(renv.consent = TRUE) + + # load the 'utils' package eagerly -- this ensures that renv shims, which + # mask 'utils' packages, will come first on the search path + library(utils, lib.loc = .Library) + + # unload renv if it's already been loaded + if ("renv" %in% loadedNamespaces()) + unloadNamespace("renv") + + # load bootstrap tools + ansify <- function(text) { + if (renv_ansify_enabled()) + renv_ansify_enhanced(text) + else + renv_ansify_default(text) + } + + renv_ansify_enabled <- function() { + + override <- Sys.getenv("RENV_ANSIFY_ENABLED", unset = NA) + if (!is.na(override)) + return(as.logical(override)) + + pane <- Sys.getenv("RSTUDIO_CHILD_PROCESS_PANE", unset = NA) + if (identical(pane, "build")) + return(FALSE) + + testthat <- Sys.getenv("TESTTHAT", unset = "false") + if (tolower(testthat) %in% "true") + return(FALSE) + + iderun <- Sys.getenv("R_CLI_HAS_HYPERLINK_IDE_RUN", unset = "false") + if (tolower(iderun) %in% "false") + return(FALSE) + + TRUE + + } + + renv_ansify_default <- function(text) { + text + } + + renv_ansify_enhanced <- function(text) { + + # R help links + pattern <- "`\\?(renv::(?:[^`])+)`" + replacement <- "`\033]8;;x-r-help:\\1\a?\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # runnable code + pattern <- "`(renv::(?:[^`])+)`" + replacement <- "`\033]8;;x-r-run:\\1\a\\1\033]8;;\a`" + text <- gsub(pattern, replacement, text, perl = TRUE) + + # return ansified text + text + + } + + renv_ansify_init <- function() { + + envir <- renv_envir_self() + if (renv_ansify_enabled()) + assign("ansify", renv_ansify_enhanced, envir = envir) + else + assign("ansify", renv_ansify_default, envir = envir) + + } + + `%||%` <- function(x, y) { + if (is.null(x)) y else x + } + + catf <- function(fmt, ..., appendLF = TRUE) { + + quiet <- getOption("renv.bootstrap.quiet", default = FALSE) + if (quiet) + return(invisible()) + + msg <- sprintf(fmt, ...) + cat(msg, file = stdout(), sep = if (appendLF) "\n" else "") + + invisible(msg) + + } + + header <- function(label, + ..., + prefix = "#", + suffix = "-", + n = min(getOption("width"), 78)) + { + label <- sprintf(label, ...) + n <- max(n - nchar(label) - nchar(prefix) - 2L, 8L) + if (n <= 0) + return(paste(prefix, label)) + + tail <- paste(rep.int(suffix, n), collapse = "") + paste0(prefix, " ", label, " ", tail) + + } + + heredoc <- function(text, leave = 0) { + + # remove leading, trailing whitespace + trimmed <- gsub("^\\s*\\n|\\n\\s*$", "", text) + + # split into lines + lines <- strsplit(trimmed, "\n", fixed = TRUE)[[1L]] + + # compute common indent + indent <- regexpr("[^[:space:]]", lines) + common <- min(setdiff(indent, -1L)) - leave + text <- paste(substring(lines, common), collapse = "\n") + + # substitute in ANSI links for executable renv code + ansify(text) + + } + + bootstrap <- function(version, library) { + + friendly <- renv_bootstrap_version_friendly(version) + section <- header(sprintf("Bootstrapping renv %s", friendly)) + catf(section) + + # attempt to download renv + catf("- Downloading renv ... ", appendLF = FALSE) + withCallingHandlers( + tarball <- renv_bootstrap_download(version), + error = function(err) { + catf("FAILED") + stop("failed to download:\n", conditionMessage(err)) + } + ) + catf("OK") + on.exit(unlink(tarball), add = TRUE) + + # now attempt to install + catf("- Installing renv ... ", appendLF = FALSE) + withCallingHandlers( + status <- renv_bootstrap_install(version, tarball, library), + error = function(err) { + catf("FAILED") + stop("failed to install:\n", conditionMessage(err)) + } + ) + catf("OK") + + # add empty line to break up bootstrapping from normal output + catf("") + + return(invisible()) + } + + renv_bootstrap_tests_running <- function() { + getOption("renv.tests.running", default = FALSE) + } + + renv_bootstrap_repos <- function() { + + # get CRAN repository + cran <- getOption("renv.repos.cran", "https://cloud.r-project.org") + + # check for repos override + repos <- Sys.getenv("RENV_CONFIG_REPOS_OVERRIDE", unset = NA) + if (!is.na(repos)) { + + # check for RSPM; if set, use a fallback repository for renv + rspm <- Sys.getenv("RSPM", unset = NA) + if (identical(rspm, repos)) + repos <- c(RSPM = rspm, CRAN = cran) + + return(repos) + + } + + # check for lockfile repositories + repos <- tryCatch(renv_bootstrap_repos_lockfile(), error = identity) + if (!inherits(repos, "error") && length(repos)) + return(repos) + + # retrieve current repos + repos <- getOption("repos") + + # ensure @CRAN@ entries are resolved + repos[repos == "@CRAN@"] <- cran + + # add in renv.bootstrap.repos if set + default <- c(FALLBACK = "https://cloud.r-project.org") + extra <- getOption("renv.bootstrap.repos", default = default) + repos <- c(repos, extra) + + # remove duplicates that might've snuck in + dupes <- duplicated(repos) | duplicated(names(repos)) + repos[!dupes] + + } + + renv_bootstrap_repos_lockfile <- function() { + + lockpath <- Sys.getenv("RENV_PATHS_LOCKFILE", unset = "renv.lock") + if (!file.exists(lockpath)) + return(NULL) + + lockfile <- tryCatch(renv_json_read(lockpath), error = identity) + if (inherits(lockfile, "error")) { + warning(lockfile) + return(NULL) + } + + repos <- lockfile$R$Repositories + if (length(repos) == 0) + return(NULL) + + keys <- vapply(repos, `[[`, "Name", FUN.VALUE = character(1)) + vals <- vapply(repos, `[[`, "URL", FUN.VALUE = character(1)) + names(vals) <- keys + + return(vals) + + } + + renv_bootstrap_download <- function(version) { + + sha <- attr(version, "sha", exact = TRUE) + + methods <- if (!is.null(sha)) { + + # attempting to bootstrap a development version of renv + c( + function() renv_bootstrap_download_tarball(sha), + function() renv_bootstrap_download_github(sha) + ) + + } else { + + # attempting to bootstrap a release version of renv + c( + function() renv_bootstrap_download_tarball(version), + function() renv_bootstrap_download_cran_latest(version), + function() renv_bootstrap_download_cran_archive(version) + ) + + } + + for (method in methods) { + path <- tryCatch(method(), error = identity) + if (is.character(path) && file.exists(path)) + return(path) + } + + stop("All download methods failed") + + } + + renv_bootstrap_download_impl <- function(url, destfile) { + + mode <- "wb" + + # https://bugs.r-project.org/bugzilla/show_bug.cgi?id=17715 + fixup <- + Sys.info()[["sysname"]] == "Windows" && + substring(url, 1L, 5L) == "file:" + + if (fixup) + mode <- "w+b" + + args <- list( + url = url, + destfile = destfile, + mode = mode, + quiet = TRUE + ) + + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(url) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + + do.call(utils::download.file, args) + + } + + renv_bootstrap_download_custom_headers <- function(url) { + + headers <- getOption("renv.download.headers") + if (is.null(headers)) + return(character()) + + if (!is.function(headers)) + stopf("'renv.download.headers' is not a function") + + headers <- headers(url) + if (length(headers) == 0L) + return(character()) + + if (is.list(headers)) + headers <- unlist(headers, recursive = FALSE, use.names = TRUE) + + ok <- + is.character(headers) && + is.character(names(headers)) && + all(nzchar(names(headers))) + + if (!ok) + stop("invocation of 'renv.download.headers' did not return a named character vector") + + headers + + } + + renv_bootstrap_download_cran_latest <- function(version) { + + spec <- renv_bootstrap_download_cran_latest_find(version) + type <- spec$type + repos <- spec$repos + + baseurl <- utils::contrib.url(repos = repos, type = type) + ext <- if (identical(type, "source")) + ".tar.gz" + else if (Sys.info()[["sysname"]] == "Windows") + ".zip" + else + ".tgz" + name <- sprintf("renv_%s%s", version, ext) + url <- paste(baseurl, name, sep = "/") + + destfile <- file.path(tempdir(), name) + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (inherits(status, "condition")) + return(FALSE) + + # report success and return + destfile + + } + + renv_bootstrap_download_cran_latest_find <- function(version) { + + # check whether binaries are supported on this system + binary <- + getOption("renv.bootstrap.binary", default = TRUE) && + !identical(.Platform$pkgType, "source") && + !identical(getOption("pkgType"), "source") && + Sys.info()[["sysname"]] %in% c("Darwin", "Windows") + + types <- c(if (binary) "binary", "source") + + # iterate over types + repositories + for (type in types) { + for (repos in renv_bootstrap_repos()) { + + # build arguments for utils::available.packages() call + args <- list(type = type, repos = repos) + + # add custom headers if available -- note that + # utils::available.packages() will pass this to download.file() + if ("headers" %in% names(formals(utils::download.file))) { + headers <- renv_bootstrap_download_custom_headers(repos) + if (length(headers) && is.character(headers)) + args$headers <- headers + } + + # retrieve package database + db <- tryCatch( + as.data.frame( + do.call(utils::available.packages, args), + stringsAsFactors = FALSE + ), + error = identity + ) + + if (inherits(db, "error")) + next + + # check for compatible entry + entry <- db[db$Package %in% "renv" & db$Version %in% version, ] + if (nrow(entry) == 0) + next + + # found it; return spec to caller + spec <- list(entry = entry, type = type, repos = repos) + return(spec) + + } + } + + # if we got here, we failed to find renv + fmt <- "renv %s is not available from your declared package repositories" + stop(sprintf(fmt, version)) + + } + + renv_bootstrap_download_cran_archive <- function(version) { + + name <- sprintf("renv_%s.tar.gz", version) + repos <- renv_bootstrap_repos() + urls <- file.path(repos, "src/contrib/Archive/renv", name) + destfile <- file.path(tempdir(), name) + + for (url in urls) { + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (identical(status, 0L)) + return(destfile) + + } + + return(FALSE) + + } + + renv_bootstrap_download_tarball <- function(version) { + + # if the user has provided the path to a tarball via + # an environment variable, then use it + tarball <- Sys.getenv("RENV_BOOTSTRAP_TARBALL", unset = NA) + if (is.na(tarball)) + return() + + # allow directories + if (dir.exists(tarball)) { + name <- sprintf("renv_%s.tar.gz", version) + tarball <- file.path(tarball, name) + } + + # bail if it doesn't exist + if (!file.exists(tarball)) { + + # let the user know we weren't able to honour their request + fmt <- "- RENV_BOOTSTRAP_TARBALL is set (%s) but does not exist." + msg <- sprintf(fmt, tarball) + warning(msg) + + # bail + return() + + } + + catf("- Using local tarball '%s'.", tarball) + tarball + + } + + renv_bootstrap_github_token <- function() { + for (envvar in c("GITHUB_TOKEN", "GITHUB_PAT", "GH_TOKEN")) { + envval <- Sys.getenv(envvar, unset = NA) + if (!is.na(envval)) + return(envval) + } + } + + renv_bootstrap_download_github <- function(version) { + + enabled <- Sys.getenv("RENV_BOOTSTRAP_FROM_GITHUB", unset = "TRUE") + if (!identical(enabled, "TRUE")) + return(FALSE) + + # prepare download options + token <- renv_bootstrap_github_token() + if (is.null(token)) + token <- "" + + if (nzchar(Sys.which("curl")) && nzchar(token)) { + fmt <- "--location --fail --header \"Authorization: token %s\"" + extra <- sprintf(fmt, token) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "curl", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } else if (nzchar(Sys.which("wget")) && nzchar(token)) { + fmt <- "--header=\"Authorization: token %s\"" + extra <- sprintf(fmt, token) + saved <- options("download.file.method", "download.file.extra") + options(download.file.method = "wget", download.file.extra = extra) + on.exit(do.call(base::options, saved), add = TRUE) + } + + url <- file.path("https://api.github.com/repos/rstudio/renv/tarball", version) + name <- sprintf("renv_%s.tar.gz", version) + destfile <- file.path(tempdir(), name) + + status <- tryCatch( + renv_bootstrap_download_impl(url, destfile), + condition = identity + ) + + if (!identical(status, 0L)) + return(FALSE) + + renv_bootstrap_download_augment(destfile) + + return(destfile) + + } + + # Add Sha to DESCRIPTION. This is stop gap until #890, after which we + # can use renv::install() to fully capture metadata. + renv_bootstrap_download_augment <- function(destfile) { + sha <- renv_bootstrap_git_extract_sha1_tar(destfile) + if (is.null(sha)) { + return() + } + + # Untar + tempdir <- tempfile("renv-github-") + on.exit(unlink(tempdir, recursive = TRUE), add = TRUE) + untar(destfile, exdir = tempdir) + pkgdir <- dir(tempdir, full.names = TRUE)[[1]] + + # Modify description + desc_path <- file.path(pkgdir, "DESCRIPTION") + desc_lines <- readLines(desc_path) + remotes_fields <- c( + "RemoteType: github", + "RemoteHost: api.github.com", + "RemoteRepo: renv", + "RemoteUsername: rstudio", + "RemotePkgRef: rstudio/renv", + paste("RemoteRef: ", sha), + paste("RemoteSha: ", sha) + ) + writeLines(c(desc_lines[desc_lines != ""], remotes_fields), con = desc_path) + + # Re-tar + local({ + old <- setwd(tempdir) + on.exit(setwd(old), add = TRUE) + + tar(destfile, compression = "gzip") + }) + invisible() + } + + # Extract the commit hash from a git archive. Git archives include the SHA1 + # hash as the comment field of the tarball pax extended header + # (see https://www.kernel.org/pub/software/scm/git/docs/git-archive.html) + # For GitHub archives this should be the first header after the default one + # (512 byte) header. + renv_bootstrap_git_extract_sha1_tar <- function(bundle) { + + # open the bundle for reading + # We use gzcon for everything because (from ?gzcon) + # > Reading from a connection which does not supply a 'gzip' magic + # > header is equivalent to reading from the original connection + conn <- gzcon(file(bundle, open = "rb", raw = TRUE)) + on.exit(close(conn)) + + # The default pax header is 512 bytes long and the first pax extended header + # with the comment should be 51 bytes long + # `52 comment=` (11 chars) + 40 byte SHA1 hash + len <- 0x200 + 0x33 + res <- rawToChar(readBin(conn, "raw", n = len)[0x201:len]) + + if (grepl("^52 comment=", res)) { + sub("52 comment=", "", res) + } else { + NULL + } + } + + renv_bootstrap_install <- function(version, tarball, library) { + + # attempt to install it into project library + dir.create(library, showWarnings = FALSE, recursive = TRUE) + output <- renv_bootstrap_install_impl(library, tarball) + + # check for successful install + status <- attr(output, "status") + if (is.null(status) || identical(status, 0L)) + return(status) + + # an error occurred; report it + header <- "installation of renv failed" + lines <- paste(rep.int("=", nchar(header)), collapse = "") + text <- paste(c(header, lines, output), collapse = "\n") + stop(text) + + } + + renv_bootstrap_install_impl <- function(library, tarball) { + + # invoke using system2 so we can capture and report output + bin <- R.home("bin") + exe <- if (Sys.info()[["sysname"]] == "Windows") "R.exe" else "R" + R <- file.path(bin, exe) + + args <- c( + "--vanilla", "CMD", "INSTALL", "--no-multiarch", + "-l", shQuote(path.expand(library)), + shQuote(path.expand(tarball)) + ) + + system2(R, args, stdout = TRUE, stderr = TRUE) + + } + + renv_bootstrap_platform_prefix_default <- function() { + + # read version component + version <- Sys.getenv("RENV_PATHS_VERSION", unset = "R-%v") + + # expand placeholders + placeholders <- list( + list("%v", format(getRversion()[1, 1:2])), + list("%V", format(getRversion()[1, 1:3])) + ) + + for (placeholder in placeholders) + version <- gsub(placeholder[[1L]], placeholder[[2L]], version, fixed = TRUE) + + # include SVN revision for development versions of R + # (to avoid sharing platform-specific artefacts with released versions of R) + devel <- + identical(R.version[["status"]], "Under development (unstable)") || + identical(R.version[["nickname"]], "Unsuffered Consequences") + + if (devel) + version <- paste(version, R.version[["svn rev"]], sep = "-r") + + version + + } + + renv_bootstrap_platform_prefix <- function() { + + # construct version prefix + version <- renv_bootstrap_platform_prefix_default() + + # build list of path components + components <- c(version, R.version$platform) + + # include prefix if provided by user + prefix <- renv_bootstrap_platform_prefix_impl() + if (!is.na(prefix) && nzchar(prefix)) + components <- c(prefix, components) + + # build prefix + paste(components, collapse = "/") + + } + + renv_bootstrap_platform_prefix_impl <- function() { + + # if an explicit prefix has been supplied, use it + prefix <- Sys.getenv("RENV_PATHS_PREFIX", unset = NA) + if (!is.na(prefix)) + return(prefix) + + # if the user has requested an automatic prefix, generate it + auto <- Sys.getenv("RENV_PATHS_PREFIX_AUTO", unset = NA) + if (is.na(auto) && getRversion() >= "4.4.0") + auto <- "TRUE" + + if (auto %in% c("TRUE", "True", "true", "1")) + return(renv_bootstrap_platform_prefix_auto()) + + # empty string on failure + "" + + } + + renv_bootstrap_platform_prefix_auto <- function() { + + prefix <- tryCatch(renv_bootstrap_platform_os(), error = identity) + if (inherits(prefix, "error") || prefix %in% "unknown") { + + msg <- paste( + "failed to infer current operating system", + "please file a bug report at https://github.com/rstudio/renv/issues", + sep = "; " + ) + + warning(msg) + + } + + prefix + + } + + renv_bootstrap_platform_os <- function() { + + sysinfo <- Sys.info() + sysname <- sysinfo[["sysname"]] + + # handle Windows + macOS up front + if (sysname == "Windows") + return("windows") + else if (sysname == "Darwin") + return("macos") + + # check for os-release files + for (file in c("/etc/os-release", "/usr/lib/os-release")) + if (file.exists(file)) + return(renv_bootstrap_platform_os_via_os_release(file, sysinfo)) + + # check for redhat-release files + if (file.exists("/etc/redhat-release")) + return(renv_bootstrap_platform_os_via_redhat_release()) + + "unknown" + + } + + renv_bootstrap_platform_os_via_os_release <- function(file, sysinfo) { + + # read /etc/os-release + release <- utils::read.table( + file = file, + sep = "=", + quote = c("\"", "'"), + col.names = c("Key", "Value"), + comment.char = "#", + stringsAsFactors = FALSE + ) + + vars <- as.list(release$Value) + names(vars) <- release$Key + + # get os name + os <- tolower(sysinfo[["sysname"]]) + + # read id + id <- "unknown" + for (field in c("ID", "ID_LIKE")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + id <- vars[[field]] + break + } + } + + # read version + version <- "unknown" + for (field in c("UBUNTU_CODENAME", "VERSION_CODENAME", "VERSION_ID", "BUILD_ID")) { + if (field %in% names(vars) && nzchar(vars[[field]])) { + version <- vars[[field]] + break + } + } + + # join together + paste(c(os, id, version), collapse = "-") + + } + + renv_bootstrap_platform_os_via_redhat_release <- function() { + + # read /etc/redhat-release + contents <- readLines("/etc/redhat-release", warn = FALSE) + + # infer id + id <- if (grepl("centos", contents, ignore.case = TRUE)) + "centos" + else if (grepl("redhat", contents, ignore.case = TRUE)) + "redhat" + else + "unknown" + + # try to find a version component (very hacky) + version <- "unknown" + + parts <- strsplit(contents, "[[:space:]]")[[1L]] + for (part in parts) { + + nv <- tryCatch(numeric_version(part), error = identity) + if (inherits(nv, "error")) + next + + version <- nv[1, 1] + break + + } + + paste(c("linux", id, version), collapse = "-") + + } + + renv_bootstrap_library_root_name <- function(project) { + + # use project name as-is if requested + asis <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT_ASIS", unset = "FALSE") + if (asis) + return(basename(project)) + + # otherwise, disambiguate based on project's path + id <- substring(renv_bootstrap_hash_text(project), 1L, 8L) + paste(basename(project), id, sep = "-") + + } + + renv_bootstrap_library_root <- function(project) { + + prefix <- renv_bootstrap_profile_prefix() + + path <- Sys.getenv("RENV_PATHS_LIBRARY", unset = NA) + if (!is.na(path)) + return(paste(c(path, prefix), collapse = "/")) + + path <- renv_bootstrap_library_root_impl(project) + if (!is.null(path)) { + name <- renv_bootstrap_library_root_name(project) + return(paste(c(path, prefix, name), collapse = "/")) + } + + renv_bootstrap_paths_renv("library", project = project) + + } + + renv_bootstrap_library_root_impl <- function(project) { + + root <- Sys.getenv("RENV_PATHS_LIBRARY_ROOT", unset = NA) + if (!is.na(root)) + return(root) + + type <- renv_bootstrap_project_type(project) + if (identical(type, "package")) { + userdir <- renv_bootstrap_user_dir() + return(file.path(userdir, "library")) + } + + } + + renv_bootstrap_validate_version <- function(version, description = NULL) { + + # resolve description file + # + # avoid passing lib.loc to `packageDescription()` below, since R will + # use the loaded version of the package by default anyhow. note that + # this function should only be called after 'renv' is loaded + # https://github.com/rstudio/renv/issues/1625 + description <- description %||% packageDescription("renv") + + # check whether requested version 'version' matches loaded version of renv + sha <- attr(version, "sha", exact = TRUE) + valid <- if (!is.null(sha)) + renv_bootstrap_validate_version_dev(sha, description) + else + renv_bootstrap_validate_version_release(version, description) + + if (valid) + return(TRUE) + + # the loaded version of renv doesn't match the requested version; + # give the user instructions on how to proceed + dev <- identical(description[["RemoteType"]], "github") + remote <- if (dev) + paste("rstudio/renv", description[["RemoteSha"]], sep = "@") + else + paste("renv", description[["Version"]], sep = "@") + + # display both loaded version + sha if available + friendly <- renv_bootstrap_version_friendly( + version = description[["Version"]], + sha = if (dev) description[["RemoteSha"]] + ) + + fmt <- heredoc(" + renv %1$s was loaded from project library, but this project is configured to use renv %2$s. + - Use `renv::record(\"%3$s\")` to record renv %1$s in the lockfile. + - Use `renv::restore(packages = \"renv\")` to install renv %2$s into the project library. + ") + catf(fmt, friendly, renv_bootstrap_version_friendly(version), remote) + + FALSE + + } + + renv_bootstrap_validate_version_dev <- function(version, description) { + + expected <- description[["RemoteSha"]] + if (!is.character(expected)) + return(FALSE) + + pattern <- sprintf("^\\Q%s\\E", version) + grepl(pattern, expected, perl = TRUE) + + } + + renv_bootstrap_validate_version_release <- function(version, description) { + expected <- description[["Version"]] + is.character(expected) && identical(expected, version) + } + + renv_bootstrap_hash_text <- function(text) { + + hashfile <- tempfile("renv-hash-") + on.exit(unlink(hashfile), add = TRUE) + + writeLines(text, con = hashfile) + tools::md5sum(hashfile) + + } + + renv_bootstrap_load <- function(project, libpath, version) { + + # try to load renv from the project library + if (!requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) + return(FALSE) + + # warn if the version of renv loaded does not match + renv_bootstrap_validate_version(version) + + # execute renv load hooks, if any + hooks <- getHook("renv::autoload") + for (hook in hooks) + if (is.function(hook)) + tryCatch(hook(), error = warnify) + + # load the project + renv::load(project) + + TRUE + + } + + renv_bootstrap_profile_load <- function(project) { + + # if RENV_PROFILE is already set, just use that + profile <- Sys.getenv("RENV_PROFILE", unset = NA) + if (!is.na(profile) && nzchar(profile)) + return(profile) + + # check for a profile file (nothing to do if it doesn't exist) + path <- renv_bootstrap_paths_renv("profile", profile = FALSE, project = project) + if (!file.exists(path)) + return(NULL) + + # read the profile, and set it if it exists + contents <- readLines(path, warn = FALSE) + if (length(contents) == 0L) + return(NULL) + + # set RENV_PROFILE + profile <- contents[[1L]] + if (!profile %in% c("", "default")) + Sys.setenv(RENV_PROFILE = profile) + + profile + + } + + renv_bootstrap_profile_prefix <- function() { + profile <- renv_bootstrap_profile_get() + if (!is.null(profile)) + return(file.path("profiles", profile, "renv")) + } + + renv_bootstrap_profile_get <- function() { + profile <- Sys.getenv("RENV_PROFILE", unset = "") + renv_bootstrap_profile_normalize(profile) + } + + renv_bootstrap_profile_set <- function(profile) { + profile <- renv_bootstrap_profile_normalize(profile) + if (is.null(profile)) + Sys.unsetenv("RENV_PROFILE") + else + Sys.setenv(RENV_PROFILE = profile) + } + + renv_bootstrap_profile_normalize <- function(profile) { + + if (is.null(profile) || profile %in% c("", "default")) + return(NULL) + + profile + + } + + renv_bootstrap_path_absolute <- function(path) { + + substr(path, 1L, 1L) %in% c("~", "/", "\\") || ( + substr(path, 1L, 1L) %in% c(letters, LETTERS) && + substr(path, 2L, 3L) %in% c(":/", ":\\") + ) + + } + + renv_bootstrap_paths_renv <- function(..., profile = TRUE, project = NULL) { + renv <- Sys.getenv("RENV_PATHS_RENV", unset = "renv") + root <- if (renv_bootstrap_path_absolute(renv)) NULL else project + prefix <- if (profile) renv_bootstrap_profile_prefix() + components <- c(root, renv, prefix, ...) + paste(components, collapse = "/") + } + + renv_bootstrap_project_type <- function(path) { + + descpath <- file.path(path, "DESCRIPTION") + if (!file.exists(descpath)) + return("unknown") + + desc <- tryCatch( + read.dcf(descpath, all = TRUE), + error = identity + ) + + if (inherits(desc, "error")) + return("unknown") + + type <- desc$Type + if (!is.null(type)) + return(tolower(type)) + + package <- desc$Package + if (!is.null(package)) + return("package") + + "unknown" + + } + + renv_bootstrap_user_dir <- function() { + dir <- renv_bootstrap_user_dir_impl() + path.expand(chartr("\\", "/", dir)) + } + + renv_bootstrap_user_dir_impl <- function() { + + # use local override if set + override <- getOption("renv.userdir.override") + if (!is.null(override)) + return(override) + + # use R_user_dir if available + tools <- asNamespace("tools") + if (is.function(tools$R_user_dir)) + return(tools$R_user_dir("renv", "cache")) + + # try using our own backfill for older versions of R + envvars <- c("R_USER_CACHE_DIR", "XDG_CACHE_HOME") + for (envvar in envvars) { + root <- Sys.getenv(envvar, unset = NA) + if (!is.na(root)) + return(file.path(root, "R/renv")) + } + + # use platform-specific default fallbacks + if (Sys.info()[["sysname"]] == "Windows") + file.path(Sys.getenv("LOCALAPPDATA"), "R/cache/R/renv") + else if (Sys.info()[["sysname"]] == "Darwin") + "~/Library/Caches/org.R-project.R/R/renv" + else + "~/.cache/R/renv" + + } + + renv_bootstrap_version_friendly <- function(version, shafmt = NULL, sha = NULL) { + sha <- sha %||% attr(version, "sha", exact = TRUE) + parts <- c(version, sprintf(shafmt %||% " [sha: %s]", substring(sha, 1L, 7L))) + paste(parts, collapse = "") + } + + renv_bootstrap_exec <- function(project, libpath, version) { + if (!renv_bootstrap_load(project, libpath, version)) + renv_bootstrap_run(project, libpath, version) + } + + renv_bootstrap_run <- function(project, libpath, version) { + + # perform bootstrap + bootstrap(version, libpath) + + # exit early if we're just testing bootstrap + if (!is.na(Sys.getenv("RENV_BOOTSTRAP_INSTALL_ONLY", unset = NA))) + return(TRUE) + + # try again to load + if (requireNamespace("renv", lib.loc = libpath, quietly = TRUE)) { + return(renv::load(project = project)) + } + + # failed to download or load renv; warn the user + msg <- c( + "Failed to find an renv installation: the project will not be loaded.", + "Use `renv::activate()` to re-initialize the project." + ) + + warning(paste(msg, collapse = "\n"), call. = FALSE) + + } + + renv_json_read <- function(file = NULL, text = NULL) { + + jlerr <- NULL + + # if jsonlite is loaded, use that instead + if ("jsonlite" %in% loadedNamespaces()) { + + json <- tryCatch(renv_json_read_jsonlite(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + jlerr <- json + + } + + # otherwise, fall back to the default JSON reader + json <- tryCatch(renv_json_read_default(file, text), error = identity) + if (!inherits(json, "error")) + return(json) + + # report an error + if (!is.null(jlerr)) + stop(jlerr) + else + stop(json) + + } + + renv_json_read_jsonlite <- function(file = NULL, text = NULL) { + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + jsonlite::fromJSON(txt = text, simplifyVector = FALSE) + } + + renv_json_read_patterns <- function() { + + list( + + # objects + list("{", "\t\n\tobject(\t\n\t", TRUE), + list("}", "\t\n\t)\t\n\t", TRUE), + + # arrays + list("[", "\t\n\tarray(\t\n\t", TRUE), + list("]", "\n\t\n)\n\t\n", TRUE), + + # maps + list(":", "\t\n\t=\t\n\t", TRUE), + + # newlines + list("\\u000a", "\n", FALSE) + + ) + + } + + renv_json_read_envir <- function() { + + envir <- new.env(parent = emptyenv()) + + envir[["+"]] <- `+` + envir[["-"]] <- `-` + + envir[["object"]] <- function(...) { + result <- list(...) + names(result) <- as.character(names(result)) + result + } + + envir[["array"]] <- list + + envir[["true"]] <- TRUE + envir[["false"]] <- FALSE + envir[["null"]] <- NULL + + envir + + } + + renv_json_read_remap <- function(object, patterns) { + + # repair names if necessary + if (!is.null(names(object))) { + + nms <- names(object) + for (pattern in patterns) + nms <- gsub(pattern[[2L]], pattern[[1L]], nms, fixed = TRUE) + names(object) <- nms + + } + + # repair strings if necessary + if (is.character(object)) { + for (pattern in patterns) + object <- gsub(pattern[[2L]], pattern[[1L]], object, fixed = TRUE) + } + + # recurse for other objects + if (is.recursive(object)) + for (i in seq_along(object)) + object[i] <- list(renv_json_read_remap(object[[i]], patterns)) + + # return remapped object + object + + } + + renv_json_read_default <- function(file = NULL, text = NULL) { + + # read json text + text <- paste(text %||% readLines(file, warn = FALSE), collapse = "\n") + + # convert into something the R parser will understand + patterns <- renv_json_read_patterns() + transformed <- text + for (pattern in patterns) + transformed <- gsub(pattern[[1L]], pattern[[2L]], transformed, fixed = TRUE) + + # parse it + rfile <- tempfile("renv-json-", fileext = ".R") + on.exit(unlink(rfile), add = TRUE) + writeLines(transformed, con = rfile) + json <- parse(rfile, keep.source = FALSE, srcfile = NULL)[[1L]] + + # evaluate in safe environment + result <- eval(json, envir = renv_json_read_envir()) + + # fix up strings if necessary -- do so only with reversible patterns + patterns <- Filter(function(pattern) pattern[[3L]], patterns) + renv_json_read_remap(result, patterns) + + } + + + # load the renv profile, if any + renv_bootstrap_profile_load(project) + + # construct path to library root + root <- renv_bootstrap_library_root(project) + + # construct library prefix for platform + prefix <- renv_bootstrap_platform_prefix() + + # construct full libpath + libpath <- file.path(root, prefix) + + # run bootstrap code + renv_bootstrap_exec(project, libpath, version) + + invisible() + +}) diff --git a/renv/settings.json b/renv/settings.json new file mode 100644 index 0000000..ffdbb32 --- /dev/null +++ b/renv/settings.json @@ -0,0 +1,19 @@ +{ + "bioconductor.version": null, + "external.libraries": [], + "ignored.packages": [], + "package.dependency.fields": [ + "Imports", + "Depends", + "LinkingTo" + ], + "ppm.enabled": null, + "ppm.ignored.urls": [], + "r.version": null, + "snapshot.type": "implicit", + "use.cache": true, + "vcs.ignore.cellar": true, + "vcs.ignore.library": true, + "vcs.ignore.local": true, + "vcs.manage.ignores": true +} diff --git a/test-example.R b/test-example.R new file mode 100644 index 0000000..c917a9a --- /dev/null +++ b/test-example.R @@ -0,0 +1,97 @@ +# dat <- data.frame( +# x = c(15, 34, 59, 21, 33, 66), +# y = c("Admin A", "Admin B", "Admin C", "Admin C", "Admin B", "Admin A"), +# group = c("Displaced", "Non displaced", "Non displaced", "Displaced", "Displaced", "Non displaced") +# ) + + +library(visualizeR) + +# dat |> +# bar( +# x = "y", +# y = "x", +# #group = "group", +# group_title = "Displacement Status", +# flip = T, +# add_text = T, +# title = "In Admin A and C, Non-Displaced Persons Face Greater WASH Challenges Than Their Displaced Counterparts", +# subtitle = "% of households not accessing WASH services by admin 1 and displacement status", +# caption = "Source: FAO 2022. No message is a real one. Fake data are used in this example. As a cautiom, no decision should be made based on this plot.", +# ) + +# theme_bar(flip = T, add_text = T) + +# scale_color_visualizer_discrete() + +# scale_fill_visualizer_discrete() + + +library(rio) +dat <- import("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/11_SevCatOneNumNestedOneObsPerGroup.csv") + +dumbbell( + df, + "stat", + "setting", + "admin1", + title = "% of HHs that reported open defecation as sanitation facility", + group_y_title = "Admin 1", + group_x_title = "Setting" +) + +library(dplyr) +library(data.table) +# dat as a data.table if it4s not +if (!checkmate::test_data_table(dat)) { + rlang::warn("Converting dat to data.table.") + data.table::setDT(dat) +} + +# in all character columns, tranform empty string to NA +vars_chr <- colnames(dat)[sapply(dat, is.character)] +dat[, (vars_chr) := lapply(.SD, function(x) fifelse(x == "", NA_character_, x)), .SDcols = vars_chr] + +# in value, if -1 replace with NA +dat[, value := fifelse(value == -1, NA_real_, value)] + +# remove lines where value is NA (in place) +dat <- dat[!is.na(value), ] + +dat + # arrange(value) |> + # group_by(region) |> + # mutate(key = forcats::fct_reorder(key, value)) |> + + + +dumbbell( + dat |> arrange(value) |> tail(50) |> mutate( + value = value/1000000, + key = ifelse(key == "Democratic Republic of the Congo", "DRC", key)) |> + filter(region %in% c("Europe", "Americas")), + "value", + "region", + "key", + title = "% of HHs that reported open defecation as sanitation facility", + group_y_title = "Admin 1", + group_x_title = "Setting", point_size = 3, line_to_y_axis = T + +) + + +bar( + df = dat |> arrange(value) |> tail(20) |> mutate( + value = value/1000000, + key = ifelse(key == "Democratic Republic of the Congo", "DRC", key)), + x = "key", + y = "value", + group = "region", + group_title = "Region", + order = "grouped", + x_rm_na = T, + y_rm_na = T, + group_rm_na = T, + flip = F, + title = "Population of Global Regions in Million", +) + +theme_bar(flip = F, axis_text_x_angle = 45) + +scale_color_visualizer_discrete() + +scale_fill_visualizer_discrete() diff --git a/test.R b/test.R new file mode 100644 index 0000000..aa7a869 --- /dev/null +++ b/test.R @@ -0,0 +1,22 @@ +library(visualizeR) +library(ggplot2) + +# Example usagea +# Sample data +data <- data.frame( + category = c("A", "B", "C", "D"), + value = c(3, 7, 9, 5) +) + +library(visualizeR) +library(ggplot2) +# Regular bar plot +p1 <- + bar( + df = data, + x = "category", + y = "value", + flip = F + ) + + theme_bar(flip = F) +p1 diff --git a/tests/testthat.R b/tests/testthat.R new file mode 100644 index 0000000..fc6a44f --- /dev/null +++ b/tests/testthat.R @@ -0,0 +1,12 @@ +# # This file is part of the standard setup for testthat. +# # It is recommended that you do not modify it. +# # +# # Where should you do additional test configuration? +# # Learn more about the roles of various files in: +# # * https://r-pkgs.org/testing-design.html#sec-tests-files-overview +# # * https://testthat.r-lib.org/articles/special-files.html + +# library(testthat) +# library(visualizeR) + +# test_check("visualizeR") diff --git a/tests/testthat/test-color.R b/tests/testthat/test-color.R new file mode 100644 index 0000000..ee09eea --- /dev/null +++ b/tests/testthat/test-color.R @@ -0,0 +1,86 @@ +# Tests for color functions + +test_that("color returns expected hex codes", { + # Test default behavior (returning all colors when no args provided) + all_colors <- color(unname = FALSE) + expect_type(all_colors, "character") + expect_true(length(all_colors) > 0) + expect_named(all_colors) + + # Test requesting specific colors + expect_identical(color("white"), "#FFFFFF") + expect_identical(color("black"), "#000000") + + # Test requesting multiple colors + expect_identical( + color("white", "black"), + c("#FFFFFF", "#000000") + ) + + # Test requesting multiple colors with names preserved + named_colors <- color("white", "black", unname = FALSE) + expect_identical( + named_colors, + c(white = "#FFFFFF", black = "#000000") + ) + + # Test requesting non-existent color + expect_error( + color("nonexistent_color"), + "Some colors not defined" + ) +}) + +test_that("color_pattern works as expected", { + # Positive test cases + cat_colors <- color_pattern("cat_", unname = FALSE) + expect_true(length(cat_colors) > 0) + expect_true(all(startsWith(names(cat_colors), "cat_"))) + + seq_colors <- color_pattern("seq_") + expect_true(length(seq_colors) > 0) + + # Test with a pattern that should match nothing + expect_warning( + color_pattern("xyz_nonexistent_"), + "No colors match the pattern" + ) + + # Test argument validation + expect_error(color_pattern(123)) + expect_error(color_pattern(c("cat_", "seq_"))) + expect_error( + color_pattern("cat_", unname = "yes"), + "Assertion on 'unname' failed" + ) +}) + +test_that("color function parameter validation", { + # Empty call should return all colors + all_colors <- color() + expect_type(all_colors, "character") + expect_true(length(all_colors) > 0) + + # unname parameter behavior + named_all <- color(unname = FALSE) + expect_named(named_all) + unnamed_all <- color(unname = TRUE) + expect_null(names(unnamed_all)) + + # Test validation of ... arguments to ensure they're strings + expect_error(color(123), "Assertion on 'Argument #1' failed") + expect_error(color(TRUE), "Assertion on 'Argument #1' failed") + expect_error( + color(list("white")), + "Assertion on 'Argument #1' failed" + ) + + # Test that vectors are not allowed + expect_error( + color(c("white", "black")), + "Assertion on 'Argument #1' failed: Must have length 1." + ) + + # Multiple arguments should still work as long as each is a single string + expect_length(color("white", "black"), 2) +}) diff --git a/tests/testthat/test-lollipop.R b/tests/testthat/test-lollipop.R new file mode 100644 index 0000000..70fd05f --- /dev/null +++ b/tests/testthat/test-lollipop.R @@ -0,0 +1,245 @@ +test_that("lollipop generates correct base plot structure", { + test_data <- data.frame( + category = c("A", "B", "C", "D", "E"), + value = c(25, 40, 15, 35, 30), + stringsAsFactors = FALSE + ) + + p <- lollipop(df = test_data, x = "category", y = "value") + + # Check that the plot is a ggplot object + expect_s3_class(p, "ggplot") + + # Check that the plot contains the essential layers + expect_true(any(sapply(p$layers, function(x) inherits(x$geom, "GeomPoint")))) + expect_true(any(sapply(p$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))) + + # Check that the data is correctly mapped + expect_equal(rlang::as_name(p$mapping$x), "category") + expect_equal(rlang::as_name(p$mapping$y), "value") +}) + +test_that("horizontal lollipop (hlollipop) flips coordinates", { + test_data <- data.frame( + category = c("A", "B", "C", "D", "E"), + value = c(25, 40, 15, 35, 30), + stringsAsFactors = FALSE + ) + + p <- hlollipop(df = test_data, x = "category", y = "value") + + # Check that coordinates are flipped + expect_true(any(sapply(p$layers, function(x) inherits(x$geom, "GeomPoint")))) + expect_true(any(sapply(p$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))) + expect_true(inherits(p$coordinates, "CoordFlip")) +}) + +test_that("grouped lollipop uses side-by-side positioning", { + test_data <- data.frame( + category = c("A", "B", "C", "A", "B", "C"), + value = c(25, 40, 15, 35, 30, 45), + group = c("Group 1", "Group 1", "Group 1", "Group 2", "Group 2", "Group 2"), + stringsAsFactors = FALSE + ) + + p <- lollipop(df = test_data, x = "category", y = "value", group = "group") + + # Check that group aesthetic is set for fill + expect_equal(rlang::as_name(p$mapping$fill), "group") + + # Check for group-related mappings + expect_true(length(grep("group", as.character(p$mapping))) > 0) + + # Check that position dodge is used for points and lineranges + linerange_layer <- which(sapply(p$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))[1] + point_layer <- which(sapply(p$layers, function(x) { + inherits(x$geom, "GeomPoint") + }))[1] + + expect_true(inherits(p$layers[[point_layer]]$position, "PositionDodge")) + expect_true(inherits(p$layers[[linerange_layer]]$position, "PositionDodge")) +}) + +test_that("dodge_width parameter controls group spacing", { + test_data <- data.frame( + category = c("A", "B", "A", "B"), + value = c(25, 40, 35, 30), + group = c("Group 1", "Group 1", "Group 2", "Group 2"), + stringsAsFactors = FALSE + ) + + # Create plots with different dodge widths + p1 <- lollipop( + df = test_data, + x = "category", + y = "value", + group = "group", + dodge_width = 0.5 + ) + p2 <- lollipop( + df = test_data, + x = "category", + y = "value", + group = "group", + dodge_width = 1.0 + ) + + # Extract position dodge objects + linerange_layer1 <- which(sapply(p1$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))[1] + linerange_layer2 <- which(sapply(p2$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))[1] + + dodge1 <- p1$layers[[linerange_layer1]]$position + dodge2 <- p2$layers[[linerange_layer2]]$position + + # Check that dodge width is correctly set + expect_equal(dodge1$width, 0.5) + expect_equal(dodge2$width, 1.0) +}) + +test_that("lollipop handles missing values correctly", { + test_data <- data.frame( + category = c("A", "B", "C", "D", NA), + value = c(25, 40, NA, 35, 30), + group = c("Group 1", NA, "Group 1", "Group 2", "Group 1"), + stringsAsFactors = FALSE + ) + + # With default NA removal + p <- lollipop( + df = test_data, + x = "category", + y = "value", + group = "group" + ) + + # Should only have 2 rows of data (A and D) + expect_equal(nrow(p$data), 2) + + # With specific NA handling + p2 <- lollipop( + df = test_data, + x = "category", + y = "value", + group = "group", + x_rm_na = FALSE, + y_rm_na = FALSE, + group_rm_na = FALSE + ) + + # Should have more rows since we're not removing NAs + expect_true(nrow(p2$data) > 2) +}) + +test_that("lollipop applies ordering correctly", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + stringsAsFactors = FALSE + ) + + # With y ordering + p1 <- lollipop( + df = test_data, + x = "category", + y = "value", + order = "y" + ) + + # With no ordering + p2 <- lollipop( + df = test_data, + x = "category", + y = "value", + order = "none" + ) + + # We don't test the specific order since it depends on the implementation + # of reorder_by, which is tested separately. Instead, just check that + # the ordered and unordered versions are different. + + # Convert factor to character for comparison + plot_categories_y <- as.character(p1$data$category) + plot_categories_none <- as.character(p2$data$category) + + # The ordered version should be different than the unordered version + expect_false(identical(plot_categories_y, plot_categories_none)) +}) + +test_that("lollipop handles facets correctly", { + test_data <- data.frame( + category = rep(c("A", "B", "C"), 2), + value = c(25, 40, 15, 35, 30, 45), + facet_var = rep(c("Facet 1", "Facet 2"), each = 3), + stringsAsFactors = FALSE + ) + + p <- lollipop( + df = test_data, + x = "category", + y = "value", + facet = "facet_var" + ) + + # Check that facet is applied + expect_true(!is.null(p$facet)) +}) + +test_that("lollipop respects custom appearance settings", { + test_data <- data.frame( + category = c("A", "B", "C"), + value = c(25, 40, 15), + stringsAsFactors = FALSE + ) + + custom_color <- "#FF5733" + custom_line_color <- "#33FF57" + custom_dot_size <- 5 + custom_line_size <- 1.5 + custom_alpha <- 0.7 + + p <- lollipop( + df = test_data, + x = "category", + y = "value", + add_color = custom_color, + line_color = custom_line_color, + dot_size = custom_dot_size, + line_size = custom_line_size, + alpha = custom_alpha + ) + + # Find the point and linerange layers + point_layer <- which(sapply(p$layers, function(x) { + inherits(x$geom, "GeomPoint") + }))[1] + linerange_layer <- which(sapply(p$layers, function(x) { + inherits(x$geom, "GeomLinerange") + }))[1] + + # Check that point and linerange layers exist + expect_true(point_layer > 0) + expect_true(linerange_layer > 0) + + # Check that size parameters match + expect_equal(p$layers[[point_layer]]$aes_params$size, custom_dot_size) + expect_equal(p$layers[[point_layer]]$aes_params$alpha, custom_alpha) + + # Check that proper colors are applied somewhere in the plot + # We don't test for exact color values since the implementation might vary + # Just check that the plot was created successfully + expect_s3_class(p, "ggplot") + + # Verify that some aes_params exist in the layers + all_aes_params <- lapply(p$layers, function(l) names(l$aes_params)) + expect_true(length(unlist(all_aes_params)) > 0) +}) diff --git a/tests/testthat/test-palette.R b/tests/testthat/test-palette.R new file mode 100644 index 0000000..6bd4051 --- /dev/null +++ b/tests/testthat/test-palette.R @@ -0,0 +1,71 @@ +# Tests for palette functions + +test_that("palette returns expected color vectors", { + # Test default palette + default_pal <- palette() + expect_type(default_pal, "character") + expect_length(default_pal, 5) # cat_5_main has 5 colors + + # Test specific palette + cat_3_pal <- palette("cat_3_aquamarine") + expect_type(cat_3_pal, "character") + expect_length(cat_3_pal, 3) + + # Test reversed palette + reversed_pal <- palette("cat_5_main", reverse = TRUE) + expect_equal(reversed_pal, rev(palette("cat_5_main"))) + + # Test custom palettes + custom_pal <- palette("cat_3_custom_1") + expect_equal(custom_pal, c("#003F5C", "#58508D", "#FFA600")) +}) + +test_that("show_palettes option works", { + # Test show_palettes parameter + pal_names <- palette(show_palettes = TRUE) + expect_type(pal_names, "character") + expect_true(length(pal_names) > 0) + expect_true("cat_5_main" %in% pal_names) + expect_true("cat_3_custom_1" %in% pal_names) +}) + +test_that("palette handles errors correctly", { + # Test non-existent palette + expect_error( + palette("not_a_real_palette"), + "Palette not defined" + ) + + # Test parameter validation + expect_error(palette(palette = 123)) + expect_error(palette(palette = c("cat_5_main", "cat_3_custom_1"))) + expect_error(palette(reverse = "yes")) + expect_error(palette(show_palettes = "TRUE")) +}) + +test_that("all palette entries are valid colors", { + # Get all palette names + pal_names <- palette(show_palettes = TRUE) + + # Check each palette contains valid colors + for (pal_name in pal_names) { + pal_colors <- palette(pal_name) + + # Check that each color can be processed by grDevices + for (color in pal_colors) { + expect_true( + # Check if the color is valid by converting it to RGB + !is.na(grDevices::col2rgb(color)[1, 1]), + info = paste("Invalid color in palette", pal_name, ":", color) + ) + } + } +}) + +test_that("palettes have expected lengths", { + # Check specific palette lengths + expect_length(palette("cat_2_yellow"), 2) + expect_length(palette("cat_3_aquamarine"), 3) + expect_length(palette("cat_5_main"), 5) + expect_length(palette("cat_8_tol_adapted"), 8) +}) diff --git a/tests/testthat/test-palette_gen.R b/tests/testthat/test-palette_gen.R new file mode 100644 index 0000000..e56b152 --- /dev/null +++ b/tests/testthat/test-palette_gen.R @@ -0,0 +1,236 @@ +# Tests for palette_gen functions + +test_that("palette_gen validates parameters correctly", { + # Check that invalid type throws error + expect_error( + palette_gen("cat_5_main", "invalid_type"), + "Assertion on 'type' failed" + ) + + # Check that invalid palette throws error + expect_error( + palette_gen(123, "categorical"), + "Assertion on 'palette' failed" + ) + expect_error( + palette_gen(c("cat_5_main", "cat_3_custom_1"), "categorical"), + "Assertion on 'palette' failed" + ) + + # Check that invalid direction throws error + expect_error( + palette_gen("cat_5_main", "categorical", direction = 0), + "Assertion on 'abs\\(direction\\) == 1' failed" + ) + expect_error( + palette_gen("cat_5_main", "categorical", direction = 2), + "Assertion on 'direction' failed" + ) + + # Check valid types don't error + expect_type(palette_gen("cat_5_main", "categorical"), "closure") + expect_type(palette_gen("cat_5_main", "sequential"), "closure") + expect_type(palette_gen("div_5_orange_blue", "divergent"), "closure") +}) + +test_that("palette_gen returns appropriate function types", { + # Categorical palette should return a function + cat_fn <- palette_gen("cat_5_main", "categorical") + expect_true(is.function(cat_fn)) + + # Sequential palette should return a function + seq_fn <- palette_gen("cat_5_main", "sequential") + expect_true(is.function(seq_fn)) + + # Divergent palette should return a function + div_fn <- palette_gen("div_5_orange_blue", "divergent") + expect_true(is.function(div_fn)) +}) + +test_that("palette_gen forwards arguments to appropriate function", { + # Skip the test if mockery is not available + skip_if_not_installed("mockery") + skip_if_not(exists("with_mocked_bindings")) + + # Create a mock for palette_gen_categorical + mockery::with_mocked_bindings( + palette_gen_categorical = function(palette, direction) { + return(list( + palette = palette, + direction = direction, + type = "categorical" + )) + }, + palette_gen_sequential = function(palette, direction, ...) { + return(list( + palette = palette, + direction = direction, + type = "sequential" + )) + }, + code = { + # Test categorical forwarding + result <- palette_gen("cat_palette", "categorical", direction = -1) + expect_equal(result$palette, "cat_palette") + expect_equal(result$direction, -1) + expect_equal(result$type, "categorical") + + # Test sequential forwarding + result <- palette_gen("seq_palette", "sequential", direction = -1) + expect_equal(result$palette, "seq_palette") + expect_equal(result$direction, -1) + expect_equal(result$type, "sequential") + } + ) +}) + +test_that("palette_gen_categorical validates parameters", { + # Test palette parameter validation + expect_error( + palette_gen_categorical(palette = 123), + "Assertion on 'palette' failed" + ) + expect_error( + palette_gen_categorical(palette = c("cat_5_main", "cat_3_custom_1")), + "Assertion on 'palette' failed" + ) + + # Test direction parameter validation + expect_error( + palette_gen_categorical(direction = 0), + "Assertion on 'abs\\(direction\\) == 1' failed" + ) + expect_error( + palette_gen_categorical(direction = 2), + "Assertion on 'direction' failed" + ) + expect_error( + palette_gen_categorical(direction = -2), + "Assertion on 'direction' failed" + ) + expect_error( + palette_gen_categorical(direction = "1"), + "Assertion on 'direction' failed" + ) +}) + +test_that("palette_gen_categorical returns a function", { + fn <- palette_gen_categorical() + expect_true(is.function(fn)) +}) + +test_that("palette_gen_categorical function generates correct colors", { + # Get the palette function + fn <- palette_gen_categorical("cat_5_main") + + # Get the actual colors from the palette + pal_colors <- palette("cat_5_main") + + # Test default behavior (return all colors) + expect_equal(fn(NULL), pal_colors) + + # Test specific number of colors + expect_equal(fn(3), pal_colors[1:3]) + + # Test direction reversal + rev_fn <- palette_gen_categorical("cat_5_main", direction = -1) + expect_equal(rev_fn(NULL), rev(pal_colors)) +}) + +test_that("palette_gen_categorical warns when requesting too many colors", { + fn <- palette_gen_categorical("cat_3_aquamarine") + expect_warning(fn(10), "Not enough colors in this palette!") +}) + +test_that("palette_gen_sequential validates parameters", { + # Test palette parameter validation + expect_error( + palette_gen_sequential(palette = 123), + "Assertion on 'palette' failed" + ) + expect_error( + palette_gen_sequential(palette = c("cat_5_main", "cat_3_custom_1")), + "Assertion on 'palette' failed" + ) + + # Test direction parameter validation + expect_error( + palette_gen_sequential(direction = 0), + "Assertion on 'abs\\(direction\\) == 1' failed" + ) + expect_error( + palette_gen_sequential(direction = 2), + "Assertion on 'direction' failed" + ) + expect_error( + palette_gen_sequential(direction = -2), + "Assertion on 'direction' failed" + ) + expect_error( + palette_gen_sequential(direction = "1"), + "Assertion on 'direction' failed" + ) +}) + +test_that("palette_gen_sequential returns a colorRampPalette function", { + # Test with default parameters + fn_default <- palette_gen_sequential() + expect_true(is.function(fn_default)) + + # Test with specific palette + fn <- palette_gen_sequential("cat_5_main") + expect_true(is.function(fn)) + + # colorRampPalette functions take an integer and return a character vector + colors <- fn(10) + expect_type(colors, "character") + expect_length(colors, 10) + + # Each color should be a valid hex code + hex_pattern <- "^#[0-9A-Fa-f]{6}$" + for (color in colors) { + expect_match(color, hex_pattern) + } +}) + +test_that("palette_gen_sequential handles direction parameter correctly", { + # Create functions with opposite directions + fn1 <- palette_gen_sequential("cat_5_main", direction = 1) + fn2 <- palette_gen_sequential("cat_5_main", direction = -1) + + # Generate colors + colors1 <- fn1(5) + colors2 <- fn2(5) + + # Colors should be different when direction is different + expect_false(identical(colors1, colors2)) +}) + +test_that("palette_gen functions work with all available palettes", { + # Get all palette names + pal_names <- palette(show_palettes = TRUE) + + for (pal_name in pal_names) { + # Test categorical - check only that it returns a function + cat_fn <- tryCatch( + palette_gen_categorical(pal_name), + error = function(e) NULL + ) + if (!is.null(cat_fn)) { + expect_true(is.function(cat_fn)) + # Use min(3, length of palette colors) to avoid warning + n_colors <- min(3, length(palette(pal_name))) + expect_type(cat_fn(n_colors), "character") + } + + # Test sequential - check only that it returns a function + seq_fn <- tryCatch( + palette_gen_sequential(pal_name), + error = function(e) NULL + ) + if (!is.null(seq_fn)) { + expect_true(is.function(seq_fn)) + expect_type(seq_fn(3), "character") + } + } +}) diff --git a/tests/testthat/test-reorder_by.R b/tests/testthat/test-reorder_by.R new file mode 100644 index 0000000..34db021 --- /dev/null +++ b/tests/testthat/test-reorder_by.R @@ -0,0 +1,160 @@ +test_that("reorder_by works with character columns", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + group = c("Group 1", "Group 2", "Group 1", "Group 2", "Group 1"), + stringsAsFactors = FALSE + ) + + # Test order by values (y) + result <- reorder_by(test_data, "category", "value", order = "y") + expected_order <- c("D", "B", "E", "C", "A") + expect_equal(as.character(result$category), expected_order) + + # Test reversed order + result_rev <- reorder_by( + test_data, + "category", + "value", + order = "y", + dir_order = -1 + ) + expect_equal(as.character(result_rev$category), rev(expected_order)) + + # Test alphabetical order + result_alpha <- reorder_by(test_data, "category", "value", order = "x") + expect_equal(as.character(result_alpha$category), c("A", "B", "C", "D", "E")) +}) + +test_that("reorder_by works with factor columns", { + test_data <- data.frame( + category = factor(c("B", "A", "D", "C", "E")), + value = c(25, 40, 15, 35, 30), + group = factor(c("Group 1", "Group 2", "Group 1", "Group 2", "Group 1")) + ) + + # Test order by values (y) + result <- reorder_by(test_data, "category", "value", order = "y") + expect_true(is.factor(result$category)) + expect_equal(as.character(result$category), c("D", "B", "E", "C", "A")) + + # Test factor levels + expect_equal(levels(result$category), c("D", "B", "E", "C", "A")) +}) + +test_that("reorder_by handles grouped ordering correctly", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + group = c("Group 1", "Group 2", "Group 1", "Group 2", "Group 1"), + stringsAsFactors = FALSE + ) + + # Test grouped_y ordering + result <- reorder_by( + test_data, + "category", + "value", + group = "group", + order = "grouped_y" + ) + + # Group 1 items should be ordered by value within Group 1 + group1_items <- result[result$group == "Group 1", "category"] + group1_values <- result[result$group == "Group 1", "value"] + expect_true(all(group1_values == sort(group1_values))) + + # Group 2 items should be ordered by value within Group 2 + group2_items <- result[result$group == "Group 2", "category"] + group2_values <- result[result$group == "Group 2", "value"] + expect_true(all(group2_values == sort(group2_values))) + + # Test grouped_x ordering + result_x <- reorder_by( + test_data, + "category", + "value", + group = "group", + order = "grouped_x" + ) + + # Groups should remain intact, and items should be ordered alphabetically within groups + group1_items_x <- as.character(result_x[ + result_x$group == "Group 1", + "category" + ]) + expect_equal(group1_items_x, sort(group1_items_x)) +}) + +test_that("reorder_by handles fallback cases", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + stringsAsFactors = FALSE + ) + + # Test empty group with grouped_y + expect_warning( + result <- reorder_by( + test_data, + "category", + "value", + group = "", + order = "grouped_y" + ), + "Group is empty" + ) + # Should fall back to ordering by y + expect_equal(as.character(result$category), c("D", "B", "E", "C", "A")) + + # Test empty group with grouped_x + expect_warning( + result_x <- reorder_by( + test_data, + "category", + "value", + group = "", + order = "grouped_x" + ), + "Group is empty" + ) + # Should fall back to alphabetical ordering + expect_equal(as.character(result_x$category), c("A", "B", "C", "D", "E")) +}) + +test_that("reorder_by preserves row data correctly", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + extra = c("x1", "x2", "x3", "x4", "x5"), + stringsAsFactors = FALSE + ) + + # Test that reordering preserves all columns and their associations + result <- reorder_by(test_data, "category", "value", order = "y") + + # Values should correspond to the correct categories + expect_equal(result$value[result$category == "A"], 40) + expect_equal(result$value[result$category == "B"], 25) + expect_equal(result$value[result$category == "C"], 35) + expect_equal(result$value[result$category == "D"], 15) + expect_equal(result$value[result$category == "E"], 30) + + # Extra column should maintain its associations + expect_equal(result$extra[result$category == "A"], "x2") + expect_equal(result$extra[result$category == "B"], "x1") +}) + +test_that("reorder_by handles no reordering case", { + test_data <- data.frame( + category = c("B", "A", "D", "C", "E"), + value = c(25, 40, 15, 35, 30), + stringsAsFactors = FALSE + ) + + # Test no reordering + result <- reorder_by(test_data, "category", "value", order = "none") + + # Order should be preserved from the original data + expect_equal(as.character(result$category), c("B", "A", "D", "C", "E")) +}) diff --git a/vignettes/.gitignore b/vignettes/.gitignore new file mode 100644 index 0000000..9e2bd63 --- /dev/null +++ b/vignettes/.gitignore @@ -0,0 +1,4 @@ +*.html +*.R + +/.quarto/ diff --git a/vignettes/bar_charts.Rmd b/vignettes/bar_charts.Rmd new file mode 100644 index 0000000..a9e558a --- /dev/null +++ b/vignettes/bar_charts.Rmd @@ -0,0 +1,57 @@ +--- +title: "Bar charts" +output: rmarkdown::html_vignette +vignette: > + %\VignetteIndexEntry{Bar charts} + %\VignetteEngine{knitr::rmarkdown} + %\VignetteEncoding{UTF-8} +--- + +```{r, include = FALSE} +knitr::opts_chunk$set( + collapse = TRUE, + comment = "#>" +) +``` +Let's start by importing some data and running some data wrangling: +```{r data-import} +library(rio) +library(data.table) +dat <- import("https://raw.githubusercontent.com/holtzy/data_to_viz/master/Example_dataset/11_SevCatOneNumNestedOneObsPerGroup.csv", data.table = TRUE) +setDT(dat) + +# in all character columns, tranform empty string to NA +vars_chr <- colnames(dat)[sapply(dat, is.character)] +dat[, (vars_chr) := lapply(.SD, function(x) fifelse(x == "", NA_character_, x)), .SDcols = vars_chr] + +# in value, if -1 replace with NA +dat[, value := fifelse(value == -1, NA_real_, value)] + +# remove lines where value is NA (in place) +dat <- dat[!is.na(value), ] + +# kepp only top 20 values and divide data to get million units +df <- dat[ + !is.na(value), ][ + order(value, decreasing = TRUE), ][ + 1:20, ][ + , value := value/1000000, ][ + , key := ifelse(key == "Democratic Republic of the Congo", "DRC", key)] +``` + +Now, let's see the defaults for a horizontal bar diagram without any grouping and ordering values from highest to smallest: + +```{r hbar} +library(visualizeR) + +hbar( + df, + x = "key", + y = "value", + facet = "region", + order = "y", + title = "Top 20 countries by population (in Million)" +) +``` + +Moving on to a vertical bar chart, with country facets and groups diff --git a/visualizeR.Rproj b/visualizeR.Rproj index 497f8bf..ffb476d 100644 --- a/visualizeR.Rproj +++ b/visualizeR.Rproj @@ -1,4 +1,5 @@ Version: 1.0 +ProjectId: e1665596-bf01-400a-b4a1-2f46436c0b23 RestoreWorkspace: Default SaveWorkspace: Default