View source: R/contour.loca.p.R
| contour.loca.p | R Documentation | 
contour provides a graphical representations of min-sum objective function, which is the weighted sum of the distances to demand points (distsum).
## S3 method for class 'loca.p'
contour(
  x,
  lp = numeric(0),
  xmin = min(min(x@x), xleft),
  xmax = max(max(x@x), xright),
  ymin = min(min(x@y), ybottom),
  ymax = max(max(x@y), ytop),
  n = 100,
  img = NULL,
  xleft = min(x@x),
  ybottom = min(x@y),
  xright = max(x@x),
  ytop = max(x@y),
  ...
)
x | 
 The loca.p object to compute the objective.  | 
lp | 
 If given, then   | 
xmin | 
 The minimum value for x axis.  | 
xmax | 
 The maximum value for x axis.  | 
ymin | 
 The minimum value for y axis.  | 
ymax | 
 The maximum value for y axis.  | 
n | 
 The number of divisions for grid.  | 
img | 
 A raster image to plot on background.  | 
xleft | 
 The left position of the image.  | 
ybottom | 
 The bottom position of the image.  | 
xright | 
 The right position of the image.  | 
ytop | 
 The top position of the image.  | 
... | 
 Other options.  | 
If p<1 then l_p is not a norm, so only p>=1 are valid values.
contour.loca.p plots a contour plot of min-sum function (distsum).
See also orloca-package, plot.loca.p and loca.p.
# A new unweighted loca.p object
loca <- loca.p(x = c(-1, 1, 1, -1), y = c(-1, -1, 1, 1))
# The contour plot of min-sum function for loca (a loca.p object)
contour(loca)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.