Skip to content

Commit 0188a09

Browse files
add more documentation (plotting)
1 parent aa04dcc commit 0188a09

File tree

4 files changed

+61
-0
lines changed

4 files changed

+61
-0
lines changed

R/autoplot.R

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
#' Create ggplot for a CVRP solution
2+
#'
3+
#' The individual runs are distinguished by color.
4+
#' The demanding site locations are marked with round circles while the
5+
#' (single) supplying site is depicted as a square.
6+
#' The line types (solid/dashed/...) are associated to different vehicle types.
7+
#'
8+
#' @param object
9+
#' A "`heumilkr_solution`" object, typically obtained by [clarke_wright()].
10+
#'
11+
#' @param ... Not used.
12+
#'
13+
#' @return A ggplot object.
14+
#'
115
#' @importFrom ggplot2 autoplot ggplot aes geom_point geom_path
216
#' scale_color_discrete
317
#' scale_shape_identity
@@ -32,6 +46,12 @@ autoplot.heumilkr_solution <- function(object, ...) {
3246
theme(legend.position = "none")
3347
}
3448

49+
#' Plot a CVRP solution
50+
#'
51+
#' @param x
52+
#' A "`heumilkr_solution`" object, typically obtained by [clarke_wright()].
53+
#' @inheritParams autoplot.heumilkr_solution
54+
#'
3555
#' @importFrom graphics plot
3656
#' @export
3757
plot.heumilkr_solution <- function(x, ...) {

_pkgdown.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ reference:
88
input or to CVRPLIB instance data
99
contents:
1010
- starts_with("clarke_wright")
11+
- title: "Plotting"
12+
- autoplot.heumilkr_solution
13+
- plot.heumilkr_solution
1114
- title: "Costs and Savings"
1215
desc: >
1316
Helper functions to retrieve costs as well as savings from CVRP solutions

man/autoplot.heumilkr_solution.Rd

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/plot.heumilkr_solution.Rd

Lines changed: 16 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)