rankslopegraph: Rank Slopegraph

Description Usage Arguments Value References Examples

View source: R/Helpers.R

Description

Create a slopegraph or bump chart from a data frame of ranks.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
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 TRUE, the column specified in the argument names will be considered as a grouping variable for plotting the slopegraphs. (Each record will be represented by a different colour). Default is TRUE.

line.size

Size of lines plotted. Must be numeric.

line.alpha

Transparency of lines plotted. Must be numeric.

line.col

Default is TRUE. Overrides colouring by force.grouping argument.

point.size

Size of points plotted. Must be numeric.

point.alpha

Transparency of points plotted. Must be numeric.

point.col

Default is TRUE. Overrides colouring by force.grouping argument.

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

\insertRef

tufte_visual_1986ammistability

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
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

ajaygpb/AMMIStbp documentation built on Jan. 27, 2020, 8:53 a.m.