Learn R Programming

imageData (version 0.1-61)

longiPlot: Plots longitudinal data from a Lemna Tec Scananalyzer

Description

Produce profile or longitudinal plots of the data from a Lemna Tec Scananalyzer using ggplot. A line is drawn for the data for each Snapshot.ID.Tag and the plot can be facetted so that a grid of plots is produced.

Usage

longiPlot(data, x = "xDays+44.5", response = "Area", individuals="Snapshot.ID.Tag", 
          x.title = "Days", y.title = "Area (1000 pixels)", title = NULL, 
          facet.x = "Treatment.1", facet.y =   "Smarthouse", labeller = NULL, 
          colour = "black", colour.column=NULL, colour.values=NULL, 
          alpha = 0.1, ggplotFuncs = NULL, printPlot = TRUE)

Value

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

print.

Arguments

data

A data.frame containing the data to be plotted.

x

A character giving the variable to be plotted on the x-axis.

response

A character specifying the response variable that is to be plotted on the y-axis.

individuals

A character giving the name(s) of the factor(s) that define the subsets of the data for which each subset corresponds to the response values for an individual.

x.title

Title for the x-axis.

y.title

Title for the y-axis.

title

Title for the plot.

facet.x

A data.frame giving the variable to be used to form subsets to be plotted in separate columns of plots. Use "." if a split into columns is not wanted.

facet.y

A data.frame giving the variable to be used to form subsets to be plotted in separate rows of plots. Use "." if a split into columns is not wanted.

labeller

A ggplot function for labelling the facets of a plot produced using the ggplot function. For more information see ggplot.

colour

A character specifying a single colour to use in drawing the lines for the profiles. If colouring according to the values of a variable is required then use colour.column.

colour.column

A character giving the name of a column in data over whose values the colours of the lines are to be varied. The colours can be specified using colour.values .

colour.values

A character vector specifying the values of the colours to use in drawing the lines for the profiles. If this is a named vector, then the values will be matched based on the names. If unnamed, values will be matched in order (usually alphabetical) with the limits of the scale.

alpha

A numeric specifying the degrees of transparency to be used in plotting. It is a ratio in which the denominator specifies the number of points (or line) that must be overplotted to give a solid cover.

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.

printPlot

A logical indicating whether or not to print the plot.

Author

Chris Brien

See Also

ggplot, labeller.

Examples

Run this code
data(exampleData)
longiPlot(data = longi.dat, response = "Area.smooth")

plt <- longiPlot(data = longi.dat, response = "Area.smooth", x.title = "DAP",  
                 y.title = "Area.smooth", x="xDays+35.42857143", printPlot=FALSE)
plt <- plt + ggplot2::geom_vline(xintercept=29, linetype="longdash", size=1) +
             ggplot2::scale_x_continuous(breaks=seq(28, 42, by=2)) + 
             ggplot2::scale_y_continuous(limits=c(0,750))
print(plt)

longiPlot(data = longi.dat, response = "Area.smooth", x.title = "DAP",  
          y.title = "Area.smooth", x="xDays+35.42857143", 
          ggplotFuncs = list(ggplot2::geom_vline(xintercept=29, linetype="longdash", 
                                                 size=1), 
                             ggplot2::scale_x_continuous(breaks=seq(28, 42, by=2)), 
                             ggplot2::scale_y_continuous(limits=c(0,750))))

Run the code above in your browser using DataLab