cut.POSIXt(base)
cut.POSIXt()所属R语言包:base
Convert a Date or Date-Time Object to a Factor
日期或日期时间对象转换因子
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Method for cut applied to date-time objects.
cut申请日期时间对象的方法。
用法----------Usage----------
## S3 method for class 'POSIXt'
cut(x, breaks, labels = NULL, start.on.monday = TRUE,
right = FALSE, ...)
## S3 method for class 'Date'
cut(x, breaks, labels = NULL, start.on.monday = TRUE,
right = FALSE, ...)
参数----------Arguments----------
参数:x
an object inheriting from class "POSIXt" or "Date".
从类对象继承"POSIXt"或"Date"。
参数:breaks
a vector of cut points or number giving the number of intervals which x is to be cut into or an interval specification, one of "sec", "min", "hour", "day", "DSTday", "week", "month", "quarter" or "year", optionally preceded by an integer and a space, or followed by "s". For "Date" objects only "day", "week", "month", "quarter" and "year" are allowed.
一个切点,或给予的间隔数数量的向量x是要减少或间隔规范,"sec","min","hour","day","DSTday","week","month","quarter"或"year",可以选择一个整数和一个空间之前,或其次"s" 。 "Date"对象只"day","week","month","quarter"和"year"是允许的。
参数:labels
labels for the levels of the resulting category. By default, labels are constructed from the left-hand end of the intervals (which are include for the default value of right). If labels = FALSE, simple integer codes are returned instead of a factor.
标签所产生的类别水平。默认情况下,标签构造的区间的左端(其中包括默认值right)。如果labels = FALSE,简单的整数代码的一个因素,而不是返回。
参数:start.on.monday
logical. If breaks = "weeks", should the week start on Mondays or Sundays?
逻辑。如果breaks = "weeks",应该一周的星期一或星期日开始?
参数:right, ...
arguments to be passed to or from other methods.
参数被传递到或从其他方法。
Details
详情----------Details----------
Using both right = TRUE and include.lowest = TRUE will include both ends of the range of dates.
使用两个right = TRUE和include.lowest = TRUE日期范围将包括两端。
Using breaks = "quarter" will create intervals of 3 calendar months, with the intervals beginning on January 1, April 1, July 1 or October 1, based upon min(x) as appropriate.
使用breaks = "quarter"将创建3个日历月的时间间隔,开始于1月1日,4月1日,7月1日或10月1日,根据经min(x)适当的间隔。
值----------Value----------
A factor is returned, unless labels = FALSE which returns the integer level codes.
返回一个因素是,除非labels = FALSE返回整数级别的代码。
参见----------See Also----------
seq.POSIXt, seq.Date, cut
seq.POSIXt,seq.Date,cut
举例----------Examples----------
## random dates in a 10-week period[#在10个星期的时间内随机的日期]
cut(ISOdate(2001, 1, 1) + 70*86400*stats::runif(100), "weeks")
cut(as.Date("2001/1/1") + 70*stats::runif(100), "weeks")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|