multipleBoxplots {sistmr}R Documentation

Multiple boxplots for many times

Description

Multiple boxplots for many times

Usage

multipleBoxplots(data, x_var, y_var, add_points = TRUE)

Arguments

data

a dataset from which the variable x_var and y_var should be taken.

x_var

corresponding to the x coordinates for the plot, it must be a factor to obtain multiple boxplots.

y_var

corresponding to the y coordinates for the plot.

add_points

if you want to add points on boxplots. Default value is TRUE.

Value

a ggplot2 object

Examples

library(ggplot2)

#Generate data
x_ex <- factor(c(rep("J0", 10), rep("J7", 10), rep("J14", 10)), levels = c("J0", "J7", "J14"))
y_ex <- rnorm(30)

data_ex <- cbind.data.frame(x_ex, y_ex)

#Plotting
multipleBoxplots(data = data_ex, x_var = x_ex, y_var = y_ex)

multipleBoxplots(data = data_ex, x_var = x_ex, y_var = y_ex) + 
labs(x = "Time", y = "Value") + 
theme(legend.position = "none")

[Package sistmr version 0.1.1 Index]