map.path: Map path along an ordered variable

View source: R/functions_plot.r

map.pathR Documentation

Map path along an ordered variable

Description

Plot a path along an ordered variable. If the variable is numerical it is cut into groups by the min_cut function.

Usage

map.path(
  object,
  x,
  map = map.ind(object, dim),
  dim = c(1, 2),
  label = TRUE,
  min.size = length(x)/10,
  ...
)

Arguments

object

is a soc.ca result object

x

is an ordered vector, either numerical or factor

map

is a plot object created with one of the mapping functions in the soc.ca package

dim

the dimensions in the order they are to be plotted. The first number defines the horizontal axis and the second number defines the vertical axis.

label

if TRUE the label of the points are shown

min.size

is the minimum size given to the groups of a numerical variable, see min_cut.

...

further arguments are passed onto geom_path, geom_point and geom_text from the ggplot2 package

Examples

example(soc.ca)
map <- map.ind(result, point.color = as.numeric(sup$Age))
map <- map + scale_color_continuous(high = "red", low = "yellow")
map.path(result, sup$Age, map)

Rsoc/soc.ca documentation built on March 7, 2024, 8:59 p.m.