as.PCICt(PCICt)
as.PCICt()所属R语言包:PCICt
PCICt
PCICt
译者:生物统计家园网 机器人LoveR
描述----------Description----------
These functions convert between PCICt objects and other types of data.
这些功能之间转换的PCICt对象和其他类型的数据。
用法----------Usage----------
as.PCICt(x, cal, ...)
.PCICt(x, cal)
as.PCICt.default(x, cal, ...)
as.PCICt.POSIXlt(x, cal, ...)
as.PCICt.POSIXct(x, cal, ...)
as.POSIXct.PCICt(x, tz="", ...)
as.POSIXlt.PCICt(x, tz="", ...)
参数----------Arguments----------
参数:x
the input data.
所输入的数据。
参数:cal
the calendar type.
日历类型。
参数:tz
the time zone to put the data in.
时区的数据中。
参数:...
any additional arguments passed on.
任何额外的参数传递。
Details
详细信息----------Details----------
as.PCICt converts the x argument, where x is of type POSIXlt, POSIXct, or character, to a PCICt object with the given calendar type. Calendar types include 360 day calendars("360_day", "360"), 365 day calendars ("365_day", "365", "noleap"), and Gregorian calendars ("gregorian", "proleptic_gregorian"). When converting a character object, one can also specify the format with fmt=, which uses a format documented in the help page for strptime.
as.PCICt引数x,其中x是类型POSIXlt,POSIXct,或字符,转换到PCICt对象与特定日历类型。日历类型包括360天日历(的“360_day”,“360”),365天日历(“365_day”,“365”,“noleap”),和格列高利历法(“格利高里”,“proleptic_gregorian”)。转换角色对象时,也可以指定格式,它使用的格式文件中的帮助页面,那么strptime FMT =。
.PCICt converts numeric objects into PCICt objects, using x as seconds since 1970-01-01 and applying the supplied calendar to the data.
。PCICt数值对象转换成PCICt对象,使用x为秒自1970-01-01和应用所提供的日历数据。
as.POSIXct.PCICt and as.POSIXlt.PCICt convert PCICt objects into POSIXct or POSIXlt objects, respectively. With POSIXct objects, this may result in apparent gaps in the timeseries, and the transformation will not be trivially reversible. See the example below for how to transition between PCICt and POSIXct.
as.POSIXct.PCICt和as.POSIXlt.PCICt转换PCICt对象为POSIXct对象或POSIXlt对象,分别。 POSIXct对象,这可能会导致在时间序列的明显差距,并转换将不平凡可逆的。请看下面的例子,如何将之间的过渡PCICt和POSIXct的。
as.PCICt.default, as.PCICt.POSIXct, and as.PCICt.POSIXlt are helpers which are called by as.PCICt. Normally you will not need to call them directly.
as.PCICt.default,as.PCICt.POSIXct,并as.PCICt.POSIXlt的是助理被称为as.PCICt。通常情况下,你并不需要直接调用它们。
值----------Value----------
For as.PCICt and .PCICt, a PCICt object with the given calendar type.
对于as.PCICt。PCICt,一个PCICt的对象与给定的日历类型。
For as.POSIXct.PCICt and as.POSIXlt.PCICt, a POSIXct or POSIXlt object, respectively.
对于as.POSIXct.PCICt和as.POSIXlt.PCICt,POSIXct对象或POSIXlt对象,分别。
参见----------See Also----------
as.POSIXlt, as.POSIXct, strptime
as.POSIXlt,as.POSIXct,strptime
实例----------Examples----------
## Convert these strings to PCICt objects.[#将这些的字符串,PCICt对象。]
x <- as.PCICt(c("1961-09-02", "1963-02-01"), cal="360_day")
## Convert these strings to POSIXlt objects, then coerce them into PCICt objects.[#将这些的字符串,POSIXlt对象,然后强制他们到PCICt对象。]
y <- as.POSIXlt(c("1961-09-02", "1963-02-01"))
x <- as.PCICt(y, cal="360_day")
## Convert a string to PCICt using a format string.[#转换字符串,PCICt使用格式字符串。]
q <- as.PCICt("03292001", cal="365_day", format="%m%d%Y")
## This will cause a parsing error.[#这将导致一个分析错误。]
## Not run: bad.r <- as.PCICt("moo", cal="365_day")[#不运行:bad.r - as.PCICt(“哞哞”,“CAL =”365_day)]
## Convert a POSIXct to PCICt 360-day[#转换为POSIXct,,PCICt 360天]
foo <- as.POSIXct("2011-04-01")
bar <- as.PCICt(as.character(foo), cal="360_day")
## Test whether the result is the same[#检查的结果是一样的]
baz <- as.PCICt("2011-04-01", cal="360_day")
bar == baz
## Convert a sequence of days plus an origin to PCICt (as seen in NetCDF files)[#转换序列的天加原产地PCICt(NetCDF文件中看到)]
cal <- "365_day"
origin <- "1968-01-01"
seconds.per.day <- 86400
ts.dat.days <- 0:100
origin.pcict <- as.PCICt(origin, cal)
ts.dat.pcict <- origin.pcict + (ts.dat.days * seconds.per.day)
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|