read.SeerStat(SEER2R)
read.SeerStat()所属R语言包:SEER2R
read from SEER*STAT export files
从SEER *的STAT出口文件读取
译者:生物统计家园网 机器人LoveR
描述----------Description----------
SEER*STAT presents results in matrix session and users can export results into data file (either in plain text format or gz format) and dictionary information into dic file. read.SeerStat reads data and dictionary information from SEER*STAT export files.
SEER * STAT在矩阵会议的结果,用户可以导出到数据文件(纯文本格式或gz的格式)到dic文件和字典信息的结果。 read.SeerStat读取SEER * STAT导出文件的数据字典信息。
用法----------Usage----------
read.SeerStat(DICfileName, TXTfileName = NULL, UseVarLabelsInData = FALSE,ReadHeaderOnly=FALSE,...)
参数----------Arguments----------
参数:DICfileName
: filename of the dic file. The default extention is 'dic'. If 'DICfileName' does not contain at the end a string '.dic' (letter case does not matter), then '.dic' will be added.
:dic文件的文件名。默认的延伸,是“DIC。如果DICfileName不包含在一个字符串的结束。“DIC”(字母大小写无所谓),然后是“DIC”将被添加。
参数:TXTfileName
: filename of the associated data file. If TXTfileName = NULL, then a string of DICfileName with extention substituted by 'txt' (for uncompressed data file) or 'gz' (for gzip compressed data file) will be used (whether 'txt' or 'gz' depends on information in the dic file).
:文件名相关联的数据文件。如果TXTfileName = NULL,则txt的(未压缩的数据文件)或“gz的(gzip压缩数据文件)的取代的与延伸的DICfileName字符串将使用(txt文件或gz的是否依赖于信息的dic文件)。
参数:UseVarLabelsInData
: a logic value. If true, then variable labels read from the dic file will replace associated numeric values in the data.frame object, which stores data from the associated data file and is returned by this function read.SeerStat. If false, then data read from the associated data file won't be changed.
:一个逻辑值。如果为true,然后从dic文件中读取的变量标签将取代相关的数值数据框对象,从关联的数据文件中的数据存储和返回此功能read.SeerStat。如果为false,然后从关联的数据文件中读取的数据将不会被改变。
参数:ReadHeaderOnly
: a logic value. If true, then only the list storing the information read from the dic file will be returned. Otherwise, A data frame object containing a representation of the data in the associated data file will be returned.
:一个逻辑值。如果为true,那么只有从dic文件中读取列表中存储的信息将被退回。否则,A的数据框的对象,它包含一个表示相关的数据文件中的数据将被退回。
参数:...
: Arguments to be passed to read.table for reading from the associated data file.
:参数要传递给read.table读取相关的数据文件。
Details
详细信息----------Details----------
“read.SeerStat” reads data from a SEER*Stat data file into an object of data.frame in R and stores information from the associated dictionary file in an attribute variable (named “DICInfo”) of the data.frame object. The variables of the SEER*Stat data file are stored in columns of the data.frame object. The column names of the data.frame object are based on the variable names in the associated SEER*Stat dic file, with special characters “,)<>={}!@#$ to a single "_". For example, the column name will be “Example_Variable_1” if the variable name in the SEER*Stat dic file is “Example* (Variable 1)”.
“read.SeerStat”从SEER * Stat的数据文件中读取数据,在R和信息存储从相关联的词典文件中的数据框对象的属性变量(名为“DICInfo”)到一个对象的数据框。 SEER统计数据文件的变量都存储在列中的数据框对象。列名的基础上的数据框对象中的变量名相关联的SEER *统计dic文件,有特殊字符“,:()<> = {}!@#$到一个单一的_ ;例如,列的名称将是“Example_Variable_1”如果在SEER统计dic文件的变量名是“示例*(变量1)”。
值----------Value----------
A data frame (data.frame) containing a representation of the data in the associated data file and having three attributes ('DICInfo': a list storing dictionary information read from the dic file; 'assignColNames': a function that assigns new names (they are substrings of names of those columns that will be replaced) to asscociated columns of a data.frame object; 'getSubDataByVarName': a function that extracts columns of a data.frame object given substrings of names of columns that will be extracted ).
包含的表示相关联的数据文件中的数据,并具有三个属性(DICInfo:一种数据框(数据框)存储字典信息的读取的列表从dic文件;assignColNames:一个函数,分配新的名称(他们是substring这些列的名字将被替换)的数据框对象asscociated列;的“getSubDataByVarName”:一个函数,提取列的数据框对象的子字符串将被提取的列的名称)。
or
或
a list storing dictionary information read from the dic file if ReadHeaderOnly is true
从dic文件中读取存储的数据字典如果ReadHeaderOnly是真实的,一个列表
(作者)----------Author(s)----------
Jun Luo
Maintainer: Jun Luo <rpackages@gmail.com>
参考文献----------References----------
参见----------See Also----------
write.SeerStat, SEER2R
write.SeerStat,SEER2R
实例----------Examples----------
#load testing data: there are three data objects, i.e. SEER2RTestData1,SEER2RTestData2,SEER2RTestData3 [负载测试数据:数据对象有三个,即SEER2RTestData1,SEER2RTestData2,SEER2RTestData3]
data("SEER2RTestdata");
#create one SEER*STAT export dic and the associated text data file for testing purpose[创建一个SEER * STAT出口DIC和相关的文本数据文件,用于测试目的,]
dicinfoused = write.SeerStat(SEER2RTestData2, DICfileName = "testrun1.dic",UseVarLabelsInTxtFile=FALSE);
#usage of read.SeerStat[使用的read.SeerStat的]
mydata = read.SeerStat("testrun1.dic",UseVarLabelsInData=FALSE);
#get informatin inside the dic file[dic文件内得到informatin]
DICInfo = attr(mydata, "DICInfo");
#change names of columns whose names contains strings "site" or "sex"; [更改名称的列,其名称中包含字符串“网站”或“性”;]
#the order of strings does not matter[的字符串的顺序并不重要]
testdatanewnames = attr(mydata,"assignColNames")(mydata,c("sex","site"));
#extract columns whose names contains strings "site" or "sex";[提取列,其名称中包含字符串“网站”或“性”;]
testdata = attr(mydata,"getSubDataByVarName")(mydata,c("site","sex"));
#usage of write.SeerStat[使用的write.SeerStat的]
dicinfoused = write.SeerStat(mydata, DICfileName = "testrun2.dic", UseVarLabelsInTxtFile = FALSE);
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|