readDataOT2(shotGroups)
readDataOT2()所属R语言包:shotGroups
Read data files exported by OnTarget PC v2.10 or OnTarget TDS v3.71
通过在ONTARGET PC 2.10或ONTARGET TDS v3.71导出的数据文件
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Reads in data from files exported by OnTarget PC v2.10 or OnTarget TDS v3.71. Several files can be read with one call.
从导出的在ONTARGET PC 2.10或ONTARGET TDS v3.71中的文件中的数据读取。一些文件可以读一个呼叫。
用法----------Usage----------
readDataOT2(fPath = getwd(), fNames, fPat, combine = FALSE)
参数----------Arguments----------
参数:fPath
a character string containing the path to the folder with the OnTarget PC/TDS output files, e.g. 'c:/folder/otFiles'.
一个字符串包含路径的文件夹与的ONTARGET PC / TDS输出文件,例如: 'c:/folder/otFiles'。
参数: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., '^points[[:digit:]]{2}\\.txt$' for filenames 'points**.txt', where ** are 2 digits. See regex.
一个字符串,其中包含的正则表达式来描述所有的文件名应该被读入。例如,'^points[[:digit:]]{2}\\.txt$'的文件名'points**.txt',其中**2位。见regex。
参数:combine
a logical value indicating whether the data should be combined into one big data frame with combineData.
一个逻辑值,该值指示是否应该合并为一个大的数据框combineData的数据。
Details
详细信息----------Details----------
If fNames is provided, fPat is ignored. <br> <br> If neither fNames nor fPat is provided, and we are in interactive mode under Windows, files can be chosen interactively. <br> <br> This function is basically a wrapper for read.csv. <br> <br> Output files need to be comma-separated files from OnTarget PC v2.10 or OnTarget TDS v3.71: 'Tools -> Export Point Data'. Files 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. <br> <br> For reading in files exported from OnTarget PC v1.10, see readDataOT1. <br> For reading in other tab-delimited text files, see readDataMisc.
如果fNames,fPat被忽略。 <BR> <BR>如果没有fNames也不fPat,我们是在Windows下的互动模式,文件可以选择交互。参考此功能是基本的包装read.csv。参考<BR>输出文件必须是逗号分隔的文件从在ONTARGET PC 2.10或ONTARGET TDS v3.71:“工具” - >“导出”点数据。文件必须完全包含以下变量名的顺序是:Project Title,Group,Ammunition,Distance,Aim X,Aim Y, Center X,Center Y,Point X,Point Y。 <BR> <BR>在ONTARGET PC V1.10导出的文件用于读取,请参阅readDataOT1。 <br>对于在其他制表符分隔的文本文件阅读,请参阅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.
随着combine=FALSE:一个列表的数据框从一个文件读入此列表可以被组合成一个大的数据框由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.
随着combine=TRUE:合并后的数据框从combineData。
参见----------See Also----------
read.csv, regex, glob2rx, combineData, readDataOT1, readDataMisc
read.csv,regex,glob2rx,combineData,readDataOT1,readDataMisc
实例----------Examples----------
## Not run: [#不运行:]
# folder with OnTarget PC v2.10 or OnTarget TDS v3.71 output files[与的ONTARGET PC 2.10或ONTARGET TDS v3.71输出文件的文件夹]
fPath <- 'c:/folder/otFiles'
fileNam <- c('pts01.csv', 'pts02.csv') # desired files in that folder[在该文件夹中所需的文件]
DFlist <- readDataOT2(path, fNames=fileNam, combine=FALSE)
## 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[文件名模式]
DFlist <- readDataOT2(path, fPat=pattern, combine=FALSE)
## End(Not run)[#(不执行)]
## result should look like this[#结果应该是这样的]
data(DFlistInch)
## overview over list[#的概述列表]
sapply(DFlistInch, dim) # number of obs and vars[OB和瓦尔]
str(DFlistInch) # variables in each data frame[每个数据框中的变量]
lapply(DFlistInch, head) # first rows in each data frame[每个数据框中的第一行]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|