Learn R Programming

monographaR (version 1.0)

phenoHist: Circular histograms of phenology

Description

This wrapper function will generate circular histograms of phenology, using functions of the package circular.

Usage

phenoHist(data = data, mfrow = c(1, 1), shrink = 1.2, axis.cex = 
1.5, title.cex = 1.5, pdf = F, filename = "phenology.pdf", flower 
= "Flower", fruit = "Fruit", both = "Both", flower.col = NULL, 
flower.border = "black", fruit.col = "darkgray", fruit.border = 
"darkgray")

Arguments

data
data.frame
mfrow
numeric, (nrow, ncol)
shrink
numeric
axis.cex
numeric
title.cex
numeric
pdf
logical
filename
character
flower
character (how is the flower indicated in data, if missing place "missing")
fruit
character (how is the fruit indicated in data, if missing place "missing")
both
character (how is the both indicated in data, if missing place "missing")
flower.col
character (color of flower bars)
flower.border
character (color of flower border bars)
fruit.col
character (color of fruit bars)
fruit.border
character (color of fruit border bars)

Value

  • Exports a pdf file.

Details

It requires a data.frame with three columns, ordered as: species, month and phenology. The month column should be numeric (month number), while the phenology column must have these values: "Flower", "Fruit" and/or "Both". If any of these are missing is possible to indicate in the "flower", "fruit" and "both" arguments (both="missing"). The function will plot the bars indicating flower observations in white, and fruits in gray by default (is possible to change it with the "flower.col", "flower.border", "fruit.col" and "fruit.border" arguments). The size of the bar corresponds to number of observations. The arguments "shrink", "axis.cex" and "title.cex" control sizes, while the "mfrow" changes the number of histograms plotted at the same page (rows, columns).

See Also

circular

Examples

Run this code
## loading the example data

data(monographaR_examples)
monographaR_examples$phenoHist -> data
head(data)

## running the function

phenoHist(data, mfrow=c(2,2), shrink=1.2, axis.cex=1.5, title.cex=1.5, 
pdf=FALSE)

## changing the color

phenoHist(data, mfrow=c(2,2), shrink=1.2, axis.cex=1.5, title.cex=1.5, 
pdf=FALSE, flower.col=rgb(0.2,1,0.2, 0.5), flower.border=rgb(0.2,1,0.2, 
0.5), fruit.col="darkgreen", fruit.border="black")

## plotting only flower (if "fruit" and/or "both" information are 
## missing for instance)

phenoHist(data, mfrow=c(2,2), shrink=1.2, axis.cex=1.5, title.cex=1.5, 
pdf=FALSE, fruit="missing", both="missing", flower.col="red", 
flower.border="darkgray")

Run the code above in your browser using DataLab