Learn R Programming

phylotools (version 0.1.2)

imagevect: Image plot of a numeric vector

Description

An image plot of a vector given the labels in "XnYn" in format.

Usage

imagevect(x, labels, contour = FALSE, gridsize = 20, axes = TRUE, nlabx = 5, nlaby = 5, ...)

Arguments

x
A numeric vector representing the value for each quadrat.
labels
A character vector representing the row and column for each value in x. Should be in format "X10Y5", which is account for column 10 (X = 10), and row 5(Y = 5).
contour
Whether to add contour lines to the existing image plot.
gridsize
Size for each quadrat or grid
axes
Whether to draw axes for the plot
nlabx
Number of labels to be added to the x axis
nlaby
Number of labels to be added to the y axis
...
Further arguments to passed on for plotting

Value

Image plot for the vector.

Details

This function will automatically sort the values in vector according to the information of rows and columns that extracted from labels, and subsequently build a matrix for invoking the image.plot function in "fields" package. The labels must be in "XnYn" format, and must be in the same length with vec.

References

None

Examples

Run this code

x <- rnorm(600)
labmat <- expand.grid(paste("X",1:30, sep = ""), paste("Y", 1:20, sep = ""))
lab <- paste(labmat[,1], labmat[,2], sep = "")
imagevect(x, labels = lab, col = cm.colors(10))

Run the code above in your browser using DataLab