data_visuals_ui(id, tab_title = "Plots", ...)
-data_visuals_server(
- id,
- data,
- palettes = c(`Perceptual (blue-yellow)` = "viridis", `Perceptual (fire)` = "plasma",
- `Colour-blind friendly` = "Okabe-Ito", `Qualitative (bold)` = "Dark 2",
- `Qualitative (paired)` = "Paired", `Sequential (blues)` = "Blues",
- `Diverging (red-blue)` = "RdBu", `Tableau style` = "Tableau 10", Pastel = "Pastel 1",
- Rainbow = "rainbow"),
- ...
-)
+data_visuals_server(id, data, palettes, ...)
create_plot(data, type, pri, sec, ter = NULL, color.palette = "viridis", ...)
@@ -756,7 +747,7 @@ One of c("stack", "dodge", "fill")
#> list()
#>
#> $plot_env
-#> <environment: 0x55be33a21918>
+#> <environment: 0x558de882b5e0>
#>
#> $code
#> FreesearchR::plot_violin(pri = "mpg", sec = "cyl", ter = NULL,
@@ -798,35 +789,27 @@ One of c("stack", "dodge", "fill")
mtcars |> plot_hbars(pri = "carb", sec = "cyl")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-#> Error in ggplot2::geom_text(data = .x$rectData[which(.x$rectData$n > 0), ], size = t.size, fontface = "plain", ggplot2::aes(x = group, y = p_prev + 0.49 * p, color = contrast_cut, label = glue::glue(label.str))): Problem while computing aesthetics.
-#> ℹ Error occurred in the 3rd layer.
-#> Caused by error in `check_aesthetics()`:
-#> ! Aesthetics must be either length 1 or the same as the data (9).
-#> ✖ Fix the following mappings: `colour`.
+
mtcars |> plot_hbars(pri = "carb", sec = "cyl", ter="am")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-#> Error in ggplot2::geom_text(data = .x$rectData[which(.x$rectData$n > 0), ], size = t.size, fontface = "plain", ggplot2::aes(x = group, y = p_prev + 0.49 * p, color = contrast_cut, label = glue::glue(label.str))): Problem while computing aesthetics.
-#> ℹ Error occurred in the 3rd layer.
-#> Caused by error in `check_aesthetics()`:
-#> ! Aesthetics must be either length 1 or the same as the data (13).
-#> ✖ Fix the following mappings: `colour`.
+
mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Blues")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-
+
mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Magma")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-
-mtcars |> plot_hbars(pri = "carb", sec = NULL,color.palette="Viridis")
+
+mtcars |> plot_hbars(pri = "carb", sec = "am",color.palette="Viridis")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-
+
mtcars |> plot_likert(pri = "carb", sec = "cyl")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-
+
mtcars |> plot_likert(pri = "carb", sec = "cyl", ter="am")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
@@ -842,24 +825,22 @@ One of c("stack", "dodge", "fill")
#> Adding another scale for y, which will replace the existing scale.
#> Error in plot_likert(mtcars, pri = "carb", sec = "cyl", ter = "am"): object 'i18n' not found
mtcars |> plot_likert(pri = "cyl",color.palette="Blues")
-#> Error in dplyr::mutate(data, dplyr::bind_cols(forcats::fct_unify(data[, variables]))): ℹ In argument: `dplyr::bind_cols(forcats::fct_unify(data[,
-#> variables]))`.
-#> Caused by error in `forcats::fct_unify()`:
-#> ! `fs` must be a list, not a <factor> object.
+#> Scale for fill is already present.
+#> Adding another scale for fill, which will replace the existing scale.
+
mtcars |> plot_likert(pri = "carb", sec = NULL,color.palette="Magma")
-#> Error in dplyr::mutate(data, dplyr::bind_cols(forcats::fct_unify(data[, variables]))): ℹ In argument: `dplyr::bind_cols(forcats::fct_unify(data[,
-#> variables]))`.
-#> Caused by error in `forcats::fct_unify()`:
-#> ! `fs` must be a list, not a <factor> object.
+#> Scale for fill is already present.
+#> Adding another scale for fill, which will replace the existing scale.
+
mtcars |> plot_likert(pri = "carb", sec = c("cyl","am"),color.palette="Viridis")
#> Scale for fill is already present.
#> Adding another scale for fill, which will replace the existing scale.
-
+
mtcars |>
default_parsing() |>
plot_ridge(x = "mpg", y = "cyl")
#> Picking joint bandwidth of 1.38
-
+
mtcars |> plot_ridge(x = "mpg", y = "cyl", z = "gear")
#> Picking joint bandwidth of 1.52
#> Warning: The following aesthetics were dropped during statistical transformation: y and
@@ -939,21 +920,21 @@ One of c("stack", "dodge", "fill")
ds <- data.frame(g = sample(LETTERS[1:2], 100, TRUE), first = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)), last = REDCapCAST::as_factor(sample(letters[1:4], 100, TRUE)))
ds |> plot_sankey("first", "last")
#> Loading required package: ggplot2
-
+
ds |> plot_sankey("first", "last", color.group = "sec")
-
+
ds |> plot_sankey("first", "last", ter = "g", color.group = "sec")
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
-
+
mtcars |>
default_parsing() |>
plot_sankey("cyl", "gear", "am", color.group = "pri")
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
-
+
## In this case, the last plot as the secondary variable in wrong order
## Dont know why...
mtcars |>
@@ -962,17 +943,17 @@ One of c("stack", "dodge", "fill")
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
#> Warning: Some strata appear at multiple axes.
-
+
mtcars |> plot_scatter(pri = "mpg", sec = "wt")
#> Ignoring unknown labels:
#> • legend.title : ""
-
+
mtcars |> plot_scatter(pri = "mpg", sec = "wt",ter="carb")
#> Ignoring unknown labels:
#> • legend.title : ""
-
+
mtcars |> plot_violin(pri = "mpg", sec = "cyl")
-
+
mtcars |> plot_violin(pri = "mpg", sec = "cyl", ter = "gear", color.palette="Blues")
#> Error in plot_violin(mtcars, pri = "mpg", sec = "cyl", ter = "gear", color.palette = "Blues"): object 'i18n' not found
diff --git a/reference/data-plots.md b/reference/data-plots.md
index 1f361836..24b84351 100644
--- a/reference/data-plots.md
+++ b/reference/data-plots.md
@@ -29,16 +29,7 @@ Beautiful violin plot
``` r
data_visuals_ui(id, tab_title = "Plots", ...)
-data_visuals_server(
- id,
- data,
- palettes = c(`Perceptual (blue-yellow)` = "viridis", `Perceptual (fire)` = "plasma",
- `Colour-blind friendly` = "Okabe-Ito", `Qualitative (bold)` = "Dark 2",
- `Qualitative (paired)` = "Paired", `Sequential (blues)` = "Blues",
- `Diverging (red-blue)` = "RdBu", `Tableau style` = "Tableau 10", Pastel = "Pastel 1",
- Rainbow = "rainbow"),
- ...
-)
+data_visuals_server(id, data, palettes, ...)
create_plot(data, type, pri, sec, ter = NULL, color.palette = "viridis", ...)
@@ -712,7 +703,7 @@ create_plot(mtcars, "plot_violin", "mpg", "cyl") |> attributes()
#> list()
#>
#> $plot_env
-#>