organising plotting functions - nicer plot wrapping - merge mulitple workbook sheets

This commit is contained in:
Andreas Gammelgaard Damsbo 2025-03-13 12:41:50 +01:00
commit 49016a4aa8
No known key found for this signature in database
20 changed files with 1615 additions and 910 deletions

25
R/plot_scatter.R Normal file
View file

@ -0,0 +1,25 @@
#' Beautiful violin plot
#'
#' @returns ggplot2 object
#' @export
#'
#' @name data-plots
#'
#' @examples
#' mtcars |> plot_scatter(x = "mpg", y = "wt")
plot_scatter <- function(data, x, y, z = NULL) {
if (is.null(z)) {
rempsyc::nice_scatter(
data = data,
predictor = y,
response = x, xtitle = get_label(data, var = y), ytitle = get_label(data, var = x)
)
} else {
rempsyc::nice_scatter(
data = data,
predictor = y,
response = x,
group = z, xtitle = get_label(data, var = y), ytitle = get_label(data, var = x)
)
}
}