plot_eval: Plot multiple course evalautions

Description Usage Arguments Examples

View source: R/plot_eval.R

Description

This function takes as input a data frame from join_eval (or from sim_eval) and plots the results. Choose the type of plot using the argument plottype. Furhtermore, decide how the different courses and the different topics should be represented in the plot using course_as and topic_as, namely, either on the x-axis, in different facets/panels, or using different colors/groups.

Usage

1
2
3
4
5
plot_eval(data = NULL, plottype = c("barplot", "points", "boxplot",
  "violin"), courses = NULL, domains = 2, topics = NULL,
  topic_as = c("facet", "group", "x-axis"), course_as = c("x-axis", "facet",
  "group"), add_line = FALSE, errorbar = TRUE, CI = 0.95, grey = FALSE,
  lang = NULL, xvar_as_legend = FALSE, control = list(), ...)

Arguments

data

Data frame as returned from join_eval (or from sim_eval).

plottype

Character, either "barplot", "points", "boxplot", or "violin".

courses

Optional character vector of length >= 1. Used to select a subset of courses present in data$course.

domains

Numeric of length >= 1, specifying the domains to plot.

  • 1: Overall (one scale, namely, average of domains = 2)

  • 2: Overall, (i.e., didactic skills, grade lecturer, grade course, and comparison with other courses)

  • 3: Different scales (e.g., structure, sympathy, motivation)

  • 4: Settings (e.g., temperature, acoustics, media use)

  • 5: Students' presentations

  • 6: Misc

topics

Optional character vector of length >= 1. Used to select a subset of topics present in data$topic, e.g., topics = c("Overall", "Motivation"). Overrides argument domains.

topic_as

Character. Should each topic be plotted using a different "facet" (panel), different "group", or a different value on the "x-axis"?

course_as

Character. Should each course/file be plotted using a different value on the "x-axis", a different "facet" (panel), or a different "group"?

add_line

Logical. Should a connecting line be added to the plot?

errorbar

Logical indicating whether error bars representing a confidence interval should be plotted or not.

CI

Numeric. Confidence level of error bars, often .95 for a 95% CI.

grey

Logical indicating whether colors should be replaces with shades of grey.

lang

Character string specifying the language of the variable names.

xvar_as_legend

Logical indicating whether a legend should be plotted for the variable on the x-axis.

control

Optional list to fine-tune the plot.

nrow

Numeric. Number of rows of a facetted plot. Passed to facet_wrap.

ncol

Numeric. Number of columns of a facetted plot. Passed to facet_wrap.

title

Character. Passed to labs.

legend_title

Character. Passed to labs.

x_lab

Character. Passed to labs.

y_lab

Character. Passed to labs.

angle, hjust

Numeric. Adjustment of the labels of the ticks on the x-axis. Passed to element_text.

errorbar_width

Numeric. Width of the whiskers. Passed to geom_errorbar.

ylim

Numeric of length <= 2. Limits of the y-axis. Passed to coord_cartesian.

alpha

Numeric. Alpha transparency.

size

Numeric. Factor modifying the size of points and errorbars, defaulting to 1.

shape

Numeric/Character. Shape of points. Passed to geom_point.

dodge_width

Numeric. How far away from each other should different groups be plotted? Passed to position_dodge.

...

Other parameters passed to—depending on plottypegeom_col, geom_point, geom_boxplot, or geom_violin.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## Not run: 
tmp1 <- read_eval("./data")
dat1 <- join_eval(tmp1)

## End(Not run)

# Simulate data
dat1 <- sim_eval()

plot_eval(dat1)

plot_eval(dat1, plottype = "points", domains = 1)

plot_eval(dat1, courses = c("Course1", "Course3"), errorbar = FALSE)

plot_eval(dat1, topics = c("Motivierung", "Note Dozent"), plottype = "boxplot")

plot_eval(dat1, plottype = "points", topic_as = "x-axis", course_as = "group", add_line = TRUE)

plot_eval(dat1, domains = 1:2, plottype = "violin", xvar_as_legend = TRUE,
          control = list(title = "My Title")) +
    ggplot2::theme_dark()

hplieninger/instevalR documentation built on May 17, 2019, 4:54 p.m.