last(sfsmisc)
last()所属R语言包:sfsmisc
Get Last Elements of a Vector
获取最后一个元素的矢量
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Extract the last elements of a vector.
提取一个向量的最后一个元素。
用法----------Usage----------
last(x, length.out = 1, na.rm = FALSE)
参数----------Arguments----------
参数:x
any vector.
任何向量。
参数:length.out
integer indicating how many element are desired. If positive, return the length.out last elements of x; if negative, the last length.out elements are dropped.
整数,表示多少元素需要。如果是正数,返回length.out的x最后一个元素,如果为负,最后length.out元素都将被丢弃。
参数:na.rm
logical indicating if the last non-missing value (if any) shall be returned. By default (it is FALSE and) the last elements (whatever its values) are returned.
逻辑的最后一个非缺失值(如果有的话)应当返还。 (默认情况下它是FALSE)返回的最后一个元素(不论其值)。
值----------Value----------
a vector of length abs(length.out) of last values from x.
的向量长度abs(length.out)的最后一个值从x。
注意----------Note----------
This function may eventually be deprecated for the new (R 1.9.0) function tail().
此功能可能最终被废弃(R 1.9.0)的新功能tail()。
Useful for the turnogram() function in package pastecs.
有用的turnogram()功能包pastecs。
(作者)----------Author(s)----------
Werner Stahel (<a href="mailto:stahel@stat.math.ethz.ch">stahel@stat.math.ethz.ch</a>), and independently,
Philippe Grosjean (<a href="mailto:phgrosjean@sciviews.org">phgrosjean@sciviews.org</a>),
Fr茅d茅ric Ibanez (<a href="mailto:ibanez@obs-vlfr.fr">ibanez@obs-vlfr.fr</a>).
参见----------See Also----------
first, turnogram
first,turnogram
实例----------Examples----------
a <- c(NA, 1, 2, NA, 3, 4, NA)
last(a)
last(a, na.rm=TRUE)
last(a, length = 2)
last(a, length = -3)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|