Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jbengler committed Mar 8, 2024
1 parent d737236 commit 1b850f3
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 59 deletions.
45 changes: 23 additions & 22 deletions R/add.R
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#' General arguments
#' Common arguments
#'
#' @param plot A tidyplot generated with the `tidyplot()` function.
#' @param data A function to subset the data to be plotted. See `filter_rows()` and friends.
#' @param dodge_width For adjusting the distance between grouped objects.
#' @param preserve general
#' @param rasterize general
#' @param rasterize_dpi general
#' @name general_arguments
#' @keywords internal
#' @name common_arguments
NULL


Expand All @@ -23,7 +24,7 @@ NULL
#' vertical position of the of the data points. This can be useful to deal
#' with overplotting.
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @inheritParams ggbeeswarm::geom_beeswarm
#'
#' @examples
Expand Down Expand Up @@ -151,7 +152,7 @@ ff_errorbar <- function(.fun.data) {
#' @param width bla
#' @param linewidth bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_error <- ff_errorbar(.fun.data = ggplot2::mean_se)
#' @rdname add_error
Expand Down Expand Up @@ -187,7 +188,7 @@ ff_ribbon <- function(.fun.data) {
#' @param alpha bla
#' @param color bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_error_ribbon <- ff_ribbon(.fun.data = ggplot2::mean_se)
#' @rdname add_error_ribbon
Expand Down Expand Up @@ -306,7 +307,7 @@ ff_line <- function(.fun, .count = FALSE, .geom) {
#' @param scale_cut bla
#' @param group bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_mean_bar <- ff_bar(.fun = mean)
#' @rdname add_mean_bar
Expand All @@ -327,7 +328,7 @@ add_mean_area <- ff_line(.fun = mean, .geom = "area")

#' Add median
#'
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @inheritParams add_mean_bar
#' @export
add_median_bar <- ff_bar(.fun = median)
Expand All @@ -350,7 +351,7 @@ add_median_area <- ff_line(.fun = median, .geom = "area")

#' Add sum
#'
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @inheritParams add_mean_bar
#' @export
add_sum_bar <- ff_bar(.fun = sum)
Expand All @@ -373,7 +374,7 @@ add_sum_area <- ff_line(.fun = sum, .geom = "area")

#' Add count
#'
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @inheritParams add_mean_bar
#'
#' @export
Expand Down Expand Up @@ -407,7 +408,7 @@ add_count_area <- ff_line(.count = TRUE, .geom = "area")
#' @param outlier.shape bla
#' @param linewidth bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#'
#' @export
add_boxplot <- function(plot, dodge_width = NULL, saturation = 0.3, show_whiskers = TRUE, show_outliers = FALSE,
Expand Down Expand Up @@ -440,7 +441,7 @@ add_boxplot <- function(plot, dodge_width = NULL, saturation = 0.3, show_whisker
#' @param linewidth bla
#' @param scale bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#'
#' @export
add_violin <- function(plot, dodge_width = NULL, saturation = 0.3, draw_quantiles = NULL, trim = FALSE,
Expand All @@ -457,7 +458,7 @@ add_violin <- function(plot, dodge_width = NULL, saturation = 0.3, draw_quantile
#' @param group bla
#' @param linewidth bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_line <- function(plot, group, dodge_width = NULL, linewidth = 0.25, preserve = "total", ...) {
check_tidyplot(plot)
Expand Down Expand Up @@ -498,7 +499,7 @@ add_area <- function(plot, group, dodge_width = NULL, linewidth = 0.25, preserve
#' @param linewidth bla
#' @param alpha bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_curve <- function(plot, dodge_width = NULL, method = "loess", linewidth = 0.25, alpha = 0.3,
preserve = "total", ...) {
Expand Down Expand Up @@ -544,7 +545,7 @@ ff_pie <- function(.type = "pie") {
#' @param width bla
#' @param reverse bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_pie <- ff_pie(.type = "pie")
#' @rdname add_pie
Expand Down Expand Up @@ -577,7 +578,7 @@ ff_barstack <- function(.position_fun) {
#' @param width bla
#' @param reverse bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_barstack_absolute <- ff_barstack(.position_fun = ggplot2::position_stack)
#' @rdname add_barstack_absolute
Expand Down Expand Up @@ -633,7 +634,7 @@ ff_areastack <- function(.position_fun) {
#' @param alpha bla
#' @param reverse bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_areastack_absolute <- ff_areastack(.position_fun = ggplot2::position_stack)
#' @rdname add_areastack_absolute
Expand All @@ -646,7 +647,7 @@ add_areastack_relative <- ff_areastack(.position_fun = ggplot2::position_fill)
#' @param bins bla
#' @param color bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_histogram <- function(plot, binwidth = NULL, bins = NULL, color = "#4DACD6", ...) {
check_tidyplot(plot)
Expand All @@ -673,7 +674,7 @@ add_density_histogram <- function(plot, binwidth = NULL, bins = NULL, color = "#
#' @param fill bla
#' @param alpha bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_density_curve <- function(plot, bw = "nrd0", adjust = 1, kernel = "gaussian", n = 512, color = "#E37D46", fill = "#E37D46", alpha = 0.3, ...) {
check_tidyplot(plot)
Expand All @@ -687,7 +688,7 @@ add_density_curve <- function(plot, bw = "nrd0", adjust = 1, kernel = "gaussian"
#' @param scale bla
#' @param rotate_labels bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_heatmap <- function(plot, scale = c("none", "row", "column"), rotate_labels = 90,
rasterize = FALSE, rasterize_dpi = 300, ...) {
Expand Down Expand Up @@ -727,7 +728,7 @@ add_heatmap <- function(plot, scale = c("none", "row", "column"), rotate_labels
#' Add plot title or caption
#' @param title bla
#' @param caption bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_title <- function(plot, title = ggplot2::waiver()) {
check_tidyplot(plot)
Expand All @@ -751,7 +752,7 @@ add_caption <- function(plot, caption = ggplot2::waiver()) {
#' @param linetype bla
#' @param linewidth bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_reference_lines <- function(plot, x = NULL, y = NULL, linetype = "dashed", linewidth = 0.25, ...) {
check_tidyplot(plot)
Expand All @@ -772,7 +773,7 @@ add_reference_lines <- function(plot, x = NULL, y = NULL, linetype = "dashed", l
#' @param segment.size bla
#' @param box.padding bla
#' @param ... bla
#' @inheritParams general_arguments
#' @inheritParams common_arguments
#' @export
add_text_labels <- function(plot, var, data = all_rows(), fontsize = 7,
segment.size = 0.2, box.padding = 0.2, ...) {
Expand Down
44 changes: 11 additions & 33 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,59 +20,43 @@ reference:
- tidyplot
- title: Add
desc: Add plot components to represent data points, central tendency measures, dispersion and more.
- subtitle:
desc: >
**Data points & amounts**
- subtitle: Data points & amounts
- contents:
- starts_with("add_data_points")
- starts_with("add_line")
- starts_with("add_heatmap")
- starts_with("add_count")
- starts_with("add_sum")
- subtitle:
desc: >
**Central tendency**
- subtitle: Central tendency
- contents:
- starts_with("add_mean")
- starts_with("add_median")
- starts_with("add_curve")
- subtitle:
desc: >
**Dispersion & uncertainty**
- subtitle: Dispersion & uncertainty
- contents:
- starts_with("add_boxplot")
- starts_with("add_violin")
- starts_with("add_error")
- subtitle:
desc: >
**Statistical comparison**
- subtitle: Statistical comparison
- contents:
- starts_with("add_stats")
- subtitle:
desc: >
**Distribution**
- subtitle: Distribution
- contents:
- starts_with("add_histogram")
- starts_with("add_density")
- subtitle:
desc: >
**Proportion**
- subtitle: Proportion
- contents:
- starts_with("add_areastack")
- starts_with("add_barstack")
- starts_with("add_pie")
- subtitle:
desc: >
**Annotation**
- subtitle: Annotation
- contents:
- starts_with("add_title")
- starts_with("add_text_labels")
- starts_with("add_reference")
- title: Adjust
desc: Adjust plot components, properties, data labels and themes.
- subtitle:
desc: >
**Components & properties**
- subtitle: Components & properties
- contents:
- starts_with("adjust_x_axis")
- starts_with("adjust_colors")
Expand All @@ -82,23 +66,17 @@ reference:
- starts_with("adjust_padding")
- starts_with("adjust_rotate_plot")
- starts_with("adjust_description")
- subtitle:
desc: >
**Axis and color labels**
- subtitle: Axis and color labels
- contents:
- starts_with("rename")
- starts_with("reorder")
- starts_with("sort")
- starts_with("reverse")
- subtitle:
desc: >
**Themes**
- subtitle: Themes
- contents:
- starts_with("theme")
- starts_with("remove")
- subtitle:
desc: >
**Colors**
- subtitle: Colors
- contents:
- starts_with("colors_discrete")
- starts_with("colors_continuous")
Expand Down
9 changes: 5 additions & 4 deletions man/general_arguments.Rd → man/common_arguments.Rd

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

11 changes: 11 additions & 0 deletions pkgdown/extra.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
h3 {
font-size: 1.1rem;
font-weight: 700;
/*margin-top: 2.2rem;*/
/*border-bottom: 1px solid rgb(222, 226, 230);*/
}

h2 {
/*margin-top: 2.2rem;*/
/*border-bottom: 1px solid rgb(222, 226, 230);*/
}

0 comments on commit 1b850f3

Please sign in to comment.