Learn R Programming

movecost (version 3.0.0)

plot.movecost_comp: Plot a cost-function comparison

Description

Returns a ggplot object showing either the least-cost paths produced by the compared cost functions, colour-coded by function (type = "paths", default), or a chart comparing the path length and the accumulated cost across functions (type = "chart").

Usage

# S3 method for movecost_comp
plot(x, type = c("paths", "chart"), transp = 0.5, ...)

Value

A ggplot object (draw it by printing; customise it with +).

Arguments

x

a movecost_comp object.

type

"paths" (default) or "chart".

transp

transparency of the slope-shade overlay (0.5 by default).

...

unused.

Details

For the chart, when several destinations are compared (three or more) the panels are boxplots showing, for each cost function, the distribution across destinations of the path length and of the cost, reproducing the add.chart output of movecost <= 2.x's movecomp(). With fewer than three destinations a boxplot would be degenerate, so bars are drawn instead. The cost panel is split by cost unit, so cost is only ever compared between functions that share a unit (length, in metres, is always directly comparable). When the comparison was computed with return.base = TRUE, the outward and the return paths are shown in separate rows ("outward" and "return"), as movecost <= 2.x did with a separate set of boxplots for the paths back to the origin.

See Also

mc_comp