fplot: fplot

Description Usage Arguments Examples

Description

Convenient plotting of means and error bars or boxplots of factorial data.

Usage

1
2
fplot(.data, formula, geom = c("bar", "line", "boxplot"), error = c("se",
  "sd", "moe"), ...)

Arguments

.data

a data frame containing the variables in the formula formula.

formula

a formula in the form lhs ~ rhs where lhs is a numeric variable (the dependent variable) and rhs one or more factors with two or more levels giving the corresponding groups.

geom

character string indicating the ggplot2 geom used. One of "bar" (default), "line" and "boxplot".

error

character string indicating the function used for calculating the error bars. One of "se" (default) "sd" or "moe". Ignored if geom is "boxplot".

...

Further arguments passed to methods. E.g. quantile if error is "moe" to indicate the quantile for the confidence interval.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
fplot(hquest, trait_anx ~ group + gender)

# Standard deviation instead of standard error
fplot(hquest, trait_anx ~ group + gender, error = "sd")

# 95% confidence intervals (moe = margin of error)
fplot(hquest, trait_anx ~ group + gender, error = "moe")

# Line graph
fplot(hquest, trait_anx ~ group + gender, geom = "line")

# Boxplot
fplot(hquest, trait_anx ~ group + gender, geom = "boxplot")

dgromer/psymisc documentation built on May 15, 2019, 7:22 a.m.