Learn R Programming

bReeze (version 0.2-2)

plotAvailability: Plot availability

Description

Plots daily availability from an availability object in a calendar plot.

Usage

plotAvailability(avail, set, ...)
plavail(avail, set, ...)

Arguments

avail
Availability object created by availability.
set
Number of dataset to plot specified as set number or set name (optional).
...
Optional graphical parameters, see below for details.

encoding

UTF-8

Optional graphical parameters

The following graphical parameters can optionally be added to customize the plot:
  • border: Colour of the cell borders -- default value is"black".
  • cex: Numeric value, giving the amount by which text on the plot should be scaled relative to the default (which is 1).
  • cex.axis: Amount by which axis annotations should be scaled, as numeric value.
  • cex.lab: Amount by which axis labels should be scaled, as numeric value.
  • col: Vector of three text colours (or just one colour), where the first indicates 'full availability', the second 'partial availability' and the third 'not available' -- default is"black".
  • col.axis: Colour to be used for axis -- default is"gray45".
  • col.lab: Colour to be used for axis labels -- default is"black".
  • fill: Vector of three fill colours (or just one colour), where the first indicates 'full availability', the second 'partial availability' and the third 'not available'.
  • lwd: Line widths of the cell borders. Seeparfor usage.
  • mar: A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot -- default isc(0, 0, 0, 0).
  • plot.names: IfTRUE(the default), the names of the datasets is plotted as second label of the y axis.
  • xlab: Alternative label for the x axis.
  • ylab: Alternative label for the y axis.

See Also

availability

Examples

Run this code
# load and prepare data
data(winddata)
set1 <- createSet(height=40, v.avg=winddata[,2], dir.avg=winddata[,14])
set2 <- createSet(height=30, v.avg=winddata[,6], dir.avg=winddata[,16])
set3 <- createSet(height=20, v.avg=winddata[,10])
ts <- formatTS(time.stamp=winddata[,1])
neubuerg <- createMast(time.stamp=ts, set1, set2, set3)
neubuerg <- clean(mast=neubuerg)

# calculate availability
neubuerg.avail <- availability(mast=neubuerg, print=FALSE)

# plot availability
plotAvailability(avail=neubuerg.avail)
plotAvailability(avail=neubuerg.avail, set=2)	# one dataset
plotAvailability(avail=neubuerg.avail, set="set2")	# same as above
plotAvailability(avail=neubuerg.avail, set=c(1,2))	# several datasets

# customize plot
plotAvailability(avail=neubuerg.avail, border="darkgray", cex.axis=0.7, 
  cex.lab=0.9, col=c("darkgreen", "orange", "red4"), col.axis="blue", 
  col.lab="blue", fill=c("lightgreen", "yellow", "red"), lwd=0.5, 
  mar=c(1,1,1,1), plot.names=FALSE, xlab="jour", ylab="mois")

Run the code above in your browser using DataLab