readDataArcheryWC | R Documentation |
Reads in data from files based on results in the archery World Cup 2013. Several files can be read with one call.
readDataArcheryWC(fPath = ".", fNames, fPat, combine = TRUE)
fPath |
a character string containing the path to the folder with the SIUS 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 |
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.
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
.
read.csv
,
regex
,
glob2rx
,
combineData
,
readDataOT1
,
readDataOT2
,
readDataSMT
,
readDataShotMarker
,
readDataMisc
## Not run:
# folder with output files
fPath <- 'c:/folder/archeryFiles'
fileNam <- c('pts01.txt', 'pts02.txt') # desired files in that folder
DFgroup <- readDataArcheryWC(fPath, fNames=fileNam, combine=TRUE)
## alternatively, specify filename pattern for all files to be read in
fPath <- 'c:/folder/archeryFiles' # folder with data files
fPat <- '^pts[[:digit:]]{2}\\.txt$' # filename pattern
DFgroup <- readDataArcheryWC(fPath, fPat=pattern, combine=TRUE)
## End(Not run)
## result should look like this
data(DFcm)
head(DFcm)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.