read.tfl(zipfR)
read.tfl()所属R语言包:zipfR
Loading and Saving Type Frequency Lists (zipfR)
载入和保存频率列表(zipfR)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
read.tfl loads type frequency list from .tfl file
read.tfl负载类型频率.tfl文件列表
write.tfl saves type frequency list object in .tfl file
write.tfl节约型频率.tfl文件列表对象中
用法----------Usage----------
read.tfl(file)
write.tfl(tfl, file)
参数----------Arguments----------
参数:file
character string specifying the pathname of a disk file. Files with extension .gz will automatically be compressed/decompressed. See section "Format" for a description of the required file format
字符串指定的磁盘文件的路径名。文件与扩展.gz将自动压缩/解压缩。为所需的文件格式的描述,请参见“格式”
参数:tfl
a type frequency list, i.e.\ an object of class tfl
类型频率“列表中,例如\类的一个对象tfl
格式----------Format----------
A TAB-delimited text file with column headers but no row names (suitable for reading with read.delim), containing the following columns:
制表符分隔的文本文件,列标题,但没有行名称(适用于阅读与read.delim),包含以下几列:
f type frequencies f_k
f型频率f_k
k optional: the corresponding type IDs k. If missing, increasing non-negative integers are automatically
k可选:相应的类型ID k。如果缺少,增加非负整数是自动
type optional: type representations (such as word
type可选:类型表示(如文字
These columns may appear in any order in the text file. Only the f column is mandatory and all unrecognized columns will be silently ignored.
这些列中可能出现的任何命令的文本文件。只有f列是强制性的,所有无法识别的列会被忽略。
Details
详细信息----------Details----------
If the filename file ends in the extension .gz, the disk file will automatically be decompressed (read.tfl) and compressed (write.tfl).
如果文件名file结束在延长.gz,磁盘文件会自动解压缩(read.tfl)和压缩(write.tfl)。
The .tfl file format stores neither the values of N and V nor the range of type frequencies explicitly. Therefore, incomplete type frequency lists cannot be fully reconstructed from disk files (and will not even be recognized as such). An attempt to save such a list will trigger a corresponding warning.
.tfl文件格式存储既不N和V也没有明确的类型频率范围的值。因此,不完全类型的频率列表不能完全从磁盘文件(而且也不会承认的)重建。试图保存这样的列表将触发相应的警告。
值----------Value----------
read.tfl returns an object of class tfl (see the tfl manpage for details)
read.tfl返回一个对象类tfl(tfl联机帮助的详细信息)
参见----------See Also----------
See the tfl manpage for details on tfl objects. See read.spc and read.vgc for import/export of other data structures.
tfl对象的详细信息,请参阅“tfl的联机帮助页。见read.spc和read.vgc的其他数据结构的导入/导出的。
实例----------Examples----------
## Not run: [#不运行:]
## examples will not be run during package compilation[#示例将不会运行在包编译]
## since they would require accessing and writing to[#,因为他们需要访问和写入]
## external files[#外部文件]
## load Brown tfl and write it to external file[#加载布朗TFL,并将其写入到外部文件]
data(Brown.tfl)
write.tfl(Brown.tfl,"brown.tfl")
## now brown.tfl is external file with fields[现在brown.tfl是外部文件中的字段]
## k (an id), f (frequency), type (word)[#K(ID),f(频率),类型(字)]
## read it back in[#回读]
New.tfl <- read.tfl("brown.tfl")
## same as Brown.tfl[#作为Brown.tfl相同]
summary(New.tfl)
summary(Brown.tfl)
print(New.tfl)
print(Brown.tfl)
head(New.tfl)
head(Brown.tfl)
## suppose you have a text file with a[#假设你有一个文本文件,]
## frequency list, one f per line, e.g.:[#频率列表,每行一个F,例如:]
## f[#F]
## 14[#14]
## 12[#12]
## 31[#31]
## ...[#...]
## you can import this with read.tfl[#你可以导入此read.tfl]
MyData.tfl <- read.tfl("mylist.txt")
summary(MyData.tfl)
print(MyData.tfl) # ids in column k added by zipfR[k列的ID添加zipfR]
## from this you can generate a spectrum with tfl2spc[#从此可以产生一个频谱与tfl2spc]
MyData.spc <- tfl2spc(MyData.tfl)
summary(MyData.spc)
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|