## Install and Load Packages if (!'remotes' %in% rownames(installed.packages())) install.packages('remotes') if (!"rshinystatistics" %in% rownames(installed.packages())) { remotes::install_github("geiser/rshinystatistics") } else if (packageVersion("rshinystatistics") < "{{ rshinystatistics.version }}") { remotes::install_github("geiser/rshinystatistics") } wants <- c('ggplot2','ggpubr','rshinystatistics','utils') has <- wants %in% rownames(installed.packages()) if (any(!has)) install.packages(wants[!has]) library(utils) library(ggpubr) library(ggplot2) library(rshinystatistics)
library(knitr) opts_chunk$set(echo = TRUE) defaultW <- getOption("warn") options(warn = -1)
wid <- "{{ wid }}" between <- c({{ paste0(paste0('"', between, '"'), collapse = ',') }}) dvs <- c({{ paste0(paste0('"',dvs,'"="',dvs,'"'), collapse = ',') }}) dat <- lapply(dvs, FUN = function(dv) { data <- read.csv(paste0("../data/table-for-",dv,".csv")) rownames(data) <- data[["{{ wid }}"]] return(data) }) rdat <- dat
(df <- get.descriptives(dat, dvs, between, include.global = T, symmetry.test = T))
kable(df, digits = 3)
{{ sformula <- paste0(paste0('`',between,'`'), collapse = '*') box.plot.code <- paste0(lapply(dvs, FUN = function(dv) { paste0("car::Boxplot(`",dv,"` ~ ",sformula,", data = dat[[\"",dv,"\"]], id = list(n = Inf))") }), collapse = '\n') box.plot.code }}
{{ code.skewness }}
{{ code.outliers }}
sdat <- rdat
ndat <- sdat[[1]] for (dv in names(sdat)[-1]) ndat <- merge(ndat, sdat[[dv]]) write.csv(ndat, paste0("../data/table-without-outliers.csv"))
Descriptive statistics of data used in the nonparametric test
(df <- get.descriptives(sdat, dvs, between))
kable(df, digits = 3)
{{ sformula <- paste0(paste0('`',between,'`'), collapse = '*') box.plot.code <- paste0(lapply(dvs, FUN = function(dv) { paste0("car::Boxplot(`",dv,"` ~ ",sformula,", data = sdat[[\"",dv,"\"]], id = list(n = Inf))") }), collapse = '\n') box.plot.code }}
{{ code.hypothesis }}
{{ code.hypothesis.tbl }}
{{ code.pwc }}
{{ code.pwc.tbl }}
{{ code.plots }}
{{ hypothesis.text }}
{{ hypothesis.pwc.text }}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.