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

R语言:image-methods()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 19:53:39 | 显示全部楼层 |阅读模式
image-methods(Matrix)
image-methods()所属R语言包:Matrix

                                        Methods for image() in Package 'Matrix'
                                         ()方法在包矩阵

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

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

Methods for function image in package Matrix.  An image of a matrix simply color codes all matrix entries and draws the n x m matrix using an n x m grid of (colored) rectangles.
方法函数image包Matrix。一个简单的颜色代码矩阵矩阵项的形象,并提请n x m矩阵n x m电网(彩色)矩形。


用法----------Usage----------


## S4 method for signature 'dgTMatrix'
image(x,
      xlim = .5 + c(0, di[2]),
      ylim = .5 + c(di[1], 0), aspect = "iso",
      sub = sprintf("Dimensions: %d x %d", di[1], di[2]),
      xlab = "Column", ylab = "Row", cuts = 15,
      useRaster = FALSE,
      useAbs = NULL, colorkey = !useAbs,
      col.regions = NULL,
      lwd = NULL, ...)



参数----------Arguments----------

参数:x
a Matrix object, i.e., fulfilling is(x, "Matrix").
Matrix对象,即履行is(x, "Matrix")。


参数:xlim, ylim
x- and y-axis limits; may be used to “zoom into” matrix.
x和y轴的限制;可以使用“放大成”矩阵。


参数:aspect
aspect ratio specified as number (y/x) or string; see levelplot.
长宽比指定数量(Y / X)或字符串;levelplot。


参数:sub, xlab, ylab
axis annotation with sensible defaults; see plot.default.
轴与合理的默认值的注解;plot.default。


参数:cuts
number of levels the range of matrix values would be divided into.
级别数矩阵值的范围将分为。


参数:useRaster
logical indicating if raster graphics should be used (instead of the tradition rectangle vector drawing).  If true, panel.levelplot.raster (from lattice package) is used, and the colorkey is also done via rasters, see also levelplot and possibly grid.raster.  Note that using raster graphics may often be faster, but can be slower, depending on the matrix dimensions and the graphics device (dimensions).
逻辑表示应使用光栅图形(而不是传统的矩形矢量绘图)。如果情况属实,panel.levelplot.raster(lattice包)被使用,并且还通过了colorkey栅格,又见levelplot可能grid.raster。请注意,使用光栅图形通常可能更快,但可以慢,取决于矩阵的尺寸和图形设备(尺寸)。


参数:useAbs
logical indicating if abs(x) should be shown; if TRUE, the former (implicit) default, the default col.regions will be grey colors (and no colorkey drawn).  The default is FALSE unless the matrix has no negative entries.
如果abs(x)应显示的逻辑表示如果TRUE,前者(隐式)的默认,默认col.regions会grey颜色(和没有colorkey画)。默认是FALSE除非矩阵有没有负面的条目。


参数:colorkey
logical indicating if a color key aka "legend" should be produced.  Default is to draw one, unless useAbs is true.  You can also specify a list, see levelplot, such aslist(raster=TRUE) in the case of rastering.
逻辑表示颜色的关键又名“传奇”,应当制作。默认是绘制一个,除非useAbs是真实的。您还可以指定list,看到levelplot,如list(raster=TRUE)在光栅情况。


参数:col.regions
vector of gradually varying colors; see levelplot.
颜色逐渐变的向量;levelplot。


参数:lwd
non-negative number or NULL (default), specifying the line-width of the rectangles of each non-zero matrix entry (drawn by grid.rect).  The default depends on the matrix dimension and the device size.
非负数或NULL(默认),指定每个非零矩阵项(由grid.rect绘制)矩形的线宽。默认取决于矩阵维和设备的大小。


参数:...
further arguments passed to methods and levelplot.
进一步的参数传递给方法和levelplot。


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

All methods currently end up calling the method for the dgTMatrix class. Use showMethods(image) to list them all.
目前,所有的方法结束调用为dgTMatrix类的方法。使用showMethods(image)全部列出来。


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


showMethods(image)
## If you want to see all the methods' implementations:[#如果你想看到所有的方法实现:]
showMethods(image, incl=TRUE, inherit=FALSE)

data(CAex)
image(CAex, main = "image(CAex)")
image(CAex, useAbs=TRUE, main = "image(CAex, useAbs=TRUE)")

cCA <- Cholesky(crossprod(CAex), Imult = .01)
image(cCA, main="Cholesky(crossprod(CAex), Imult = .01)")
image(cCA, useAbs=TRUE)

data(USCounties)
image(USCounties)# huge[巨大]
image(sign(USCounties))## just the pattern[#只是模式]
    # how the result looks, may depend heavily on[结果看起来如何,在很大程度上取决于]
    # the device, screen resolution, antialiasing etc[设备,屏幕分辨率,抗锯齿等]
    # e.g. x11(type="Xlib") may show very differently than cairo-based[例如比开罗基于X11(类型=“Xlib的”)可能会出现非常不同]

## Drawing borders around each rectangle;[#每个矩形周围绘制的边界;]
    # again, viewing depends very much on the device:[再次,观看非常取决于设备:]
image(USCounties[1:400,1:200], lwd=.1)
image(USCounties[1:200,1:200], lwd=.5)
image(USCounties[1:200,1:200], lwd=.01)

## Using raster graphics: For PDF this would give a 77 MB file,[#使用光栅图形:对于PDF,这将给77 MB的文件,]
## however, for such a large matrix, this is typically considerably[#然而,这样一个大的矩阵,这通常是相当]
## *slower* (than vector graphics rectangles) in most cases :[#*慢*(比矢量图形的矩形),在大多数情况下:]
if(doPNG <- !dev.interactive())
png("image-USCounties-raster.png", width=3200, height=3200)
image(USCounties, useRaster = TRUE) # should not suffer from anti-aliasing[不应该受到抗锯齿]
if(doPNG)
   dev.off()
   ## and now look at the *.png image in a viewer you can easily zoom in and out[*#现在看PNG图像在一个观众,你可以轻松地放大和]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-24 21:20 , Processed in 0.019156 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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