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

R语言:grid.convert()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 18:32:43 | 显示全部楼层 |阅读模式
grid.convert(grid)
grid.convert()所属R语言包:grid

                                         Convert Between Different grid Coordinate Systems
                                         不同的网格坐标系统之间的转换

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

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

These functions take a unit object and convert it to an equivalent unit object in a different coordinate system.
这些功能的单位对象,将其转换为相当于在不同的坐标系统的单位的对象。


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


convertX(x, unitTo, valueOnly = FALSE)
convertY(x, unitTo, valueOnly = FALSE)
convertWidth(x, unitTo, valueOnly = FALSE)
convertHeight(x, unitTo, valueOnly = FALSE)
convertUnit(x, unitTo,
             axisFrom = "x", typeFrom = "location",
             axisTo = axisFrom, typeTo = typeFrom,
             valueOnly = FALSE)
grid.convertX(x, unitTo, valueOnly = FALSE)
grid.convertY(x, unitTo, valueOnly = FALSE)
grid.convertWidth(x, unitTo, valueOnly = FALSE)
grid.convertHeight(x, unitTo, valueOnly = FALSE)
grid.convert(x, unitTo,
             axisFrom = "x", typeFrom = "location",
             axisTo = axisFrom, typeTo = typeFrom,
             valueOnly = FALSE)



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

参数:x
A unit object.  
一个单位的对象。


参数:unitTo
The coordinate system to convert the unit to. See the unit function for valid coordinate systems.
坐标系统转换的单位。见unit有效的坐标系统功能。


参数:axisFrom
Either "x" or "y" to indicate whether the unit object represents a value in the x- or y-direction.  
要么"x"或"y"表明单位对象是否代表在x或y方向的价值。


参数:typeFrom
Either "location" or "dimension" to indicate whether the unit object represents a location or a length.  
要么"location"或"dimension"单位对象是否表示一个位置或长度。


参数:axisTo
Same as axisFrom, but applies to the unit object that is to be created.  
相同axisFrom,但适用于单位是要创建的对象。


参数:typeTo
Same as typeFrom, but applies to the unit object that is to be created.  
相同typeFrom,但适用于单位是要创建的对象。


参数:valueOnly
A logical indicating.  If TRUE then the function does not return a unit object, but rather only the converted numeric values.  
一个逻辑说明。如果TRUE那么该函数不返回一个对象的单位,而是只转换的数值。


Details

详情----------Details----------

The convertUnit function allows for general-purpose conversions.  The other four functions are just more convenient front-ends to it for the most common conversions.
convertUnit函数允许为通用的转换。其他四个功能是更方便的前端最常见的转换。

The conversions occur within the current viewport.
转换发生在当前视口中。

It is not currently possible to convert to all valid coordinate systems (e.g., "strwidth" or "grobwidth").  I'm not sure if all of these are impossible, they just seem implausible at this stage.
它是目前无法转换为所有有效的坐标系统(例如,“strwidth”或“grobwidth”)。我不知道如果所有这些都是不可能的,他们只是在这个阶段似乎令人难以置信。

In normal usage of grid, these functions should not be necessary. If you want to express a location or dimension in inches rather than user coordinates then you should simply do something like unit(1, "inches") rather than something like unit(0.134, "native").
在电网的正常使用,这些功能不应该是必要的。如果你想表达用户坐标位置或英寸,而维比,那么你应该简单地做像unit(1, "inches")像unit(0.134, "native")的东西,而不是东西。

In some cases, however, it is necessary for the user to perform calculations on a unit value and this function becomes necessary.  In such cases, please take note of the warning below.
然而,在某些情况下,它是必要的,为用户执行一个单位值计算,此功能成为必要。在这种情况下,请采取下面的警告说明。

The grid.* versions are just previous incarnations which have been deprecated.
电网。*版本只是以前版本已过时。


值----------Value----------

A unit object in the specified coordinate system (unless valueOnly is TRUE in which case the returned value is a numeric).
一个在指定的坐标系统的单位的对象(除非valueOnly是TRUE在这种情况下,返回值是一个数字)。


警告----------Warning----------

The conversion is only valid for the current device size. If the device is resized then at least some conversions will become invalid.  For example, suppose that I create a unit object as follows: oneinch <- convertUnit(unit(1, "inches"),     "native".  Now if I resize the device, the unit object in oneinch no longer corresponds to a physical length of 1 inch.
当前设备的大小是唯一有效的转换。如果设备大小,那么至少有一些转换将成为无效。例如,假设我创建了一个单位的对象如下:oneinch <- convertUnit(unit(1, "inches"),     "native"。现在,如果我调整设备,在oneinch单位对象不再对应一个1英寸的物理长度。


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


Paul Murrell



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

unit
unit


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


## A tautology[#重言式]
convertX(unit(1, "inches"), "inches")
## The physical units[#物理单位]
convertX(unit(2.54, "cm"), "inches")
convertX(unit(25.4, "mm"), "inches")
convertX(unit(72.27, "points"), "inches")
convertX(unit(1/12*72.27, "picas"), "inches")
convertX(unit(72, "bigpts"), "inches")
convertX(unit(1157/1238*72.27, "dida"), "inches")
convertX(unit(1/12*1157/1238*72.27, "cicero"), "inches")
convertX(unit(65536*72.27, "scaledpts"), "inches")
convertX(unit(1/2.54, "inches"), "cm")
convertX(unit(1/25.4, "inches"), "mm")
convertX(unit(1/72.27, "inches"), "points")
convertX(unit(1/(1/12*72.27), "inches"), "picas")
convertX(unit(1/72, "inches"), "bigpts")
convertX(unit(1/(1157/1238*72.27), "inches"), "dida")
convertX(unit(1/(1/12*1157/1238*72.27), "inches"), "cicero")
convertX(unit(1/(65536*72.27), "inches"), "scaledpts")

pushViewport(viewport(width=unit(1, "inches"),
                       height=unit(2, "inches"),
                       xscale=c(0, 1),
                       yscale=c(1, 3)))
  ## Location versus dimension[#地点与维]
  convertY(unit(2, "native"), "inches")
  convertHeight(unit(2, "native"), "inches")
  ## From "x" to "y" (the conversion is via "inches")[从“X”“Y”(转换通过“英寸”#)]
  convertUnit(unit(1, "native"), "native",
               axisFrom="x", axisTo="y")
  ## Convert several values at once[#一次转换多个值]
  convertX(unit(c(0.5, 2.54), c("npc", "cm")),
                c("inches", "native"))
popViewport()
## Convert a complex unit[#转换成一个复杂的单位。]
convertX(unit(1, "strwidth", "Hello"), "native")

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-1-23 21:19 , Processed in 0.064377 second(s), 15 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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