Description Usage Arguments Details Value Examples
View source: R/effectiveness_plot.R
Function to plot effectiveness landscapes, with repel labels option.
1 2 3 4 5 |
q1 |
Numeric vector representing the "quantitative component", to plot on the X axis. |
q2 |
Numeric vector representing the "qualitative component", to plot on the Y axis. |
q1.error |
Optional. Numeric vector to be used as error bars for |
q2.error |
Optional. Numeric vector to be used as error bars for |
pts.shape |
Optional. A grouping variable (< 7 groups) to set point shapes (e.g., family). |
pts.color |
Optional. A grouping variable to set point colours (e.g., family). |
pts.size |
Optional. Size of points. |
label |
Optional. A character vector of the same length as |
label.size |
Size of point labels. |
italic |
Logical. Use italic font for labels? |
show.lines |
Logical. Show effectiveness isolines? (default is TRUE). |
nlines |
Specify the number of isolines. |
lines.breaks |
Either a numeric vector giving break points for the contour lines, or a |
lines.color |
Color of the isolines. |
myxlab |
optional label for axis X. |
myylab |
optional label for axis Y. |
... |
Further arguments to be passed to |
The script plots effectiveness landscapes as described in Schupp, E. W., Jordano, P. and Gómez, J.M. 2010. Seed dispersal effectiveness revisited: a conceptual review. New Phytologist 188: 333-353.
A ggplot2 object, which can be later modified (see examples).
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | #------------------------------------------------------------------------
# Based on a dataset of Cecropia glaziovii frugivores.
# In this example we build the effectiveness landscape just for the
# quantitative component, plotting its two subcomponents, visitation
# rate and per-visit effectiveness.
#------------------------------------------------------------------------
data(cecropia)
effectiveness_plot(q1 = cecropia$totvis, q2 = cecropia$totbic,
myxlab= "No. visits/10h",
myylab="Effectiveness/vis (No. fruits handled)")
#------------------------------------------------------------------------
## Avoiding label overplotting ##
## e.g. showing only names of species with high effectiveness
labels = cecropia$code
labels[4:length(cecropia$code)] <- NA
effectiveness_plot(q1 = cecropia$totvis, q2 = cecropia$totbic,
label = labels,
myxlab= "No. visits/10h",
myylab="Effectiveness/vis (No. fruits handled)")
################################################
## Modify plot ##
myplot <- effectiveness_plot(q1 = cecropia$totvis, q2 = cecropia$totbic,
label = labels, nlines = 10,
myxlab= "No. visits/10h",
myylab="Effectiveness/vis (No. fruits handled)")
myplot + ggplot2::theme_minimal()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.