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

R语言 ggbio包 rescale()函数中文帮助文档(中英文对照)

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

                                        rescale ggplot object
                                         重新调整ggplot对象

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

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

Rescale a numeric vector or ggplot object, could be used for static zoom-in in ggbio.
重新调整一个数值向量或ggplot对象,可用于静态在ggbio变焦的。


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


## For signature numeric
## S4 method for signature 'numeric'
rescale(x, to = c(0, 1),
      from = range(x, na.rm = TRUE))

## For signature ggplot
## S4 method for signature 'ggplot'
rescale(x, xlim, ylim, sx = 1, sy = 1)



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

参数:x
A numeric object or ggplot object to be rescaled.   
一个数值对象或ggplot的对象,要重新调整。


参数:to
For numeric object. it's a vector of two numeric values, specifying the range to be rescale.  
对于数字对象。它是一个向量,两个数值指定的范围内,要重新调整。


参数:from
Range of x.   
x的范围。


参数:xlim
For ggplot object. This specify the new limits on x-scale.  
ggplot对象。这指定x上规模的新的限制。


参数:ylim
For ggplot object. This specify the new limits on y-scale.  
ggplot对象。这对y轴指定新的限制。


参数:sx
Scale fold for x-scale. Default is 1, no change.  
针对X-Scale规模倍。默认值是1,没有变化。


参数:sy
Scale fold for y-scale. Default is 1, no change.  
y的规模规模倍。默认值是1,没有变化。


Details

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

When x is numeric value, it's just call scales::rescale, please refer to the manual page to check more details. If x is ggplot object, it first try to estimate current x limits and y limits of the ggplot object, then rescale based on those information.
当x是数值,它只是调用尺度::重新调整,请参阅手册页,以检查更多的细节。如果x是ggplot对象时,它首先试图估计当前的X和Y限制限制的ggplot对象,然后根据这些信息重新调整。


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

Return the object of the same class as x after rescaling.
返回x重调后的同一类的对象。


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


Tengfei Yin



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


## Not run: [#无法运行:]
library(ggbio)
head(mtcars)
range(mtcars$mpg)
p <- qplot(data = mtcars, x = mpg, y = disp, geom = "point")
p.new <- rescale(p, xlim = c(20, 25))

## End(Not run)[#结束(不运行)]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-7 04:39 , Processed in 0.024577 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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