readDataOT1 {shotGroups} | R Documentation |
Read data files exported by OnTarget PC v1.1*
Description
Reads in data from files exported by OnTarget PC v1.1*. Several files can be read with one call.
Usage
readDataOT1(fPath = ".", fNames, fPat, combine = TRUE,
dstTarget, conversion)
Arguments
fPath |
a character string containing the path to the folder with the OnTarget PC output files. E.g., |
fNames |
a character vector containing the file names of the files that should be read in. |
fPat |
a character string containing the regular-expression that describes all names of files that should be read in. E.g., |
combine |
logical: combine the data into one big data frame with |
dstTarget |
a numerical value/vector 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. Example |
Details
If fNames
is provided, fPat
is ignored.
If neither fNames
nor fPat
is provided, and we are in interactive mode under Windows, files can be chosen interactively.
This function is basically a wrapper for read.delim
.
Output files need to be tab-delimited files from OnTarget PC v1.1*: 'Tools -> Export Point Data'. Files need a trailing tab in each row, and need to contain exactly the following variable names in this order: Project Title
, Group
, Ammunition
, Distance
, Aim X
, Aim Y
, Center X
, Center Y
, Point X
, Point Y
.
Tested with OnTarget PC v1.10.
For reading in files exported from OnTarget PC v2.* or OnTarget TDS v3.*, see readDataOT2
.
For reading in other text files, see readDataMisc
.
Value
With combine=FALSE
: a list of data frames, each from one file that was read in. This list can then be combined into one big data frame by combineData
.
file1 |
data frame containing data from the first file |
file2 |
data frame containing data from the second file |
... |
more data frames |
With combine=TRUE
: a combined data frame from combineData
.
See Also
read.delim
,
regex
,
glob2rx
,
combineData
,
readDataOT2
,
readDataSMT
,
readDataShotMarker
,
readDataMisc
Examples
## Not run:
# folder with OnTarget PC v1.1* output files
fPath <- 'c:/folder/otFiles'
fileNam <- c('pts01.txt', 'pts02.txt') # desired files in that folder
DFgroup <- readDataOT1(fPath, fNames=fileNam)
## alternatively, specify filename pattern for all files to be read in
fPath <- 'c:/folder/otFiles' # folder with data files
fPat <- '^pts[[:digit:]]{2}\\.txt$' # filename pattern
DFgroup <- readDataOT1(fPath, fPat=pattern)
## End(Not run)
## result should look like this
data(DFcm)
head(DFcm)