Learn R Programming

shotGroups (version 0.6.2)

simRingCount: 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, target, caliber, unit = 'cm')

## S3 method for class 'data.frame':
simRingCount(xy, target, caliber, unit = 'cm')

## S3 method for class 'default':
simRingCount(xy, 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 X, Y or Point.X, Point.Y as well as Aim.X
target
either a character value with the name of a target in targets or a list with a target definition containing the same components as those in targets<
caliber
a numerical value indicating the bullet diameter in mm.
unit
measurement unit of the (x,y)-coordinates in xy. Possible values are 'cm', 'mm', 'm', 'in', 'ft', 'yd'.

Value

  • A list with the following components:
  • countthe total ring count.
  • maxthe maximum ring count achievable with the given number of shots.
  • ringsthe individual ring count for each shot.

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.

See Also

targets, getDistToCtr

Examples

Run this code
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)))

Run the code above in your browser using DataLab