knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.width = 7, fig.height = 5, warning = FALSE, message = FALSE ) can_evaluate <- FALSE pkgs <- c("datawizard", "ggplot2") successfully_loaded <- vapply(pkgs, requireNamespace, FUN.VALUE = logical(1L), quietly = TRUE) all_deps_available <- all(successfully_loaded) # even if all dependencies are available, evaluate only if internet access is available if (all_deps_available) { can_evaluate <- curl::has_internet() } if (can_evaluate) { knitr::opts_chunk$set(eval = TRUE) vapply(pkgs, require, FUN.VALUE = logical(1L), quietly = TRUE, character.only = TRUE) } else { knitr::opts_chunk$set(eval = FALSE) }
This vignette can be referred to by citing the package:
citation("see")
datawizard is a lightweight package to easily manipulate, clean, transform, and prepare your data for analysis. Most courses and tutorials about statistical modeling assume that you are working with a clean and tidy dataset. In practice, however, a major part of doing statistical modeling is preparing your data-cleaning up values, creating new columns, reshaping the dataset, or transforming some variables. datawizard provides easy to use tools to perform these common, critical, and sometimes tedious data preparation tasks.
For more, see: https://easystats.github.io/datawizard/
library(datawizard) library(see) library(ggplot2) theme_set(theme_modern())
(related function documentation)
data(iris) result <- describe_distribution(iris$Sepal.Length) result plot(result)
plot(result, dispersion = TRUE)
set.seed(333) x <- sample(1:100, 1000, replace = TRUE) result <- describe_distribution(x) result plot(result)
plot(result, dispersion = TRUE, dispersion_style = "curve")
set.seed(123) result <- describe_distribution(sample(LETTERS[1:10], 1000, TRUE)) # highlight one category plot(result, highlight = "D") # highlight multiple categories plot(result, highlight = c("D", "H"), size_bar = 0.4) # own color scales - pass a named vector to 'scale_fill_manual()' # the name of the non-highlighted color is "no_highlight". plot(result, highlight = c("D", "H", "A"), size_bar = 0.4) + scale_fill_manual(values = c(D = "red", H = "green", A = "gold", no_highlight = "steelblue"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.