designPlotlabels: Plots labels on a two-way grid using 'ggplot2'

designPlotlabelsR Documentation

Plots labels on a two-way grid using ggplot2

Description

Plots the labels in a grid specified by grid.xand grid.y. The labels can be coloured by the values of the column specified by column.name.

Usage

designPlotlabels(data, labels, grid.x = "Columns", grid.y = "Rows", 
                 colour.column=NULL, colour.values=NULL, 
                 reverse.x = FALSE, reverse.y = TRUE, 
                 xlab, ylab, title, printPlot = TRUE, ggplotFuncs = NULL, ...)

Arguments

data

A data.frame containing labels, grid.x, grid.y and, if specified, colour.column.

labels

A character giving the name of the column in data containing the labels to be plotted on the grid.

grid.x

A character giving the name of the column in data that specifies the x-coordinates of the plot grid.

grid.y

A character giving the name of the column in data that specifies the y-coordinates of the plot grid.

reverse.x

A logical which, if true, causes the order of values on the x-axis to be reversed.

reverse.y

A logical which, if true, causes the order of values on the y-axis to be reversed.

colour.column

A character giving the name of the column in data that is to be used to colour the values plotted on the grid.

colour.values

A character giving the name of the column in data that is to be used to colour the values plotted on the grid.

xlab

Label for the x-axis. By default it is the name of the grid.x.

ylab

Label for the y-axis. By default it is the name of the grid.y.

title

Title for plot window. By default it is "Plot of labels".

printPlot

A logical indicating whether to print the plot.

ggplotFuncs

A list, each element of which contains the results of evaluating a ggplot function. It is created by calling the list function with a ggplot function call for each element. These functions are applied in creating the ggplot object.

...

Other arguments that are passed down to the geom_text call that plots the labels.

Value

An object of class "ggplot", which can be plotted using print.

Author(s)

Chris Brien

See Also

fac.combine in package dae, designPlot.

Examples

Treatments <- factor(rep(1:6, times = 5))
RCBD.lay <- designRandomize(allocated = Treatments,
                            recipient = list(Blocks = 5, Units = 6),
                            nested.recipients = list(Units = "Blocks"),
                            seed = 74111)
designPlotlabels(RCBD.lay, labels = "Treatments", 
                 grid.x = "Units", grid.y = "Blocks",
                 colour.column = "Treatments", size = 5)

dae documentation built on June 22, 2024, 9:07 a.m.