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

R语言:weekday.POSIXt()函数中文帮助文档(中英文对照)

[复制链接]
发表于 2012-2-16 17:25:33 | 显示全部楼层 |阅读模式
weekday.POSIXt(base)
weekday.POSIXt()所属R语言包:base

                                        Extract Parts of a POSIXt or Date Object
                                         提取,一个POSIXt或日期对象的零件

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

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

Extract the weekday, month or quarter, or the Julian time (days since some origin).  These are generic functions: the methods for the internal date-time classes are documented here.
提取星期,每月或每季度,或朱利安时间(因为有些起源天)。这些都是通用的功能:日期时间的内部类的方法都记录在这里。


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


weekdays(x, abbreviate)
## S3 method for class 'POSIXt'
weekdays(x, abbreviate = FALSE)
## S3 method for class 'Date'
weekdays(x, abbreviate = FALSE)

months(x, abbreviate)
## S3 method for class 'POSIXt'
months(x, abbreviate = FALSE)
## S3 method for class 'Date'
months(x, abbreviate = FALSE)

quarters(x, abbreviate)
## S3 method for class 'POSIXt'
quarters(x, ...)
## S3 method for class 'Date'
quarters(x, ...)

julian(x, ...)
## S3 method for class 'POSIXt'
julian(x, origin = as.POSIXct("1970-01-01", tz="GMT"), ...)
## S3 method for class 'Date'
julian(x, origin = as.Date("1970-01-01"), ...)



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

参数:x
an object inheriting from class "POSIXt" or "Date".
从类对象继承"POSIXt"或"Date"。


参数:abbreviate
logical.  Should the names be abbreviated?
逻辑。应的名称缩写?


参数:origin
an length-one object inheriting from class "POSIXt" or "Date".
长度一类对象继承"POSIXt"或"Date"。


参数:...
arguments for other methods.
为其他方法的参数。


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

weekdays and months return a character vector of names in the locale in use.
weekdays和months返回一个特征向量的语言环境中使用的名称。

quarters returns a character vector of "Q1" to "Q4".
quarters返回"Q1"的"Q4"特征向量。

julian returns the number of days (possibly fractional) since the origin, with the origin as a "origin" attribute. All time calculations in R are done ignoring leap-seconds.
julian自原点返回的天数(可能是小数),原产地为"origin"属性。 R中的所有时间计算进行忽略飞跃秒。


注意----------Note----------

Other components such as the day of the month or the year are very easy to compute: just use as.POSIXlt and extract the relevant component.  Alternatively (especially if the components are desired as character strings), use strftime.
其他组件,如一个月或一年的日子是很容易计算:使用as.POSIXlt和提取相关的组件。或者(尤其是如果组件所需的字符串),使用strftime。


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

DateTimeClasses, Date
DateTimeClasses,Date


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


weekdays(.leap.seconds)
months(.leap.seconds)
quarters(.leap.seconds)

## Julian Day Number (JDN, http://en.wikipedia.org/wiki/Julian_day)[#朱利安天数(JDN http://en.wikipedia.org/wiki/Julian_day)]
## is the number of days since noon UTC on the first day of 4317 BC.[#是自公元前的4317年的第一天中午UTC天数。]
## in the proleptic Julian calendar.  To more recently, in[#中的proleptic的儒略历。最近在]
## 'Terrestrial Time' which differs from UTC by a few seconds[#陆地的时间相差几秒钟,从UTC]
## See http://en.wikipedia.org/wiki/Terrestrial_Time[#见http://en.wikipedia.org/wiki/Terrestrial_Time]
julian(Sys.Date(), -2440588) # from a day[从一天]
floor(as.numeric(julian(Sys.time())) + 2440587.5) # from a date-time[从日期时间]

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


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

使用道具 举报

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

本版积分规则

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

GMT+8, 2025-2-2 16:50 , Processed in 0.021076 second(s), 16 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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