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

R语言 sfsmisc包 inv.seq()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-9-30 01:37:45 | 显示全部楼层 |阅读模式
inv.seq(sfsmisc)
inv.seq()所属R语言包:sfsmisc

                                        Inverse seq() – Short Expression for Index Vector
                                         反序列() - 短索引向量中的表达

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

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

Compute a short expression for a given integer vector, typically an index, that can be expressed shortly, using : etc.
很短的表达式计算为一个给定整数矢量,通常是一个指数,可以表示短期内,使用:等


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


inv.seq(i)



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

参数:i
vector of (usually increasing) integers.
向量的(通常增加)的整数。


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

a call (“the inside of an expression”) to be eval()ed to return the original i.
一个call(“的内的expression”)是eval()编辑,返回原i。


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


Martin Maechler, October 1995; more elegant implementation from
Tony Plate.



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

rle for another kind of integer vector coding.
rle另一种整数向量编码。


实例----------Examples----------


(rr <- inv.seq(i1 <- c(3:12, 20:24, 27, 30:33)))
eval(rr)
stopifnot(eval(rr) == i1)

e2 <- expression(c(20:13, 3:12, -1:-4, 27, 30:31))
(i2 <- eval(e2))
(r2 <- inv.seq(i2))
stopifnot(all.equal(r2, e2[[1]]))

## Had {mapply()} bug in this example:[#有{mapply()}在这个例子中的错误:]
ii <- c(1:3, 6:9, 11:16)
stopifnot(identical(ii, eval(inv.seq(ii))))

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-5-21 05:42 , Processed in 0.021161 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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