Skip to content

Commit

Permalink
rename error to sem
Browse files Browse the repository at this point in the history
  • Loading branch information
jbengler committed Jul 5, 2024
1 parent e4939f3 commit 15f7f1c
Show file tree
Hide file tree
Showing 37 changed files with 470 additions and 470 deletions.
4 changes: 2 additions & 2 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@ export(add_data_points_jitter)
export(add_density_curve)
export(add_density_histogram)
export(add_donut)
export(add_error_bar)
export(add_error_ribbon)
export(add_heatmap)
export(add_histogram)
export(add_line)
Expand All @@ -51,6 +49,8 @@ export(add_range_ribbon)
export(add_reference_lines)
export(add_sd_bar)
export(add_sd_ribbon)
export(add_sem_bar)
export(add_sem_ribbon)
export(add_stats_asterisks)
export(add_stats_pvalue)
export(add_sum_area)
Expand Down
24 changes: 12 additions & 12 deletions R/add-general.R
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ ff_errorbar <- function(.fun.data) {
}
#' Add error bar
#'
#' * `add_error_bar()` adds the standard error of mean.
#' * `add_sem_bar()` adds the standard error of mean.
#' * `add_range_bar()` adds the range from smallest to largest value.
#' * `add_sd_bar()` adds the standard deviation.
#' * `add_ci95_bar()` adds the 95% confidence interval.
Expand All @@ -77,7 +77,7 @@ ff_errorbar <- function(.fun.data) {
#' study %>%
#' tidyplot(x = treatment, y = score, color = treatment) %>%
#' add_data_points() %>%
#' add_error_bar()
#' add_sem_bar()
#' study %>%
#' tidyplot(x = treatment, y = score, color = treatment) %>%
#' add_data_points() %>%
Expand All @@ -92,14 +92,14 @@ ff_errorbar <- function(.fun.data) {
#' add_ci95_bar()
#'
#' @export
add_error_bar <- ff_errorbar(.fun.data = ggplot2::mean_se)
#' @rdname add_error_bar
add_sem_bar <- ff_errorbar(.fun.data = ggplot2::mean_se)
#' @rdname add_sem_bar
#' @export
add_range_bar <- ff_errorbar(.fun.data = min_max)
#' @rdname add_error_bar
#' @rdname add_sem_bar
#' @export
add_sd_bar <- ff_errorbar(.fun.data = mean_sdl)
#' @rdname add_error_bar
#' @rdname add_sem_bar
#' @export
add_ci95_bar <- ff_errorbar(.fun.data = mean_cl_boot)

Expand All @@ -118,7 +118,7 @@ ff_ribbon <- function(.fun.data) {
}
#' Add ribbon
#'
#' * `add_error_ribbon()` adds the standard error of mean.
#' * `add_sem_ribbon()` adds the standard error of mean.
#' * `add_range_ribbon()` adds the range from smallest to largest value.
#' * `add_sd_ribbon()` adds the standard deviation.
#' * `add_ci95_ribbon()` adds the 95% confidence interval.
Expand All @@ -129,7 +129,7 @@ ff_ribbon <- function(.fun.data) {
#' time_course %>%
#' tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
#' add_mean_line() %>%
#' add_error_ribbon()
#' add_sem_ribbon()
#' time_course %>%
#' tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
#' add_mean_line() %>%
Expand All @@ -144,14 +144,14 @@ ff_ribbon <- function(.fun.data) {
#' add_ci95_ribbon()
#'
#' @export
add_error_ribbon <- ff_ribbon(.fun.data = ggplot2::mean_se)
#' @rdname add_error_ribbon
add_sem_ribbon <- ff_ribbon(.fun.data = ggplot2::mean_se)
#' @rdname add_sem_ribbon
#' @export
add_range_ribbon <- ff_ribbon(.fun.data = min_max)
#' @rdname add_error_ribbon
#' @rdname add_sem_ribbon
#' @export
add_sd_ribbon <- ff_ribbon(.fun.data = ggplot2::mean_sdl)
#' @rdname add_error_ribbon
#' @rdname add_sem_ribbon
#' @export
add_ci95_ribbon <- ff_ribbon(.fun.data = ggplot2::mean_cl_boot)

Expand Down
2 changes: 1 addition & 1 deletion R/feature_requests.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# animals %>%
# tidyplot(family, size, color = family) %>%
# add_mean_bar(alpha = 0.3) %>%
# add_error_bar() %>%
# add_sem_bar() %>%
# adjust_data_labels(family, sort_by = size)
#
# # default random jitter
Expand Down
8 changes: 4 additions & 4 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ library(tidyplots)
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm()
```
Expand Down Expand Up @@ -99,7 +99,7 @@ time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_mean_line() %>%
add_mean_dot() %>%
add_error_ribbon()
add_sem_ribbon()
```

Expand All @@ -116,7 +116,7 @@ gene_expression %>%
dplyr::filter(external_gene_name %in% c("Apol6", "Col5a3", "Vgf", "Bsn")) %>%
tidyplot(x = condition, y = expression, color = sample_type) %>%
add_mean_dash() %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm() %>%
add_stats_asterisks(include_info = FALSE) %>%
remove_x_axis_title() %>%
Expand All @@ -128,7 +128,7 @@ gene_expression %>%
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm() %>%
view_plot(title = "Default color scheme: metro") %>%
adjust_colors(colors_discrete_seaside) %>%
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ library(tidyplots)
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm()
```

Expand Down Expand Up @@ -96,7 +96,7 @@ time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_mean_line() %>%
add_mean_dot() %>%
add_error_ribbon()
add_sem_ribbon()
```

<img src="man/figures/README-unnamed-chunk-8-1.png" style="display: block; margin: auto;" />
Expand All @@ -115,7 +115,7 @@ gene_expression %>%
dplyr::filter(external_gene_name %in% c("Apol6", "Col5a3", "Vgf", "Bsn")) %>%
tidyplot(x = condition, y = expression, color = sample_type) %>%
add_mean_dash() %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm() %>%
add_stats_asterisks(include_info = FALSE) %>%
remove_x_axis_title() %>%
Expand All @@ -128,7 +128,7 @@ gene_expression %>%
study %>%
tidyplot(x = treatment, y = score, color = treatment) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm() %>%
view_plot(title = "Default color scheme: metro") %>%
adjust_colors(colors_discrete_seaside) %>%
Expand Down
2 changes: 1 addition & 1 deletion _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ reference:
- contents:
- starts_with("add_boxplot")
- starts_with("add_violin")
- starts_with("add_error")
- starts_with("add_sem")
- subtitle: Proportion
- contents:
- starts_with("add_areastack")
Expand Down
4 changes: 2 additions & 2 deletions data-raw/distributions.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ distributions %>%
add_violin() %>%
add_data_points_beeswarm() %>%
add_mean_dash(color = "red") %>%
add_error_bar(color = "red") %>%
add_sem_bar(color = "red") %>%
add_reference_lines(y = c(7, 8.25, 5.75))

distributions %>%
tidyplot(x = group, y = value, color = group) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar()
add_sem_bar()

distributions %>%
tidyplot(x = group, y = value, color = group) %>%
Expand Down
10 changes: 5 additions & 5 deletions data-raw/study.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,33 @@ study <-
study %>%
tidyplot(treatment, score, color = treatment) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm()

study %>%
tidyplot(treatment, score) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points() %>%
add_line()

study %>%
tidyplot(treatment, score) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points() %>%
add_line(group = participant)

study %>%
tidyplot(dose, score, color = group) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points_beeswarm()

study %>%
tidyplot(treatment, score, color = group) %>%
add_mean_bar(alpha = 0.3) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points() %>%
add_line(group = participant) %>%
adjust_data_labels(treatment, sort_by = dose)
Expand Down
12 changes: 6 additions & 6 deletions data-raw/testing.R
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ study %>%
study %>%
tidyplot(treatment, score, color = treatment) %>%
add(geom_col(alpha = 0.4, color = NA, width = 0.6)) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points(jitter_width = 0.2)

study %>%
tidyplot(treatment, score, color = treatment) %>%
add_mean_bar(alpha = 0.2) %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points(jitter_width = 0.2)

mapping <- ggplot2::aes(color = dose, fill = ggplot2::after_scale(apply_saturation(colour, saturation)))
Expand Down Expand Up @@ -291,7 +291,7 @@ p <-

p %>% add_boxplot() %>% add_data_points()
p %>% add_violin() %>% add_data_points() # preserve = "single" destroys violins, therefore not implemented here
p %>% add_error_bar() %>% add_data_points()
p %>% add_sem_bar() %>% add_data_points()
p %>% add_mean_dash() %>% add_data_points()
p %>% add_mean_bar() %>% add_data_points()

Expand Down Expand Up @@ -401,7 +401,7 @@ ggplot(data, aes(x = category, y = value)) +
gene_expression %>%
tidyplot(x = sample_type, y = expression, color = condition) %>%
add_mean_dash() %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points() %>%
add_stats_asterisks(include_info = FALSE) %>%
split_plot(by = external_gene_name, ncol = 3, nrow = 3) %>%
Expand All @@ -410,7 +410,7 @@ gene_expression %>%
gene_expression %>%
tidyplot(x = sample_type, y = expression, color = condition) %>%
add_mean_dash() %>%
add_error_bar() %>%
add_sem_bar() %>%
add_data_points() %>%
add_stats_asterisks() %>%
split_plot(by = external_gene_name, ncol = 3, nrow = 3) %>%
Expand All @@ -419,6 +419,6 @@ gene_expression %>%
gene_expression %>%
tidyplot(x = sample_type, y = expression, color = condition) %>%
add_mean_dash() %>%
add_error_bar() %>%
add_sem_bar() %>%
split_plot(by = external_gene_name, ncol = 3, nrow = 3) %>%
save_plot("multipage4.pdf", units = "in")
2 changes: 1 addition & 1 deletion data-raw/time_course.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ time_course %>%
tidyplot(x = day, y = score, color = treatment, dodge_width = 0) %>%
add_mean_line() %>%
add_mean_dot() %>%
add_error_ribbon()
add_sem_ribbon()

library(tidyverse)

Expand Down
10 changes: 5 additions & 5 deletions man/add_error_bar.Rd → man/add_sem_bar.Rd

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

10 changes: 5 additions & 5 deletions man/add_error_ribbon.Rd → man/add_sem_ribbon.Rd

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

Loading

0 comments on commit 15f7f1c

Please sign in to comment.