ymd(tis)
ymd()所属R语言包:tis
Extract parts of various Date-Time Objects
不同的日期时间对象中提取部分
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Extract the year, month or day, or all three (in yyyymmdd form), or the quarter, from a jul, ti, or from any object that jul() can handle.
提取的年,月,日,或三(YYYYMMDD形式),或四分之一,从七月,TI,或从任何对象jul()可以处理。
用法----------Usage----------
ymd(x, ...)
## S3 method for class 'jul'
ymd(x, ...)
## S3 method for class 'ssDate'
ymd(x, ...)
## S3 method for class 'ti'
ymd(x, offset = 1, ...)
## Default S3 method:[默认方法]
ymd(x, ...)
year(x, ...)
quarter(x, ...)
month(x, ...)
day(x, ...)
参数----------Arguments----------
参数:x
a ti or jul, or something that jul() can create a jul object from.
ti或jul或jul()可以创建一个jul对象的东西。
参数:...
other args to be passed to the method called by the generic function. year, quarter, month, day and ymd.default may pass these args to as.Date.
其他ARGS要传递给调用的方法的通用功能。 year,quarter,month,day和ymd.default可以通过这些ARGSas.Date。
参数:offset
for ti x, a number in the range [0,1] telling where in the period represented by x to find the day. 0 returns the first day of the period, while the default value 1 returns the last day of the period. For example, if x has tif = "wmonday" so that x represents a week ending on Monday, than any offset in the range [0, 1/7] will return the Tuesday of that week, while offset in the range (1/7, 2/7] will return the Wednesday of that week, offset in the range (6/7, 1] will return the Monday that ends the week, and so on.
tix,一个数字的范围[0,1],告诉在此期间为代表的x找了一天。 0返回的第一天期间,默认值1时返回的期限的最后一天。例如,如果xtif=“wmonday的”,使x代表在周一结束的一周,比任何offset的范围是[0,1/7将返回那个星期的星期二,而offset的范围内(1/7,2/7]将返回那个星期的星期三,offset的范围内(6/7,1]将返回结束一周星期一,依此类推。
Details
详细信息----------Details----------
year, quarter, month and day call ymd, and thus understand the same arguments as it does. The default implementation ymd.default passes it's arguments to a call to the function jul, so all of these functions work the same way that function does.
year,quarter,month和dayymd,相同的参数,从而了解它。默认的实现ymd.default它的参数传递给调用该函数jul,所有这些功能的工作方式相同,功能。
值----------Value----------
ymd and it's variants return numeric objects in yyyymmdd form.
ymd和它的变种返回数字的格式为yyyymmdd形式的对象。
year, quarter, month and day return numeric objects.
year,quarter,month和day返回的数值对象。
ymd() with no arguments returns today's yyyymmdd.
ymd()今天不带参数,则返回的格式为yyyymmdd。
参见----------See Also----------
jul, ti, as.Date
jul,ti,as.Date
实例----------Examples----------
ymd() ## today's date and time[今天的日期和时间]
weekFromNow <- ymd(today() + 7) ## today() returns a daily ti[今日()返回一个每天TI]
year(jul(today()))
month(Sys.time())
## create a monthly tis (Time Indexed Series)[#创建一个每月TIS(时间索引系列)]
aTis <- tis(0, start = c(2000, 1), end = c(2004, 12), freq = 12)
ymd(ti(aTis)) ## the yyyymmdd dates of the observations[#YYYYMMDD日期的意见]
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|