rankslopegraph {ammistability} | R Documentation |
Rank Slopegraph
Description
Create a slopegraph or bump chart from a data frame of ranks.
Usage
rankslopegraph(
df,
names,
group,
force.grouping = TRUE,
line.size = 1,
line.alpha = 0.5,
line.col = NULL,
point.size = 1,
point.alpha = 0.5,
point.col = NULL,
text.size = 2,
legend.position = "bottom"
)
Arguments
df |
A data frame of records. |
names |
The name of the column having the names of the records. |
group |
Optional. The name of the column with a grouping variable. |
force.grouping |
If |
line.size |
Size of lines plotted. Must be numeric. |
line.alpha |
Transparency of lines plotted. Must be numeric. |
line.col |
Default is |
point.size |
Size of points plotted. Must be numeric. |
point.alpha |
Transparency of points plotted. Must be numeric. |
point.col |
Default is |
text.size |
Size of text annotations plotted. Must be numeric. |
legend.position |
Position of the legend in the plot. |
Value
The slopegraph as a ggplot2
grob.
References
Tufte ER (1986). The Visual Display of Quantitative Information. Graphics Press, Cheshire, CT, USA. ISBN 0-9613921-0-X.
Examples
library(agricolae)
data(soil)
dec <- c("pH", "EC")
inc <- c("CaCO3", "MO", "CIC", "P", "K", "sand",
"slime", "clay", "Ca", "Mg", "K2", "Na", "Al_H", "K_Mg", "Ca_Mg",
"B", "Cu", "Fe", "Mn", "Zn")
soilrank <- rankdf(soil, increasing = inc, decreasing = dec)
soilrank
soilslopeg <- rankslopegraph(soilrank, names = "place")
soilslopeg