Learn R Programming

shotGroups (version 0.1)

groupSpread: Spread measures of a single group of bullet holes

Description

Provides spread measures and their graphical representations for a single group of bullet holes.

Usage

groupSpread(xy, plots = TRUE,
            conversion = 'm2cm', dstTarget = 25)

Arguments

xy
a numerical (n x 2)-matrix with the (x,y)-coordinates of n points (1 row of coordinates per point).
plots
a logical value indicating whether diagrams should be shown.
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. See getMOA.
dstTarget
a numerical value giving the distance to the target in MOA calculation. See getMOA.

Value

  • A list with the results from the numerical analyses and statistical tests.
  • sdXYstandard deviations of x- and y coordinates in original measurement units and MOA.
  • sdXYrobrobust standard deviations of x- and y-coordinates in original measurement units and MOA (MCD algorithm).
  • covXYcovariance matrix of (x,y)-coordinates.
  • covXYrobrobust estimate of covariance matrix of (x,y)-coordinates (MCD algorithm).
  • corXYcorrelation matrix of (x,y)-coordinates.
  • corXYrobrobust estimate of correlation matrix of (x,y)-coordinates (MCD algorithm).
  • meanDistToCtraverage distance from points to their center in original measurement units and MOA.
  • maxPairDistmaximum pairwise distance between points in original measurement units and MOA.
  • groupWidthwidth of minimum bounding in original measurement units and MOA.
  • groupHeightheight of minimum bounding in original measurement units and MOA.
  • minCircleRadradius for the minimum enclosing circle in original measurement units and MOA.

Details

In addition to the numerical results listed below, this function produces the following diagrams:
  • a scatterplot of the (x,y)-coordinates together with group center, circle with average distance to center, and 95\%-confidence ellipse - the latter also based on a robust estimate for the covariance matrix
  • a scatterplot of the (x,y)-coordinates together with the minimum bounding box, minimum enclosing circle, and maximum group spread
  • a histogram for distances to group center including a nonparametric kernel density estimate

See Also

getDistToCtr, getMaxPairDist, getMinBBox, getMinCircle, getMOA, hist, kernel, covMcd,

Examples

Run this code
xy  <- matrix(round(rnorm(200, 0, 5), 2), ncol=2)
res <- groupSpread(xy, conversion='m2cm', dstTarget=25)
names(res)
res$sdXYrob
res$corXY
res$meanDistToCtr
res$maxPairDist

Run the code above in your browser using DataLab