# NOT RUN {
# Using EUROFAMCARE sample dataset
# dataset was importet from an SPSS-file, using:
# efc <- sjlabelled::read_spss("efc.sav", enc = "UTF-8")
library(sjmisc)
library(sjlabelled)
data(efc)
# boxplot
sjp.frq(ChickWeight$weight, type = "box")
# histogram
sjp.frq(efc$e17age, type = "hist", show.mean = TRUE)
# violin plot
sjp.frq(ChickWeight$weight, type = "v")
# bar plot
sjp.frq(ChickWeight$Diet)
# you may use sjp.setTheme here to change axis textangle
sjp.frq(efc$e15relat)
# grouped variable
ageGrp <- group_var(efc$e17age)
ageGrpLab <- group_labels(efc$e17age)
sjp.frq(ageGrp, title = get_label(efc$e17age), axis.labels = ageGrpLab)
# negative impact scale, ranging from 7-28
sjp.frq(efc$neg_c_7)
# plotting confidence intervals. expand grid and v/hjust for text labels
sjp.frq(
efc$e15relat, type = "dot", show.ci = TRUE, sort.frq = "desc",
coord.flip = TRUE, expand.grid = TRUE, vjust = "bottom", hjust = "left"
)
# Simulate ggplot-default histogram
sjp.frq(efc$c160age, type = "h", geom.size = 3)
# histogram with overlayed normal curve
sjp.frq(efc$c160age, type = "h", show.mean = TRUE, show.mean.val = TRUE,
normal.curve = TRUE, show.sd = TRUE, normal.curve.color = "blue",
normal.curve.size = 3, ylim = c(0,50))
# }
Run the code above in your browser using DataLab