找回密码
 注册
查看: 886|回复: 0

R语言 TargetSearch包 tsSample-class()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-26 15:25:19 | 显示全部楼层 |阅读模式
tsSample-class(TargetSearch)
tsSample-class()所属R语言包:TargetSearch

                                        Class for representing samples
                                         类为代表样本

                                         译者:生物统计家园网 机器人LoveR

描述----------Description----------

This is a class to represent a set of samples.
这是一个类来表示一组样品。


类的对象----------Objects from the Class----------

Objects can be created by the function ImportSamples or by calling the object generator function.
对象可以创建功能ImportSamples或通过调用对象发生器功能。

new("tsSample", Names = [sample names], CDFfiles = [list of CDF file names],      RIfiles = [list of RI file names], CDFpath = [CDF files path],                  RIpath = [RI files path], days = [measurement days],                  data = [additional sample information])
new("tsSample", Names = [sample names], CDFfiles = [list of CDF file names],      RIfiles = [list of RI file names], CDFpath = [CDF files path],                  RIpath = [RI files path], days = [measurement days],                  data = [additional sample information])


插槽----------Slots----------




Names: "character", the sample names.
Names:"character",样品名称。




CDFfiles: "character", the list of CDF file names.
CDFfiles:"character",CDF文件名列表。




RIfiles: "character", the list of RI file names.
RIfiles:"character",RI文件名列表。




CDFpath: "character", CDF files path.
CDFpath:"character",CDF文件的路径。




RIpath: "character", RI file path.
RIpath:"character",RI文件的路径。




days: "character", measurement days.
days:"character",测量天。




data: "data.frame", additional sample information.
data:"data.frame",额外的样品信息。


方法----------Methods----------




[ signature(x = "tsSample"): Selects a subset of samples.
[signature(x = "tsSample"):选择样本的一个子集。




$name signature(x = "tsSample"): Access column name of sampleData slot.
$namesignature(x = "tsSample"):访问列namesampleData插槽。




CDFfiles signature(obj = "tsSample"): list of CDF files.
CDFfilessignature(obj = "tsSample"):CDF文件的列表。




RIfiles signature(obj = "tsSample"): list of RI files.
RIfilessignature(obj = "tsSample"):RI的文件列表。




RIpath signature(obj = "tsSample"): The RI file path.
RIpathsignature(obj = "tsSample"):RI文件路径。




CDFpath signature(obj = "tsSample"): The CDF file path.
CDFpathsignature(obj = "tsSample"):CDF文件的路径。




length signature(x = "tsSample"): number of samples.
lengthsignature(x = "tsSample"):样本数量。




sampleData signature(obj = "tsSample"): additional sample information.
sampleDatasignature(obj = "tsSample"):额外的样品信息。




sampleDays signature(obj = "tsSample"): measurement days.
sampleDayssignature(obj = "tsSample"):测天。




sampleNames signature(obj = "tsSample"): sample names.
sampleNamessignature(obj = "tsSample"):样本名。




show signature(object = "tsSample"): the show funtion.
showsignature(object = "tsSample"):秀funtion。


作者(S)----------Author(s)----------


Alvaro Cuadros-Inostroza, Matthew Hannah, Henning Redestig



参见----------See Also----------

ImportSamples
ImportSamples


举例----------Examples----------


showClass("tsSample")

# get a list of CDF files from a directory[CDF文件从一个目录列表]
require(TargetSearchData)
CDFpath <- system.file("gc-ms-data", package = "TargetSearchData")
cdffiles <- dir(CDFpath, "cdf")

# define the RI file path [定义RI文件路径]
RIpath  <- "."

# create the sample object[创建样本对象]
sampleDescription <- new("tsSample", CDFfiles = cdffiles, CDFpath = CDFpath, RIpath = RIpath)

##[#]

# More parameters could be defined:[可以定义多个参数:]
# define the RI files and the RI path[定义RI文件和RI路径]
RIfiles <- sub("cdf$", "txt", paste("RI_", cdffiles, sep = ""))
RIpath  <- "."

# get the measurement days (the four first numbers of the cdf files, in this[测量天(CDF文件,在这四个第一的数字,]
# example)[例如)]
days <- substring(cdffiles, 1, 4)

# sample names [样品名称]
smp_names <- sub(".cdf", "", cdffiles, fixed = TRUE)

# add some sample info[添加一些样品信息]
smp_data <- data.frame(CDF_FILE =cdffiles, GROUP = gl(5,3))

# create the sample object[创建样本对象]
sampleDescription <- new("tsSample", Names = smp_names, CDFfiles = cdffiles, CDFpath = CDFpath,
    RIpath = RIpath, days = days, RIfiles = RIfiles, data = smp_data)

# changing the sample names[改变样品名称]
sampleNames(sampleDescription) <- paste("Sample", 1:length(sampleDescription), sep = "_")

# changing the file paths (relative to the working path)[改变文件路径(相对工作路径)]
CDFpath(sampleDescription) <- "my_cdfs/"
RIpath(sampleDescription)  <- "my_RIs/"


转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。


注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|小黑屋|生物统计家园 网站价格

GMT+8, 2025-1-23 06:09 , Processed in 0.021155 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表