lines.density.circular: Add a Plot for Kernel Density Estimation for Circular Data

Description Usage Arguments Value Author(s) See Also Examples

View source: R/density.circular.R

Description

The lines add a plot for density.circular objects.

Usage

1
2
3
4
5
6
## S3 method for class 'density.circular'
lines(x, type = "l", zero.line = TRUE,
  points.plot = FALSE, points.col = 1, points.pch = 1, points.cex = 1,
  plot.type = c("circle", "line"), bins = NULL, offset=1, shrink = 1,
  tcl = 0.025, sep = 0.025, join = TRUE, nosort = FALSE,
  plot.info = NULL, zero = NULL, rotation = NULL, ...)

Arguments

x

an object of class density.circular.

type

plotting parameter with useful default.

zero.line

logical; if TRUE, add a base line at y = 0. Used when plot.type is "line".

points.plot

logical; if TRUE original data are added to the plot.

points.col, points.pch, points.cex

parameters used to draw the points.

plot.type

type of the plot.

bins

number of ticks to plot.

offset

the radius of the circle

shrink

parameter that controls the size of the plotted function. Default is 1.

tcl

length of the ticks.

sep

constant used to specify the distance between stacked points. Default is 0.025; smaller values will create smaller spaces.

join

logical: should the first and the last point joined.

nosort

logical: should the data sort before plotting. Defaults is to sort.

plot.info

an object from plot.circular that contains information on the zero, the rotation and next.points.

zero

the zero of the plot. Ignored if plot.info is provided.

rotation

the rotation of the plot. Ignored if plot.info is provided.

...

futher parameters passed to lines.default.

Value

A list with information on the plot: zero, rotation and next.points and, if available, the coordinates x and y.

Author(s)

Claudio Agostinelli

See Also

density.circular and plot.density.circular

Examples

1
2
3
4
5
6
7
set.seed(1234)
x <- rvonmises(n=100, mu=circular(pi), kappa=2)
y <- rvonmises(n=100, mu=circular(pi/2), kappa=2)
resx <- density(x, bw=25)
res <- plot(resx, points.plot=TRUE, xlim=c(-1.5,1), ylim=c(-1.1, 1.5))
resy <- density(y, bw=25)
lines(resy, points.plot=TRUE, col=2, points.col=2, plot.info=res)

Example output

Attaching package: 'circular'

The following objects are masked from 'package:stats':

    sd, var

circular documentation built on May 1, 2019, 7:57 p.m.