Learn R Programming

shotGroups (version 0.7.1)

drawTarget: Draw a target pattern

Description

Draws a target pattern - either from the name of a pre-specified target type or from a supplied list defining the target.

Usage

drawTarget(x, unit = 'cm', dstTarget = 100, conversion = 'm2cm', add = FALSE, cex = par('cex'))

Arguments

x
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 (see below).
unit
the measurement unit that should be used in the plot. Possible values are 'cm', 'mm', 'm', 'in', 'ft', 'yd', 'deg', 'MOA', 'SMOA', 'rad', 'mrad', 'mil'.
dstTarget
a numerical value with the distance to the target - used in MOA calculation. See getMOA.
conversion
how to convert the measurement unit for distance to target to that of the (x,y)-coordinates - used in MOA calculation. See getMOA.
add
logical: add to existing plot or create new plot?
cex
numerical value specifying the magnification factor for plotting the ring numbers.

Value

Invisibly returns a list with (at least) the following components defining the target:
name
target name.
unitTarget
measurement unit for ring diameters and radii.
nRings
number of rings.
maxCount
highest ring count for scoring.
ringD10
diameter of ring number 10 (highest-valued ring).
ringD10i
diameter of sub-division of ring number 10 (Innenzehn). If target has no sub-division, equal to ringD10.
ringW
width of the remaining rings number 9, 8, 7, ...
cols
nRings+1 colors of the rings - right half of the target, starting with the sub-division of ring number 10 and going outwards.
colsTxt
nRings-1 colors of the ring numbers, starting with ring number 9 and going outwards.
ringR
nRings+1 ring radii, including sub-division of ring number 10.
unitConv
measurement unit for ringD10u, ringD10iu, ringWu, ringRu as defined by unit.
ringD10u
diameter of ring number 10 converted to unit.
ringD10iu
diameter of sub-division of ring number 10 (Innenzehn) converted to unit.
ringWu
width of the remaining rings number 9, 8, 7, ... converted to unit.
ringRu
nRings+1 ring radii, including sub-division of ring number 10, converted to unit.

See Also

targets, drawGroup

Examples

Run this code
# draw ISSF 300m target in inch
trgt <- drawTarget('ISSF_300m', unit='in')

# target definition
trgt

Run the code above in your browser using DataLab