simRingCount {shotGroups} | R Documentation |
Calculate simulated ring count for a given group and target
Description
Calculates the simulated ring count given a group, bullet diameter, and target type.
Usage
simRingCount(xy, center = FALSE, target, caliber, unit = 'cm')
## S3 method for class 'data.frame'
simRingCount(xy, center = FALSE, target, caliber, unit = 'cm')
## Default S3 method:
simRingCount(xy, center = FALSE, target, caliber, unit='cm')
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 |
target |
either a character value with the name of a target in |
caliber |
a numerical value indicating the bullet diameter in mm. |
unit |
measurement unit of the (x,y)-coordinates in |
Details
The returned ring count assumes that bullet holes exactly have the diameter given by caliber
, and that rings exactly have the diameter/width given in the definition of target
. The count thus ignores the possibility of ragged bullet holes as well as the physical width of the ring markings. The simulated ring count therefore need not be equal to the calculated ring count from the corresponding physical target.
Value
A list with the following components:
count |
the total ring count. |
max |
the maximum ring count achievable with the given number of shots. |
rings |
the individual ring count for each shot. |
See Also
Examples
simRingCount(DFscar17, target='ISSF_100m', caliber=5.56, unit='in')
# ring count for all groups in DFcm data set
rc <- by(DFcm, DFcm$series, FUN=simRingCount, target='BDS9',
caliber=9, unit='cm')
sapply(rc, function(x) with(x, c(count=count, max=max)))