Learn R Programming

shotGroups (version 0.7.1)

getXYmat: Extract (x,y)-coordinates (relative to point of aim) from a data frame

Description

Extracts (x,y)- or (x,y,z)-coordinates of the points of impact (relative to the point of aim) from a data frame and returns them as a matrix.

Usage

getXYmat(DF, xyTopLeft = TRUE, relPOA = TRUE)

Arguments

DF
a data frame containing (at least) either the variables Point.X, Point.Y or X, Y defining the bullet holes. For three-dimensional data, variables Point.Z or Z are recognized. Variables Aim.X, Aim.Y, and for three-dimensional data Point.Z can define the point of aim. If missing, point of aim is assumed to be in the origin 0.
xyTopLeft
logical: is the origin of the absolute coordinate system in the top-left corner? See details.
relPOA
logical: should returned coordinates be relative to the point of aim?

Value

Details

By default, OnTarget PC/TDS' 'Export Point Data' places the origin of the absolute coordinate system in the top-left corner. In OnTarget TDS, this setting can be changed by checking the box 'Tools -> Options -> Options tab -> Data Export -> Invert Y-Axis on Export'. In that case, use xyTopLeft=FALSE. If groups appear to be upside-down, xyTopLeft is the setting to change.

See Also

groupLocation, groupShape, groupSpread

Examples

Run this code
data(DFcm)

# select data from only first series
DFsub <- subset(DFcm, series == 1)
getXYmat(DFsub, xyTopLeft=TRUE, relPOA=TRUE)

Run the code above in your browser using DataLab