Type: Package
Title: Making Visual Exploratory Data Analysis with Nested Data Easier
Version: 1.0.2
Description: Provides tools for visual exploratory data analysis with nested data. Includes functions for creating bivariate plots, dot plots, histograms, and violin plots for each group or unit in nested data. Methods are described in Crabtree and Nelson (2017) "Plotrr: Functions for making visual exploratory data analysis with nested data easier" <doi:10.21105/joss.00190>.
License: MIT + file LICENSE
Encoding: UTF-8
Imports: ggplot2
RoxygenNote: 7.3.3
Suggests: knitr, rmarkdown
VignetteBuilder: knitr
URL: https://github.com/lobsterbush/plotrr
BugReports: https://github.com/lobsterbush/plotrr/issues
NeedsCompilation: no
Packaged: 2026-03-24 12:25:52 UTC; f00421k
Author: Charles Crabtree [aut, cre], Michael J. Nelson [aut]
Maintainer: Charles Crabtree <charles.crabtree@monash.edu>
Repository: CRAN
Date/Publication: 2026-03-27 11:00:02 UTC

Plots the bivariate relationship between two measures for each group/unit

Description

Returns a plot of the bivariate relationship between two measures for each group/unit.

Usage

bivarplots(x, y, group, data)

Arguments

x

A vector.

y

A vector.

group

A vector.

data

A data frame.

Value

A series of figures that plot the bivariate relationship between two measures for each group/unit.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

a <- runif(1000, min = 0, max = 1)
b <- a + rnorm(1000, mean = 0, sd = 1)
c <- rep(c(1:10), times = 100)
data <- data.frame(a, b, c)
bivarplots("a", "b", "c", data)

Plots the bivariate relationship between two measures and a rugplot for each measure

Description

Returns a plot of the bivariate relationship between two measures with a rugplot for each measure.

Usage

bivarrugplot(x, y, data)

Arguments

x

A vector.

y

A vector.

data

A data frame.

Value

A plot of the bivariate relationship between two measures with a rugplot for each measure.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

a <- runif(1000, min = 0, max = 1)
b <- a + rnorm(1000, mean = 0, sd = 1)
data <- data.frame(a, b)
bivarrugplot("a", "b", data)

(Effectively) clears R terminal

Description

Effectively clears the R terminal by filling it with whitespace.

Usage

clear(...)

Arguments

...

An unused argument.

Value

No return value (called for side effect of printing a form feed character to the console, which visually clears the R terminal). Returns NULL invisibly.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

clear()

Creates histograms for a measure for each group/unit

Description

Returns histograms for a measure for each group/unit.

Usage

dotplots(x, y, group, data, n)

Arguments

x

A vector.

y

A vector.

group

A vector that contains unit/group identifiers.

data

A data frame.

n

The number of bins. Some experimentation with this number might be necessary.

Value

Historgrams for a measure for each group/unit.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

a <- runif(1000, min = 0, max = 1)
b <- a + rnorm(1000, mean = 0, sd = 1)
c <- rep(c(1:10), times = 100)
data <- data.frame(a, b, c)
dotplots("a", "b", "c", data, 20)

Creates histograms for a measure for each group/unit

Description

Returns histograms for a measure for each group/unit.

Usage

histplots(x, y, group, data, n)

Arguments

x

A vector.

y

A vector.

group

A vector that contains unit/group identifiers.

data

A data frame.

n

The number of bins.

Value

Historgrams for a measure for each group/unit.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

a <- runif(1000, min = 0, max = 1)
b <- a + rnorm(1000, mean = 0, sd = 1)
c <- rep(c(1:10), times = 100)
data <- data.frame(a, b, c)
histplots("a", "b", "c", data, 5)

Calculates the number of unique values in a vector

Description

Calculates the number of unique values in a vector.

Usage

lengthunique(x)

Arguments

x

A vector.

Value

The number of unique values in a vector.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

x <- rep(c(1:10), 10)
lengthunique(x)

Converts factor vectors to numeric vectors

Description

Converts factor vectors to numeric vectors.

Usage

makefacnum(x)

Arguments

x

A vector.

Value

A numeric vector.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

x <- c("1", "2", "3")
x <- as.factor(x)
x
x <- makefacnum(x)
x
is.numeric(x)

Creates violin plots for the relationship between two measures for each group/unit

Description

Returns violin plots for the relationship between two measures for each group/unit.

Usage

violinplots(x, y, group, data)

Arguments

x

A vector.

y

A vector.

group

A vector that contains unit/group identifiers.

data

A data frame.

Value

Violin plots for the relationship between two measures for each group/unit.

Author(s)

Charles Crabtree charles.crabtree@monash.edu

Examples

a <- runif(1000, min = 0, max = 1)
b <- a + rnorm(1000, mean = 0, sd = 1)
c <- rep(c(1:10), times = 100)
data <- data.frame(a, b, c)
violinplots("a", "b", "c", data)