read.multiple.objects(zipfR)
read.multiple.objects()所属R语言包:zipfR
Reading Multiple Objects from Files (zipfR)
从文件中读取多个对象(zipfR)
译者:生物统计家园网 机器人LoveR
描述----------Description----------
read.multiple.objects constructs a list of spc, vgc or tfl objects from a set of input text files in the specified directory
read.multiple.objects构建了一个列表spc,vgc或tfl对象从指定目录中的一组输入文本文件
NB: This function is intended for users that want to run advanced experiments (e.g., handling hundreds of spectra generated in multiple randomizations experiments). For the standard one-object-at-a-time reading functionality, look at the documentation of read.spc, read.vgc and read.tfl
注:此功能是用户要运行先进的实验(例如,处理数百个光谱中生成多个随机化实验)。对于标准的一个对象在一个时间阅读功能,看的文档read.spc,read.vgc和read.tfl
用法----------Usage----------
read.multiple.objects(directory, prefix, class=c("spc", "vgc", "tfl"))
参数----------Arguments----------
参数:directory
character string specifying the directory where the target input files reside (absolute path, or path relative to current working directory)
字符串指定输入目标文件所在的目录(绝对路径或相对路径是当前工作目录)
参数:prefix
character string specifying prefix that must be shared by all target input file names
字符串指定前缀必须共享所有目标输入文件名
参数:class
one of spc, vgc or tfl as character string, specifying the class of object we are importing (see the manpages of spc, vgc and tfl for details)
spc,vgc或tfl字符串,指定类的对象,我们要导入(请参阅联机帮助页spc,vgc和tfl有关详细信息)
格式----------Format----------
read.multiple.objects reads in all files matching the pattern prefix.id.class from the specified directory, where the prefix and class strings are passed as arguments, and id is an arbitrary string that is used as index of the corresponding object in the output list
read.multiple.objects读取模式匹配的所有文件prefix.id.class指定的目录,其中prefix和class的字符串作为参数传递和id是一个任意的字符串,用于在输出列表中的相应的对象作为索引
read.multiple.objects calls the read function corresponding to the class argument. Thus, the input files must respect the formatting conventions of the relevant reading functions (see documentation of read.spc, read.vgc and read.tfl)
read.multiple.objectsread函数调用相应的class参数。因此,输入文件的格式必须尊重公约的相关阅读功能(请参阅文档read.spc,read.vgc和read.tfl)
值----------Value----------
read.multiple.objects returns a list of objects of the specified class; each object is indexed with the id extracted from the corresponding file name (see section "Format")
read.multiple.objects返回一个列表索引指定的类的对象,每个对象的id提取相应的文件名(请参阅“格式”部分)
参见----------See Also----------
See the spc, vgc and tfl manpages for details on the corresponding objects; read.spc, read.vgc and read.tfl for the single-file reading functions and input format details
参考spc,vgc和tfl联机帮助页对相应的对象的详细资料; read.spc,read.vgc和read.tfl单文件阅读功能和输入格式的详细信息
实例----------Examples----------
## Not run: [#不运行:]
## examples will not be run during package compilation[#示例将不会运行在包编译]
## since they would require accessing external files[#,因为他们需要访问外部文件]
## suppose that the current working directory contains[#假设当前的工作目录中包含]
## 100 spc files named: rand.1.spc, rand.2.spc, ...,[#100 SPC文件名为:rand.1.spc,rand.2.spc,...,]
## rand.100.spc[#rand.100.spc]
## read the files in:[#读取文件中:]
spc.list <- read.multiple.objects(".","rand","spc")
## you can access each spc using the id extracted from[#你可以访问每个SPC提取的id]
## the file name, e.g.:[#文件名,例如:]
summary(spc.list[["1"]])
## more usefully, you might want to iterate over the[#更有效地,你可能要遍历]
## whole list, e.g., to calculate mean V:[#整个列表,例如,计算平均V:]
mean(sapply(spc.list,V))
## notice that ids are arbitrary strings[#请注意,ID是任意的字符串]
## e.g., suppose that directory /home/me/animals[#例如,假设目录/ home /我/动物]
## contains sounds.dog.vgc and sounds.elephant.vgc[#包含sounds.dog.vgc sounds.elephant.vgc]
## we read the vgcs in:[#中,我们读出的VGCS在:]
vgc.list <- read.multiple.objects("/home/me/animals","sounds","vgc")
## accessing the elephant vgc:[#大象VGC:]
V(vgc.list[["elephant"]])
## of course, tfl-reading works in the same way (assuming[#当然,TFL读工程中的相同的方式(假设]
## that the animals directory also contains some tfl files):[#,动物目录也包含了一些TFL文件):]
tfl.list <- read.multiple.objects("/home/me/animals","sounds","tfl")
## End(Not run)[#(不执行)]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|