compress.default(wavethresh)
compress.default()所属R语言包:wavethresh
Do "zero" run-length encoding compression of a vector of numbers.
做“零”的游程长度编码压缩的数字向量。
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Efficiently compress a vector containing many zeroes.
有效地压缩一个向量,包含许多零。
用法----------Usage----------
## Default S3 method:[默认方法]
compress(v, verbose=FALSE,...)
参数----------Arguments----------
参数:v
The vector that you wish to compress. This compression function is efficient at compressing vectors with many zeroes, but is not a general compression routine.
你想压缩的矢量。这个压缩函数是高效压缩与许多零向量,但不是一般的压缩例程。
参数:verbose
IfTRUE then this routine prints out the degree of compression achieved.
如果TRUE那么这个程序打印出程度的压缩取得。
参数:...
any other arguments
任何其他参数
Details
详细信息----------Details----------
Images are large objects. Thresholded 2d wavelet objects (imwd) are also large, but many of their elements are zero. compress.default takes a vector, decides whether compression is necessary and if it is makes an object of class compressed containing the nonzero elements and their position in the original vector.
图片大对象。阈值的二维小波对象(imwd)也大,但他们的许多内容都是零。 compress.default一个向量,决定是否是必要的压缩,并且如果它是类的一个对象compressed包含在原始向量的非零元素和它们的位置。
The decision whether to compress the vector or not depends on two things, first the number of non-zero elements in the vector (r, say), and second the length of the vector (n, say). Since the position and value of the non-zero elements is stored we will need to store 2r values for the non-zero elements. So compression takes place if 2r < n.
决定是否压缩向量或不取决于两件事,第一向量中的非零元素的数目相关(r,说的),和第二的向量长度(正,例如)。由于非零元素的位置和值的存储,我们将需要存储的非零元素的2R值。因此,压缩的地方,如果2r < n。
This function is the default method for the generic function compress. It can be invoked by calling compress for an object of the appropriate class, or directly by calling compress.default regardless of the class of the object.
此功能是默认的方法为通用功能compress。它可以通过适当的类的一个对象,或直接通过调用compress.default不管该对象的类调用compress调用。
值----------Value----------
An object of class compressed if compression took place, otherwise a an object of class uncompressed.
一个类的对象,压缩,如果compression发生,否则一个类的对象uncompressed。
RELEASE----------RELEASE----------
Version 3.5.3 Copyright Guy Nason 1994
版本3.5.3版权所有盖利晨1994
注意----------Note----------
Sometimes the compressed object can be larger than the original. This usually only happens for small objects, so it doesn't really matter.
有时压缩的对象可以是比原来大。这种情况通常只发生小的物体,因此它并不真正的问题。
(作者)----------Author(s)----------
G P Nason
参见----------See Also----------
compress, imwd, threshold.imwd, uncompress
compress,imwd,threshold.imwd,uncompress
实例----------Examples----------
#[]
# Compress a vector with lots of zeroes[有很多的零压缩的矢量]
#[]
compress(c(rep(0,100),99))
#$position:[$的位置:]
#[1] 101[[1] 101]
#[]
#$values:[$值:]
#[1] 99[[1] 99]
#[]
#$original.length:[$ original.length:]
#[1] 101[[1] 101]
#[]
#attr(, "class"):[ATTR(“类”):]
#[1] "compressed"[[1]“压缩”]
#[]
# Try to compress a vector with not many zeroes[尽量压缩并不多零矢量]
#[]
compress(1:10)
#$vector:[$向量:]
#[1] 1 2 3 4 5 6 7 8 9 10[[1] 1 2 3 4 5 6 7 8 9 10]
#[]
#attr(, "class"):[ATTR(“类”):]
#[1] "uncompressed"[[1]“未压缩”]
#[]
#[]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|