drawGroup {shotGroups} | R Documentation |
Draw a group of bullet holes with additional measures
Description
Draws a group with scaled bullet holes on a target background. Spread measures can be selected individually.
Usage
drawGroup(xy, center = FALSE, xyTopLeft = TRUE,
bb = FALSE, bbMin = FALSE, bbDiag = FALSE,
minCirc = FALSE, minEll = FALSE, maxSpread = FALSE,
meanDist = FALSE, confEll = FALSE,
CEP = FALSE, ringID = FALSE, valueID = TRUE, doRob = FALSE,
level = 0.95, scaled = TRUE, caliber = 9, dstTarget, conversion,
unit = 'unit', alpha = 0.5, target)
## S3 method for class 'data.frame'
drawGroup(xy, center = FALSE, xyTopLeft = TRUE,
bb = FALSE, bbMin = FALSE, bbDiag = FALSE,
minCirc = FALSE, minEll = FALSE,
maxSpread = FALSE, meanDist = FALSE, confEll = FALSE,
CEP = FALSE, ringID = FALSE, valueID = TRUE, doRob = FALSE,
level = 0.95, scaled = TRUE, caliber = 9, dstTarget, conversion,
unit = 'unit', alpha = 0.5, target)
## Default S3 method:
drawGroup(xy, center = FALSE, xyTopLeft = TRUE,
bb = FALSE, bbMin = FALSE, bbDiag = FALSE,
minCirc = FALSE, minEll = FALSE,
maxSpread = FALSE, meanDist = FALSE, confEll = FALSE,
CEP = FALSE, ringID = FALSE, valueID = TRUE, doRob = FALSE,
level = 0.95, scaled = TRUE, caliber = 9, dstTarget, conversion,
unit = 'unit', alpha = 0.5, target)
Arguments
xy |
either a numerical (n x 2)-matrix with the (x,y)-coordinates of n points (1 row of coordinates per point), or a data frame with either the variables |
center |
logical: center groups to mean (0,0) first? If variable |
xyTopLeft |
logical: is the origin of the absolute coordinate system in the top-left corner? This is the default for data exported by OnTarget PC/TDS. If an (n x 2)-matrix is supplied for |
bb |
logical: draw bounding box? |
bbMin |
logical: draw minimum-area bounding box? |
bbDiag |
logical: draw bounding box diagonal? |
minCirc |
logical: draw minimum enclosing circle? |
minEll |
logical: draw minimum enclosing ellipse? |
maxSpread |
logical: draw maximum spread? |
meanDist |
logical: draw circle with mean distance to group center? |
confEll |
logical: draw confidence ellipse with coverage |
CEP |
draw estimate of CEP circle with coverage |
ringID |
logical: identify and display the ring count for each shot? |
valueID |
logical: display numerical values of calculated measures in the diagram? |
doRob |
logical: use robust estimation of group center and confidence ellipse? |
scaled |
logical: draw bullet holes to scale? |
caliber |
a numerical value indicating the bullet diameter in mm. |
level |
a numerical vector giving the coverages of the confidence ellipses and CEPs. |
dstTarget |
a numerical value giving the distance to the target - used in MOA calculation. Acts as override if variable |
conversion |
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates in MOA calculation. Acts as override if variables |
unit |
Measurement unit for the diagram. Defalt |
alpha |
a numerical value in [0,1] which controls the alpha blending for simulated transparency used to draw the bullet holes |
target |
a character string like 'ISSF_100m' indicating the target type to be drawn in the scatterplot. See |
Value
Invisibly returns a list with the following components, all converted to unit
(if they were requested):
xy |
(x,y)-coordinates converted to |
ctr |
(x,y)-offset of group center relative to point of aim in |
bb |
bounding box as returned by |
bbMin |
minimum-area bounding box as returned by |
bbDiag |
length of diagonal of bounding box. |
bbMinDiag |
length of diagonal of minimum-area bounding box. |
minCirc |
minimum enclosing circle as returned by |
minEll |
minimum enclosing ellipse as returned by |
maxPairDist |
maximum pairwise distance between points (center-to-center, = maximum spread). |
meanDist |
mean distance to group center. |
confEll |
confidence ellipse with coverage |
CEP |
Rayleigh estimate for the circular error probable CEP with coverage |
target |
Definition of the selected target in original and converted measurement units. |
ringCount |
Simulated and maximum ring count as returned by |
See Also
getBoundingBox
,
getMinBBox
,
getMinCircle
,
getMinEllipse
,
getMaxPairDist
,
getDistToCtr
,
getConfEll
,
drawBox
,
drawBox2
,
drawCircle
,
drawEllipse
,
targets
,
drawTarget
,
simRingCount
,
covMcd
Examples
# draw group in MOA
dg <- drawGroup(DFcciHV, xyTopLeft=TRUE, bb=TRUE, minCirc=TRUE,
confEll=TRUE, maxSpread=TRUE, caliber=5.56, unit='MOA',
dstTarget=100, conversion='yd2in', target='BDS9')
# mininum enclosing circle in MOA
dg$minCirc
# show Grubbs-Patnaik CEP estimator for mulitple levels
drawGroup(DF300BLKhl, CEP="GrubbsPatnaik", level=c(0.5, 0.9, 0.95),
dstTarget=100, conversion="yd2in", caliber=7.62)