## Convert these strings to PCICt objects.
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.
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. Remove the escaping.
q <- as.PCICt("03292001", cal="365_day", format="%m%d%Y")
## This will cause a parsing error.
bad.r <- as.PCICt("moo", cal="365_day")
## Convert a POSIXct to PCICt 360-day
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 == bazRun the code above in your browser using DataLab