NcdfReader(GWASTools)
NcdfReader()所属R语言包:GWASTools
Class NcdfReader
类NcdfReader
译者:生物统计家园网 机器人LoveR
描述----------Description----------
The NcdfReader class is a wrapper for the ncdf library that provides an interface for reading NetCDF files.
NcdfReader类是ncdf库,它提供了一个NetCDF文件阅读界面的包装。
构造----------Constructor----------
NcdfReader(filename):
NcdfReader(filename):
filename must be the path to a NetCDF file.
filename必须是一个netCDF文件的路径。
The NcdfReader constructor creates and returns a NcdfReader instance pointing to this file.
NcdfReader构造创建并返回一个指向该文件的NcdfReader实例。
存取----------Accessors----------
In the code snippets below, object is a NcdfReader object.
在下面的代码片段,object是NcdfReader的对象。
getVariable(object, varname, start, count): Returns the contents of the variable varname.
getVariable(object, varname, start, count):返回变量varname内容。
start is a vector of integers indicating where to start reading values. The length of this vector must equal the number of dimensions the variable has. If not specified, reading starts at the beginning of the file (1,1,...).
start是一个指示开始读值的整数向量。这个向量的长度必须等于尺寸变量的数目。如果没有指定,阅读开始在该文件的开头(1,1,...)。
count is a vector of integers indicating the count of values to read along each dimension. The length of this vector must equal the number of dimensions the variable has. If not specified and the variable does NOT have an unlimited dimension, the entire variable is read. As a special case, the value "-1" indicates that all entries along that dimension should be read.
count是一个整数表示计数的值读沿着每个维度的向量。这个向量的长度必须等于尺寸变量的数目。如果没有指定变量不会有无限维度,整个变量被读取。作为一个特例,“-1”的值表示沿着该维度的所有参赛作品应读。
The result is a vector, matrix, or array, depending on the number of dimensions in the returned values. Missing values are represented as NA. If the variable is not found in the NetCDF file, returns NULL.
结果是一个向量,矩阵,或阵列,根据返回值的尺寸。遗漏值表示为NA。如果变量没有被发现在netCDF文件,返回NULL。
getVariableNames(object): Returns names of variables in the NetCDF file.
getVariableNames(object):返回netCDF文件中的变量的名称。
getDimensionNames(object, varname): Returns names of dimensions in the NetCDF file. If varname is provided, returns dimension names for NetCDF variable varname.
getDimensionNames(object, varname):返回尺寸netCDF文件的名称。如果varname提供,NetCDF变量varname返回维度名称。
getAttribute(object, attname, varname): Returns the attribute attname associated with the variable varname. If varname is not specified, attname is assumed to be a global attribute.
getAttribute(object, attname, varname):返回属性attname变量varname相关。 varname如果不指定attname被认为是一个全球性的属性。
hasCoordVariable(object, varname): Returns TRUE if varname is a coordinate variable (a variable with the same name as a dimension).
hasCoordVariable(object, varname):返回TRUE如果varname是一个坐标变量(与相同的名称作为一个维度的变量)。
hasVariable(object, varname): Returns TRUE if varname is a variable in the NetCDF file (including coordinate variables).
hasVariable(object, varname):返回TRUE如果varname是在netCDF文件(包括坐标变量)的变量。
open(object): Opens a connection to the NetCDF file.
open(object):打开一个netCDF文件的连接。
close(object): Closes the NetCDF file connection.
close(object):关闭netCDF文件连接。
标准通用方法----------Standard Generic Methods----------
In the code snippets below, object is a NcdfReader object.
在下面的代码片段,object是NcdfReader的对象。
open(object): Opens a connection to a NetCDF file.
open(object):打开一个连接到一个NetCDF文件。
close(object): Closes the connection to a NetCDF file.
close(object):关闭一个netCDF文件的连接。
作者(S)----------Author(s)----------
Stephanie Gogarten
参见----------See Also----------
ncdf, NcdfGenotypeReader, NcdfIntensityReader
ncdf,NcdfGenotypeReader,NcdfIntensityReader
举例----------Examples----------
file <- system.file("extdata", "affy_geno.nc", package="GWASdata")
nc <- NcdfReader(file)
getDimensionNames(nc)
getVariableNames(nc)
hasVariable(nc, "genotype")
geno <- getVariable(nc, "genotype", start=c(1,1), count=c(10,10))
close(nc)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|