Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Roxygen 2.2

  • Loading branch information...
commit e3649af3e6653155f1a3aba24ba923bcc8aa896b 1 parent 75bddd2
@hadley authored
Showing with 1,548 additions and 1,140 deletions.
  1. +29 −10 DESCRIPTION
  2. +204 −127 NAMESPACE
  3. +1 −1  R/help.r
  4. +2 −2 man/DateCoercion.Rd
  5. +50 −28 man/DateUpdate.Rd
  6. +9 −10 man/add_dates.Rd
  7. +15 −11 man/add_epoch_to_date.Rd
  8. +18 −11 man/am.Rd
  9. +24 −19 man/as.duration.Rd
  10. +27 −20 man/as.interval.Rd
  11. +22 −17 man/as.period.Rd
  12. +24 −17 man/ceiling_date.Rd
  13. +16 −9 man/decimal_date.Rd
  14. +51 −44 man/dseconds.Rd
  15. +18 −14 man/dst.Rd
  16. +32 −30 man/duration.Rd
  17. +24 −17 man/floor_date.Rd
  18. +24 −17 man/force_tz.Rd
  19. +19 −16 man/hm.Rd
  20. +20 −16 man/hms.Rd
  21. +21 −19 man/hour.Rd
  22. +18 −15 man/int_end.Rd
  23. +18 −15 man/int_start.Rd
  24. +19 −10 man/is.Date.Rd
  25. +23 −13 man/is.POSIXt.Rd
  26. +19 −11 man/is.difftime.Rd
  27. +20 −11 man/is.duration.Rd
  28. +25 −19 man/is.instant.Rd
  29. +20 −11 man/is.interval.Rd
  30. +20 −11 man/is.period.Rd
  31. +22 −11 man/is.timespan.Rd
  32. +7 −8 man/lakers.Rd
  33. +16 −14 man/leap_year.Rd
  34. +22 −22 man/lubridate.Rd
  35. +17 −10 man/make_difftime.Rd
  36. +21 −19 man/minute.Rd
  37. +31 −24 man/month.Rd
  38. +19 −16 man/ms.Rd
  39. +23 −17 man/new_difftime.Rd
  40. +27 −19 man/new_duration.Rd
  41. +14 −11 man/new_epoch.Rd
  42. +25 −19 man/new_interval.Rd
  43. +23 −17 man/new_period.Rd
  44. +19 −13 man/now.Rd
  45. +13 −9 man/origin.Rd
  46. +26 −17 man/parse_date.Rd
  47. +32 −26 man/pretty.dates.Rd
  48. +4 −2 man/reclass_date.Rd
  49. +24 −17 man/round_date.Rd
  50. +21 −19 man/second.Rd
  51. +43 −37 man/seconds.Rd
  52. +9 −10 man/subtract_dates.Rd
  53. +14 −16 man/sundays.Rd
  54. +19 −13 man/today.Rd
  55. +26 −22 man/tz.Rd
  56. +36 −25 man/wday.Rd
  57. +21 −19 man/week.Rd
  58. +24 −17 man/with_tz.Rd
  59. +31 −25 man/yday.Rd
  60. +22 −19 man/year.Rd
  61. +31 −26 man/ymd.Rd
  62. +34 −30 man/ymd_hms.Rd
View
39 DESCRIPTION
@@ -1,5 +1,7 @@
Package: lubridate
-Imports: plyr, stringr
+Imports:
+ plyr,
+ stringr
Maintainer: Garrett Grolemund <grolemund@rice.edu>
License: GPL
Title: Make dealing with dates a little easier
@@ -18,12 +20,29 @@ Description: Lubridate makes it easier to work with dates
Enhances: chron, timeDate, zoo, xts, its, tis, timeSeries,
fts, tseries
Version: 0.2.5
-Depends: R (>= 2.8)
-Suggests: testthat
-Collate: 'accessors-day.r' 'accessors-hour.r'
- 'accessors-minute.r' 'accessors-misc.r'
- 'accessors-month.r' 'accessors-second.r'
- 'accessors-tz.r' 'accessors-week.r' 'accessors-year.r'
- 'coercion.r' 'durations.r' 'epochs.r' 'help.r'
- 'intervals.r' 'ops.durations.r' 'parse.r' 'periods.r'
- 'pretty.r' 'round.r' 'util.r' 'zzz.r'
+Depends:
+ R (>= 2.8)
+Suggests:
+ testthat
+Collate:
+ 'accessors-day.r'
+ 'accessors-hour.r'
+ 'accessors-minute.r'
+ 'accessors-misc.r'
+ 'accessors-month.r'
+ 'accessors-second.r'
+ 'accessors-tz.r'
+ 'accessors-week.r'
+ 'accessors-year.r'
+ 'coercion.r'
+ 'durations.r'
+ 'epochs.r'
+ 'help.r'
+ 'intervals.r'
+ 'ops.durations.r'
+ 'parse.r'
+ 'periods.r'
+ 'pretty.r'
+ 'round.r'
+ 'util.r'
+ 'zzz.r'
View
331 NAMESPACE
@@ -1,136 +1,213 @@
-export(day, yday, mday, "day<-", "yday<-", "mday<-")
-S3method(yday, default)
-S3method(mday, default)
-export(wday, "wday<-")
-S3method(wday, default)
-S3method(wday, numeric)
-export(hour, "hour<-")
-S3method(hour, default)
-export(minute, "minute<-")
-S3method(minute, default)
-export(dst)
-S3method(dst, default)
-S3method(update, Date)
-S3method(update, POSIXct)
-S3method(update, POSIXlt)
-export(month, "month<-")
-S3method(month, default)
-export(second, "second<-")
-S3method(second, default)
-export(tz, "tz<-")
-S3method(tz, default)
-S3method(tz, zoo)
-S3method(tz, timeSeries)
-S3method(tz, irts)
-export(week, "week<-")
-export(year, "year<-")
-S3method(year, default)
-S3method(as.POSIXlt, fts)
-S3method(as.POSIXlt, its)
-S3method(as.POSIXlt, timeSeries)
-S3method(as.POSIXlt, irts)
-S3method(as.POSIXlt, xts)
-S3method(as.POSIXlt, zoo)
-S3method(as.POSIXlt, tis)
-S3method(as.POSIXct, fts)
-S3method(as.POSIXct, its)
-S3method(as.POSIXct, timeSeries)
-S3method(as.POSIXct, irts)
-S3method(as.POSIXct, xts)
-S3method(as.POSIXct, zoo)
-export(reclass_date)
-S3method(reclass_date, POSIXlt)
-S3method(reclass_date, POSIXct)
-S3method(reclass_date, chron)
-S3method(reclass_date, timeDate)
-S3method(reclass_date, its)
-S3method(reclass_date, ti)
-S3method(reclass_date, Date)
-S3method(format, duration)
-S3method(print, duration)
-S3method(rep, duration)
-S3method("%%", duration)
-S3method("%/%", duration)
-S3method("%%", difftime)
-S3method("%/%", difftime)
-S3method("/", duration)
-S3method("*", duration)
-S3method("+", duration)
-S3method("-", duration)
-S3method(c, duration)
-export(new_duration)
-S3method(c, difftime)
-export(new_difftime)
+export("day<-")
+export("hour<-")
+export("int_end<-")
+export("int_start<-")
+export("mday<-")
+export("minute<-")
+export("month<-")
+export("second<-")
+export("tz<-")
+export("wday<-")
+export("week<-")
+export("yday<-")
+export("year<-")
+export(add_dates)
+export(am)
export(as.duration)
-S3method(as.duration, default)
-S3method(as.duration, period)
-S3method(as.duration, interval)
-S3method(as.duration, difftime)
-export(eseconds, eminutes, ehours, edays, eweeks, eyears, dseconds, dminutes, dhours, ddays, dweeks, dyears, dmilliseconds, emilliseconds, dmicroseconds, emicroseconds, dnanoseconds, enanoseconds, dpicoseconds, epicoseconds)
-export(is.instant, is.timepoint)
-export(is.timespan)
-export(is.POSIXt, is.POSIXlt, is.POSIXct)
-export(is.duration)
-export(is.difftime)
+export(as.interval)
+export(as.period)
+export(ceiling_date)
+export(d)
+export(day)
+export(days)
+export(ddays)
+export(decimal_date)
+export(dhours)
+export(dmicroseconds)
+export(dmilliseconds)
+export(dminutes)
+export(dmy_h)
+export(dmy_hm)
+export(dmy_hms)
+export(dmy)
+export(dnanoseconds)
+export(dpicoseconds)
+export(dseconds)
+export(dst)
+export(dweeks)
+export(dyears)
+export(dym)
+export(edays)
+export(ehours)
+export(emicroseconds)
+export(emilliseconds)
+export(eminutes)
+export(enanoseconds)
+export(epicoseconds)
+export(eseconds)
+export(eweeks)
+export(eyears)
+export(floor_date)
+export(force_tz)
+export(hm)
+export(hms)
+export(hour)
+export(hours)
+export(int_end)
+export(int_start)
export(is.Date)
-export(is.period)
+export(is.difftime)
+export(is.duration)
+export(is.instant)
export(is.interval)
-import(plyr, stringr)
-export(new_interval)
-S3method("%%", interval)
-S3method("%/%", interval)
-S3method("/", interval)
-S3method("*", interval)
-S3method("+", interval)
-S3method("-", interval)
-S3method(rep, interval)
-S3method("[", interval)
-S3method(c, interval)
-S3method(format, interval)
-S3method(print, interval)
-export(as.interval)
-export(int_start, "int_start<-")
-export(int_end, "int_end<-")
-export(add_dates)
+export(is.period)
+export(is.POSIXct)
+export(is.POSIXlt)
+export(is.POSIXt)
+export(is.timepoint)
+export(is.timespan)
+export(leap_year)
+export(m)
export(make_difftime)
-export(subtract_dates)
-export(ymd, myd, dym, ydm, mdy, dmy)
-export(ymd_hms, ymd_hm, ymd_h, dmy_hms, dmy_hm, dmy_h, mdy_hms, mdy_hm, mdy_h, ydm_hms, ydm_hm, ydm_h, ymdThms)
+export(mday)
+export(mdy_h)
+export(mdy_hm)
+export(mdy_hms)
+export(mdy)
+export(microseconds)
+export(milliseconds)
+export(minute)
+export(minutes)
+export(month)
export(ms)
-export(hm)
-export(hms)
-export(parse_date)
+export(myd)
+export(nanoseconds)
+export(new_difftime)
+export(new_duration)
+export(new_interval)
export(new_period)
-S3method("%/%", period)
-S3method("%%", period)
-S3method("/", period)
-S3method("*", period)
-S3method("+", period)
-S3method("-", period)
-S3method(rep, period)
-S3method(print, period)
-S3method(format, period)
-S3method(c, period)
-export(seconds, minutes, hours, days, weeks, years, y, m, w, d, milliseconds, microseconds, microseconds, nanoseconds, picoseconds)
-S3method(months, numeric)
-S3method(months, integer)
-export(as.period)
-S3method(as.period, default)
-S3method(as.period, difftime)
-S3method(as.period, interval)
-S3method(as.period, duration)
-export(pretty.dates, pretty.unit, pretty.sec, pretty.min, pretty.hour, pretty.day, pretty.month, pretty.year, pretty.point)
-export(floor_date)
-export(ceiling_date)
-export(round_date)
-export(leap_year)
export(now)
+export(origin)
+export(parse_date)
+export(picoseconds)
+export(pm)
+export(pretty.dates)
+export(pretty.day)
+export(pretty.hour)
+export(pretty.min)
+export(pretty.month)
+export(pretty.point)
+export(pretty.sec)
+export(pretty.unit)
+export(pretty.year)
+export(reclass_date)
+export(round_date)
+export(second)
+export(seconds)
+export(subtract_dates)
export(today)
-export(am, pm)
+export(tz)
+export(w)
+export(wday)
+export(week)
+export(weeks)
export(with_tz)
-export(force_tz)
-export(origin)
-export(decimal_date)
-S3method(decimal_date, default)
-S3method(decimal_date, zoo)
-S3method(decimal_date, its)
+export(y)
+export(yday)
+export(ydm_h)
+export(ydm_hm)
+export(ydm_hms)
+export(ydm)
+export(year)
+export(years)
+export(ymd_h)
+export(ymd_hm)
+export(ymd_hms)
+export(ymd)
+export(ymdThms)
+import(plyr)
+import(stringr)
+S3method("-",duration)
+S3method("-",interval)
+S3method("-",period)
+S3method("[",interval)
+S3method("*",duration)
+S3method("*",interval)
+S3method("*",period)
+S3method("/",duration)
+S3method("/",interval)
+S3method("/",period)
+S3method("%/%",difftime)
+S3method("%/%",duration)
+S3method("%/%",interval)
+S3method("%/%",period)
+S3method("%%",difftime)
+S3method("%%",duration)
+S3method("%%",interval)
+S3method("%%",period)
+S3method("+",duration)
+S3method("+",interval)
+S3method("+",period)
+S3method(as.duration,default)
+S3method(as.duration,difftime)
+S3method(as.duration,interval)
+S3method(as.duration,period)
+S3method(as.period,default)
+S3method(as.period,difftime)
+S3method(as.period,duration)
+S3method(as.period,interval)
+S3method(as.POSIXct,fts)
+S3method(as.POSIXct,irts)
+S3method(as.POSIXct,its)
+S3method(as.POSIXct,timeSeries)
+S3method(as.POSIXct,xts)
+S3method(as.POSIXct,zoo)
+S3method(as.POSIXlt,fts)
+S3method(as.POSIXlt,irts)
+S3method(as.POSIXlt,its)
+S3method(as.POSIXlt,timeSeries)
+S3method(as.POSIXlt,tis)
+S3method(as.POSIXlt,xts)
+S3method(as.POSIXlt,zoo)
+S3method(c,difftime)
+S3method(c,duration)
+S3method(c,interval)
+S3method(c,period)
+S3method(decimal_date,default)
+S3method(decimal_date,its)
+S3method(decimal_date,zoo)
+S3method(dst,default)
+S3method(format,duration)
+S3method(format,interval)
+S3method(format,period)
+S3method(hour,default)
+S3method(mday,default)
+S3method(minute,default)
+S3method(month,default)
+S3method(months,integer)
+S3method(months,numeric)
+S3method(print,duration)
+S3method(print,interval)
+S3method(print,period)
+S3method(reclass_date,chron)
+S3method(reclass_date,Date)
+S3method(reclass_date,its)
+S3method(reclass_date,POSIXct)
+S3method(reclass_date,POSIXlt)
+S3method(reclass_date,ti)
+S3method(reclass_date,timeDate)
+S3method(rep,duration)
+S3method(rep,interval)
+S3method(rep,period)
+S3method(second,default)
+S3method(tz,default)
+S3method(tz,irts)
+S3method(tz,timeSeries)
+S3method(tz,zoo)
+S3method(update,Date)
+S3method(update,POSIXct)
+S3method(update,POSIXlt)
+S3method(wday,default)
+S3method(wday,numeric)
+S3method(yday,default)
+S3method(year,default)
View
2  R/help.r
@@ -149,5 +149,5 @@
#' @import plyr stringr
#' @docType package
#' @name lubridate
-#' @aliases lubridate package-lubridate
+#' @aliases lubridate lubridate-package
NULL
View
4 man/DateCoercion.Rd
@@ -1,9 +1,9 @@
\name{DateCoercion}
\alias{DateCoercion}
-\title{Convert every date method we know about to POSIXlt and POSIXct...}
-
+\title{Convert every date method we know about to POSIXlt and POSIXct}
\description{
Convert every date method we know about to POSIXlt and
POSIXct
}
\keyword{internal}
+
View
78 man/DateUpdate.Rd
@@ -1,40 +1,58 @@
\name{DateUpdate}
\alias{DateUpdate}
-\title{Changes the components of a date object...}
+\title{Changes the components of a date object}
+\arguments{
+ \item{object}{a date-time object}
-\description{
- Changes the components of a date object
-}
+ \item{years}{a value to substitute for the date's year
+ component}
+
+ \item{months}{a value to substitute for the date's month
+ component}
+
+ \item{ydays}{a value to substitute for the date's yday
+ component}
+
+ \item{wdays}{a value to substitute for the date's wday
+ component}
-\details{
+ \item{mdays}{a value to substitute for the date's mday
+ component}
+
+ \item{days}{a value to substitute for the date's mday
+ component}
+
+ \item{hours}{a value to substitute for the date's hour
+ component}
+
+ \item{minutes}{a value to substitute for the date's
+ minute component}
+
+ \item{seconds}{a value to substitute for the date's
+ second component}
+
+ \item{tzs}{a value to substitute for the date's tz
+ component}
+
+ \item{...}{...}
+}
+\value{
+ a date object with the requested elements updated. The
+ object will retain its original class unless an element
+ is updated which the original class does not support. In
+ this case, the date returned will be a POSIXlt date
+ object.
+}
+\description{
update.Date and update.POSIXt return a date with the
- specified elements updated. Elements not specified will
+ specified elements updated. Elements not specified will
be left unaltered. update.Date and update.POSIXt do not
add the specified values to the existing date, they
substitute them for the appropriate parts of the existing
date.
}
-\value{a date object with the requested elements updated. The object will
-retain its original class unless an element is updated which the original
-class does not support. In this case, the date returned will be a POSIXlt
-date object.}
-\keyword{manip}
-\keyword{chron}
-\arguments{
- \item{object}{a date-time object}
- \item{years}{a value to substitute for the date's year component}
- \item{months}{a value to substitute for the date's month component}
- \item{ydays}{a value to substitute for the date's yday component}
- \item{wdays}{a value to substitute for the date's wday component}
- \item{mdays}{a value to substitute for the date's mday component}
- \item{days}{a value to substitute for the date's mday component}
- \item{hours}{a value to substitute for the date's hour component}
- \item{minutes}{a value to substitute for the date's minute component}
- \item{seconds}{a value to substitute for the date's second component}
- \item{tzs}{a value to substitute for the date's tz component}
- \item{...}{...}
-}
-\examples{date <- as.POSIXlt("2009-02-10")
+\examples{
+date <- as.POSIXlt("2009-02-10")
update(date, year = 2010, month = 1, mday = 1)
# "2010-01-01 CST"
@@ -42,4 +60,8 @@ update(date, year =2010, month = 13, mday = 1)
# "2011-01-01 CST"
update(date, minute = 10, second = 3)
-# "2009-02-10 00:10:03 CST"}
+# "2009-02-10 00:10:03 CST"
+}
+\keyword{chron}
+\keyword{manip}
+
View
19 man/add_dates.Rd
@@ -1,19 +1,18 @@
\name{add_dates}
\alias{add_dates}
-\title{Adding date-time objects...}
-\usage{add_dates(e1, e2)}
-
-\description{
- Adding date-time objects
+\title{Adding date-time objects}
+\usage{
+ add_dates(e1, e2)
}
+\arguments{
+ \item{e1}{a numeric or date-time object}
-\details{
+ \item{e2}{a numeric or date-time object}
+}
+\description{
add_dates adds two objects, both of which can be
date-time objects. Lubridate is built so that you don't
need to use add_dates but can use regular math
expressions instead.
}
-\arguments{
- \item{e1}{a numeric or date-time object}
- \item{e2}{a numeric or date-time object}
-}
+
View
26 man/add_epoch_to_date.Rd
@@ -1,18 +1,22 @@
\name{add_epoch_to_date}
\alias{add_epoch_to_date}
-\title{Add epochs to dates...}
-\usage{add_epoch_to_date(date, epoch)}
-
-\description{
- Add epochs to dates
+\title{Add epochs to dates}
+\usage{
+ add_epoch_to_date(date, epoch)
}
+\arguments{
+ \item{date}{a date-time object to be used as the
+ reference time from which future epochs will be counted}
-\details{
+ \item{epoch}{an epoch object that decribes the number and
+ type of epochs to be used to define a new date-time}
+}
+\value{
+ the date-time that occurs that specified number of epochs
+ after the original date-time
+}
+\description{
Method for adding epochs to dates. Epochs will be
implemented in a later version of lubridate.
}
-\value{the date-time that occurs that specified number of epochs after the original date-time}
-\arguments{
- \item{date}{a date-time object to be used as the reference time from which future epochs will be counted}
- \item{epoch}{an epoch object that decribes the number and type of epochs to be used to define a new date-time}
-}
+
View
29 man/am.Rd
@@ -1,17 +1,24 @@
\name{am}
-\title{Does date time occur in the am or pm?}
-\usage{am(x)}
-
-\description{
- Does date time occur in the am or pm?
-}
\alias{am}
\alias{pm}
-\value{TRUE or FALSE depending on whethe x occurs in the am or pm}
-\keyword{chron}
+\title{Does date time occur in the am or pm?}
+\usage{
+ am(x)
+}
\arguments{
\item{x}{a date-time object}
}
-\examples{x <- now()
-am(x)
-pm(x)}
+\value{
+ TRUE or FALSE depending on whethe x occurs in the am or
+ pm
+}
+\description{
+ Does date time occur in the am or pm?
+}
+\examples{
+x <- now()
+am(x)
+pm(x)
+}
+\keyword{chron}
+
View
43 man/as.duration.Rd
@@ -1,18 +1,22 @@
\name{as.duration}
\alias{as.duration}
\title{Change an object to a duration (difftime).}
-\usage{as.duration(x)}
-
-\description{
- Change an object to a duration (difftime).
+\usage{
+ as.duration(x)
}
-
-\details{
+\arguments{
+ \item{x}{an interval, period, or numeric object}
+}
+\value{
+ a duration object
+}
+\description{
as.duration changes interval, period and numeric objects
to duration objects. Numeric objects are changed to
duration objects with the seconds unit equal to the
numeric value.
-
+}
+\details{
Durations are exact time measurements, whereas periods
are relative time measurements. See
\code{\link{periods}}. The length of a period depends on
@@ -26,18 +30,19 @@
transformation, first transform the period to an interval
with \code{\link{as.interval}}.
}
-\value{a duration object}
-\seealso{\code{\link{duration}}, \code{\link{new_duration}}}
-\keyword{classes}
-\keyword{manip}
-\keyword{methods}
-\keyword{chron}
-\arguments{
- \item{x}{an interval, period, or numeric object}
-}
-\examples{span <- new_interval(ymd("2009-01-01"), ymd("2009-08-01")) #interval
-# 2009-01-01 -- 2009-08-01
+\examples{
+span <- new_interval(ymd("2009-01-01"), ymd("2009-08-01")) #interval
+# 2009-01-01 -- 2009-08-01
as.duration(span)
# 18316800s (212d)
as.duration(10) # numeric
-# 10s}
+# 10s
+}
+\seealso{
+ \code{\link{duration}}, \code{\link{new_duration}}
+}
+\keyword{chron}
+\keyword{classes}
+\keyword{manip}
+\keyword{methods}
+
View
47 man/as.interval.Rd
@@ -1,18 +1,26 @@
\name{as.interval}
\alias{as.interval}
\title{Change an object to an interval.}
-\usage{as.interval(x, start)}
-
-\description{
- Change an object to an interval.
+\usage{
+ as.interval(x, start)
}
+\arguments{
+ \item{x}{a duration (i.e. difftime), period, or numeric
+ object that describes the length of the interval}
-\details{
+ \item{start}{a POSIXt or Date object that describes when
+ the interval begins}
+}
+\value{
+ an interval object
+}
+\description{
as.interval changes difftime, duration, period and
numeric objects to intervals that begin at the specified
date-time. Numeric objects are first coerced to time
spans equal to the numeric value in seconds.
-
+}
+\details{
as.interval can be used to create accurate
transformations between period objects, which measure
time spans in variable length units, and difftime
@@ -23,18 +31,8 @@
lasted for during the time span described. See
\code{\link{as.duration}}, \code{\link{as.period}}.
}
-\value{an interval object}
-\seealso{\code{\link{interval}}, \code{\link{new_interval}}}
-\keyword{classes}
-\keyword{manip}
-\keyword{methods}
-\keyword{chron}
-\arguments{
- \item{x}{a duration (i.e. difftime), period, or numeric object that describes the length of the
-interval}
- \item{start}{a POSIXt or Date object that describes when the interval begins}
-}
-\examples{diff <- new_difftime(days = 31) #difftime
+\examples{
+diff <- new_difftime(days = 31) #difftime
as.interval(diff, ymd("2009-01-01"))
# 2009-01-01 -- 2009-02-01
as.interval(diff, ymd("2009-02-01"))
@@ -48,9 +46,18 @@ as.interval(dur, ymd("2009-02-01"))
per <- new_period(months = 1) #period
as.interval(per, ymd("2009-01-01"))
-# 2009-01-01 -- 2009-02-01
+# 2009-01-01 -- 2009-02-01
as.interval(per, ymd("2009-02-01"))
# 2009-02-01 -- 2009-03-01
as.interval(3600, ymd("2009-01-01")) #numeric
-# 2009-01-01 -- 2009-01-01 01:00:00}
+# 2009-01-01 -- 2009-01-01 01:00:00
+}
+\seealso{
+ \code{\link{interval}}, \code{\link{new_interval}}
+}
+\keyword{chron}
+\keyword{classes}
+\keyword{manip}
+\keyword{methods}
+
View
39 man/as.period.Rd
@@ -1,17 +1,21 @@
\name{as.period}
\alias{as.period}
\title{Change an object to a period.}
-\usage{as.period(x)}
-
-\description{
- Change an object to a period.
+\usage{
+ as.period(x)
}
-
-\details{
+\arguments{
+ \item{x}{an interval, difftime, or numeric object}
+}
+\value{
+ a period object
+}
+\description{
as.period changes interval, duration (i.e., difftime) and
numeric objects to period objects with the specified
units.
-
+}
+\details{
Users must specify which time units to measure the period
in. The length of each time unit in a period depends on
when it occurs. See \code{\link{periods}}. The choice of
@@ -34,16 +38,17 @@
first transform the duration to an interval with
\code{\link{as.interval}}.
}
-\value{a period object}
-\seealso{\code{\link{period}}, \code{\link{new_period}}}
+\examples{
+span <- new_interval(as.POSIXct("2009-01-01"), as.POSIXct("2010-02-02 01:01:01")) #interval
+# [1] 2009-01-01 -- 2010-02-02 01:01:01
+as.period(span)
+# 1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second
+}
+\seealso{
+ \code{\link{period}}, \code{\link{new_period}}
+}
+\keyword{chron}
\keyword{classes}
\keyword{manip}
\keyword{methods}
-\keyword{chron}
-\arguments{
- \item{x}{an interval, difftime, or numeric object}
-}
-\examples{span <- new_interval(as.POSIXct("2009-01-01"), as.POSIXct("2010-02-02 01:01:01")) #interval
-# [1] 2009-01-01 -- 2010-02-02 01:01:01
-as.period(span)
-# 1 year, 1 month, 1 day, 1 hour, 1 minute and 1 second}
+
View
41 man/ceiling_date.Rd
@@ -1,29 +1,29 @@
\name{ceiling_date}
\alias{ceiling_date}
\title{Round date-times up.}
-\usage{ceiling_date(x, unit=c("second", "minute", "hour", "day",
- "week", "month", "year"))}
-
-\description{
- Round date-times up.
+\usage{
+ ceiling_date(x,
+ unit = c("second", "minute", "hour", "day", "week", "month", "year"))
}
+\arguments{
+ \item{x}{a vector of date-time objects}
-\details{
+ \item{unit}{a character string specifying the time unit
+ to be rounded to. Should be one of
+ "second","minute","hour","day", "week", "month", or
+ "year."}
+}
+\value{
+ x with the appropriate units rounded up
+}
+\description{
ceiling_date takes a date-time object and rounds it up to
the nearest integer value of the specified time unit.
Users can specify whether to round up to the nearest
second, minute, hour, day, week, month, or year.
}
-\value{x with the appropriate units rounded up}
-\seealso{\code{\link{floor_date}}, \code{\link{round_date}}}
-\keyword{manip}
-\keyword{chron}
-\arguments{
- \item{x}{a vector of date-time objects}
- \item{unit}{a character string specifying the time unit to be rounded to. Should be one of
-"second","minute","hour","day", "week", "month", or "year."}
-}
-\examples{x <- as.POSIXct("2009-08-03 12:01:59.23")
+\examples{
+x <- as.POSIXct("2009-08-03 12:01:59.23")
ceiling_date(x, "second")
# "2009-08-03 12:02:00 CDT"
ceiling_date(x, "minute")
@@ -37,4 +37,11 @@ ceiling_date(x, "week")
ceiling_date(x, "month")
# "2009-09-01 CDT"
ceiling_date(x, "year")
-# "2010-01-01 CST"}
+# "2010-01-01 CST"
+}
+\seealso{
+ \code{\link{floor_date}}, \code{\link{round_date}}
+}
+\keyword{chron}
+\keyword{manip}
+
View
25 man/decimal_date.Rd
@@ -1,17 +1,24 @@
\name{decimal_date}
\alias{decimal_date}
\title{Converts a date to a decimal of its year.}
-\usage{decimal_date(date)}
-
+\usage{
+ decimal_date(date)
+}
+\arguments{
+ \item{date}{a POSIXt or Date object}
+}
+\value{
+ a numeric object where the date is expressed as a
+ fraction of its year
+}
\description{
Converts a date to a decimal of its year.
}
-\value{a numeric object where the date is expressed as a fraction of its year}
-\keyword{manip}
+\examples{
+date <- as.POSIXlt("2009-02-10")
+decimal_date(date) # 2009.109
+}
\keyword{chron}
+\keyword{manip}
\keyword{methods}
-\arguments{
- \item{date}{a POSIXt or Date object}
-}
-\examples{date <- as.POSIXlt("2009-02-10")
-decimal_date(date) # 2009.109}
+
View
95 man/dseconds.Rd
@@ -1,74 +1,73 @@
\name{dseconds}
+\alias{ddays}
+\alias{dhours}
+\alias{dmicroseconds}
+\alias{dmilliseconds}
+\alias{dminutes}
+\alias{dnanoseconds}
+\alias{dpicoseconds}
+\alias{dseconds}
+\alias{dweeks}
+\alias{dyears}
+\alias{edays}
+\alias{ehours}
+\alias{emicroseconds}
+\alias{emilliseconds}
+\alias{eminutes}
+\alias{enanoseconds}
+\alias{epicoseconds}
+\alias{eseconds}
+\alias{eweeks}
+\alias{eyears}
\title{Quickly create exact time spans.}
-\usage{dseconds(x=1)}
-
-\description{
- Quickly create exact time spans.
+\usage{
+ dseconds(x = 1)
}
-
-\details{
+\arguments{
+ \item{x}{numeric value of the number of units to be
+ contained in the duration.}
+}
+\value{
+ a duration object
+}
+\description{
Quickly create duration objects for easy date-time
manipulation. The units of the duration created depend on
the name of the function called. For duration objects,
units are equal to their most common lengths in seconds
- (i.e. minutes = 60 seconds, hours = 3600 seconds, days =
+ (i.e. minutes = 60 seconds, hours = 3600 seconds, days =
86400 seconds, weeks = 604800, years = 31536000).
-
+}
+\details{
When paired with date-times, these functions allow
date-times to be manipulated in a method similar to
object oriented programming. Duration objects can be
added to Date, POSIXt, and Interval objects.
}
-\alias{eseconds}
-\alias{eminutes}
-\alias{ehours}
-\alias{edays}
-\alias{eweeks}
-\alias{eyears}
-\alias{dseconds}
-\alias{dminutes}
-\alias{dhours}
-\alias{ddays}
-\alias{dweeks}
-\alias{dyears}
-\alias{dmilliseconds}
-\alias{emilliseconds}
-\alias{dmicroseconds}
-\alias{emicroseconds}
-\alias{dnanoseconds}
-\alias{enanoseconds}
-\alias{dpicoseconds}
-\alias{epicoseconds}
-\value{a duration object}
-\seealso{\code{\link{duration}}, \code{\link{new_duration}}, \code{\link{days}}}
-\keyword{chron}
-\keyword{manip}
-\arguments{
- \item{x}{numeric value of the number of units to be contained in the duration.}
-}
-\examples{dseconds(1)
+\examples{
+dseconds(1)
# 1s
-dminutes(3.5)
+dminutes(3.5)
# 210s
-x <- as.POSIXct("2009-08-03")
+x <- as.POSIXct("2009-08-03")
# "2009-08-03 CDT"
x + ddays(1) + dhours(6) + dminutes(30)
# "2009-08-04 06:30:00 CDT"
-x + ddays(100) - dhours(8)
+x + ddays(100) - dhours(8)
# "2009-11-10 15:00:00 CST"
class(as.Date("2009-08-09") + ddays(1)) # retains Date class
# "Date"
-as.Date("2009-08-09") + dhours(12)
+as.Date("2009-08-09") + dhours(12)
# "2009-08-09 12:00:00 UTC"
-class(as.Date("2009-08-09") + dhours(12))
+class(as.Date("2009-08-09") + dhours(12))
# "POSIXt" "POSIXct"
# converts to POSIXt class to accomodate time units
-dweeks(1) - ddays(7)
+dweeks(1) - ddays(7)
# 0s
-c(1:3) * dhours(1)
+c(1:3) * dhours(1)
# 3600s 7200s 10800s
#
# compare DST handling to durations
@@ -77,4 +76,12 @@ boundary <- as.POSIXct("2009-03-08 01:59:59")
boundary + days(1) # period
# "2009-03-09 01:59:59 CDT" (clock time advances by a day)
boundary + ddays(1) # duration
-# "2009-03-09 02:59:59 CDT" (clock time corresponding to 86400 seconds later)}
+# "2009-03-09 02:59:59 CDT" (clock time corresponding to 86400 seconds later)
+}
+\seealso{
+ \code{\link{duration}}, \code{\link{new_duration}},
+ \code{\link{days}}
+}
+\keyword{chron}
+\keyword{manip}
+
View
32 man/dst.Rd
@@ -1,27 +1,31 @@
\name{dst}
\alias{dst}
\title{Get Daylight Savings Time indicator of a date-time.}
-\usage{dst(x)}
-
-\description{
- Get Daylight Savings Time indicator of a date-time.
+\usage{
+ dst(x)
}
-
-\details{
+\arguments{
+ \item{x}{a date-time object}
+}
+\value{
+ Daylight savings time flag. Positive if in force, zero if
+ not, negative if unknown.
+}
+\description{
Date-time must be a POSIXct, POSIXlt, Date, chron,
yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti,
jul, timeSeries, and fts objects.
-
+}
+\details{
A date-time's daylight savings flag can not be set
because it depends on the date-time's year, month, day,
and hour values.
}
-\value{Daylight savings time flag. Positive if in force, zero if not, negative if unknown.}
-\keyword{utilities}
+\examples{
+x <- now()
+dst(x)
+}
\keyword{chron}
\keyword{methods}
-\arguments{
- \item{x}{a date-time object}
-}
-\examples{x <- now()
-dst(x)}
+\keyword{utilities}
+
View
62 man/duration.Rd
@@ -1,19 +1,23 @@
\name{duration}
+\alias{dur}
+\alias{duration}
+\alias{durations}
+\alias{interval}
+\alias{intervals}
+\alias{period}
+\alias{periods}
+\alias{timespans}
\title{Description of time span classes in lubridate.}
-
\description{
- Description of time span classes in lubridate.
-}
-
-\details{
A time span can be measured in three ways: as a duration,
an interval, or a period.
-
+}
+\details{
Durations record the exact number of seconds in a time
span. They measure the exact passage of time but do not
always align with measurements made in larger units of
- time such as hours, months and years. This is because
- the length of larger time units can be affected by
+ time such as hours, months and years. This is because the
+ length of larger time units can be affected by
conventions such as leap years and Daylight Savings Time.
Base R measures durations with the difftime class.
lubridate provides an additional class, the duration
@@ -35,7 +39,7 @@
\code{\link{dhours}}, \code{\link{dminutes}} and
\code{\link{dseconds}}. These objects can be added to and
subtracted from date- times to create a user interface
- similar to object oriented programming. Duration objects
+ similar to object oriented programming. Duration objects
can be added to Date, POSIXt, and Interval objects.
Periods record the change in the clock time between two
@@ -73,24 +77,11 @@
automatically creates an interval object. An interval
displays as the start and end points of the time span it
represents. By default, the #' date-time that occurs
- first is considered the start point. Hence, intervals
- are always positive.
+ first is considered the start point. Hence, intervals are
+ always positive.
}
-\alias{duration}
-\alias{durations}
-\alias{dur}
-\alias{periods}
-\alias{period}
-\alias{interval}
-\alias{intervals}
-\alias{timespans}
-\seealso{\code{\link{new_duration}} for creating duration objects and
-\code{\link{as.duration}} for converting objects into durations,
-\code{\link{new_interval}} for creating interval objects and
-\code{\link[lubridate]{as.interval}} for converting objects to intervals}
-\keyword{classes}
-\keyword{chron}
-\examples{new_duration(second = 3690)
+\examples{
+new_duration(second = 3690)
# 3690s (1.02h)
new_period(second = 3690)
# 3690 seconds
@@ -108,7 +99,7 @@ date + edays(1)
date2 <- as.POSIXct("2000-02-29 12:00:00")
date2 + years(1)
-# "2001-02-28 12:00:00 CST"
+# "2001-02-28 12:00:00 CST"
# self corrects to most recent real day
date3 <- as.POSIXct("2009-01-31 01:00:00")
@@ -120,14 +111,14 @@ date3 + c(0:11) * months(1)
# [9] "2009-09-30 01:00:00 CDT" "2009-10-31 01:00:00 CDT"
#[11] "2009-11-30 01:00:00 CST" "2009-12-31 01:00:00 CST"
-span <- date2 - date #creates interval
+span <- date2 - date #creates interval
# 2000-02-29 12:00:00 -- 2009-03-08 01:59:59
span - days(294)
# 2000-02-29 12:00:00 -- 2008-05-18 01:59:59
span - ddays(294)
# 2000-02-29 12:00:00 -- 2008-05-18 02:59:59
-date <- as.POSIXct("2009-01-01 00:00:00")
+date <- as.POSIXct("2009-01-01 00:00:00")
# "2009-01-01 GMT"
date + years(1)
# "2010-01-01 GMT"
@@ -137,4 +128,15 @@ date + 3 * seconds(10)
# "2009-01-01 00:00:30 GMT"
months(6) + days(1)
-# 6 months and 1 day}
+# 6 months and 1 day
+}
+\seealso{
+ \code{\link{new_duration}} for creating duration objects
+ and \code{\link{as.duration}} for converting objects into
+ durations, \code{\link{new_interval}} for creating
+ interval objects and \code{\link[lubridate]{as.interval}}
+ for converting objects to intervals
+}
+\keyword{chron}
+\keyword{classes}
+
View
41 man/floor_date.Rd
@@ -1,29 +1,29 @@
\name{floor_date}
\alias{floor_date}
\title{Round date-times down.}
-\usage{floor_date(x, unit=c("second", "minute", "hour", "day",
- "week", "month", "year"))}
-
-\description{
- Round date-times down.
+\usage{
+ floor_date(x,
+ unit = c("second", "minute", "hour", "day", "week", "month", "year"))
}
+\arguments{
+ \item{x}{a vector of date-time objects}
-\details{
+ \item{unit}{a character string specifying the time unit
+ to be rounded to. Should be one of
+ "second","minute","hour","day", "week", "month", or
+ "year."}
+}
+\value{
+ x with the appropriate units floored
+}
+\description{
floor_date takes a date-time object and rounds it down to
the nearest integer value of the specified time unit.
Users can specify whether to round down to the nearest
second, minute, hour, day, week, month, or year.
}
-\value{x with the appropriate units floored}
-\seealso{\code{\link{ceiling_date}}, \code{\link{round_date}}}
-\keyword{manip}
-\keyword{chron}
-\arguments{
- \item{x}{a vector of date-time objects}
- \item{unit}{a character string specifying the time unit to be rounded to. Should be one of
-"second","minute","hour","day", "week", "month", or "year."}
-}
-\examples{x <- as.POSIXct("2009-08-03 12:01:59.23")
+\examples{
+x <- as.POSIXct("2009-08-03 12:01:59.23")
floor_date(x, "second")
# "2009-08-03 12:01:59 CDT"
floor_date(x, "minute")
@@ -37,4 +37,11 @@ floor_date(x, "week")
floor_date(x, "month")
# "2009-08-01 CDT"
floor_date(x, "year")
-# "2009-01-01 CST"}
+# "2009-01-01 CST"
+}
+\seealso{
+ \code{\link{ceiling_date}}, \code{\link{round_date}}
+}
+\keyword{chron}
+\keyword{manip}
+
View
41 man/force_tz.Rd
@@ -1,15 +1,23 @@
\name{force_tz}
\alias{force_tz}
-\title{Replace time zone to create new date-time...}
-\usage{force_tz(time, tzone="")}
-
-\description{
- Replace time zone to create new date-time
+\title{Replace time zone to create new date-time}
+\usage{
+ force_tz(time, tzone = "")
}
+\arguments{
+ \item{time}{a POSIXct, POSIXlt, Date, or chron date-time
+ object.}
-\details{
+ \item{tzone}{a character string containing the time zone
+ to convert to. R must recognize the name contained in the
+ string as a time zone on your system.}
+}
+\value{
+ a POSIXct object in the updated time zone
+}
+\description{
force_tz returns a the date-time that has the same clock
- time as x in the new time zone. Although the new
+ time as x in the new time zone. Although the new
date-time has the same clock time (e.g. the same values
in the year, month, days, etc. elements) it is a
different moment of time than the input date-time.
@@ -18,15 +26,14 @@
\code{\link{Sys.timezone}} for more information on how R
recognizes time zones.
}
-\value{a POSIXct object in the updated time zone}
+\examples{
+x <- as.POSIXct("2009-08-07 00:00:01", tz = "America/New_york")
+force_tz(x, "GMT")
+# "2009-08-07 00:00:01 GMT"
+}
+\seealso{
+ \code{\link{force_tz}}
+}
\keyword{chron}
\keyword{manip}
-\seealso{\code{\link{force_tz}}}
-\arguments{
- \item{time}{a POSIXct, POSIXlt, Date, or chron date-time object.}
- \item{tzone}{a character string containing the time zone to convert to. R must recognize the name
-contained in the string as a time zone on your system.}
-}
-\examples{x <- as.POSIXct("2009-08-07 00:00:01", tz = "America/New_york")
-force_tz(x, "GMT")
-# "2009-08-07 00:00:01 GMT"}
+
View
35 man/hm.Rd
@@ -1,29 +1,32 @@
\name{hm}
\alias{hm}
-\title{Create a period with the specified number of hours and minutes...}
-\usage{hm(...)}
-
-\description{
- Create a period with the specified number of hours and
- minutes
+\title{Create a period with the specified number of hours and minutes}
+\usage{
+ hm(...)
}
-
-\details{
+\arguments{
+ \item{...}{a character vector of hour minute pairs}
+}
+\value{
+ a vector of period objects
+}
+\description{
Transforms a character string into a period object with
the specified number of hours and minutes. hm()
recognizes all non-alphanumeric separators of length 1
with the exception of ".".
}
-\value{a vector of period objects}
-\seealso{\code{\link{hms}, \link{ms}}}
-\keyword{period}
-\arguments{
- \item{...}{a character vector of hour minute pairs}
-}
-\examples{x <- c("09:10", "09:02", "1:10")
+\examples{
+x <- c("09:10", "09:02", "1:10")
hm(x)
# [1] 9 hours and 10 minutes 9 hours and 2 minutes 1 hour and 10 minutes
hm("7 6")
# [1] 7 hours and 6 minutes
hm("6,5")
-# [1] 6 hours and 5 minutes}
+# [1] 6 hours and 5 minutes
+}
+\seealso{
+ \code{\link{hms}, \link{ms}}
+}
+\keyword{period}
+
View
36 man/hms.Rd
@@ -1,29 +1,33 @@
\name{hms}
\alias{hms}
-\title{Create a period with the specified hours, minutes, and seconds...}
-\usage{hms(...)}
-
-\description{
- Create a period with the specified hours, minutes, and
- seconds
+\title{Create a period with the specified hours, minutes, and seconds}
+\usage{
+ hms(...)
}
-
-\details{
+\arguments{
+ \item{...}{a character vector of hour minute second
+ triples}
+}
+\value{
+ a vector of period objects
+}
+\description{
Transforms a character string into a period object with
the specified number of hours, minutes, and seconds.
hms() recognizes all non-alphanumeric separators of
length 1 with the exception of ".".
}
-\value{a vector of period objects}
-\seealso{\code{\link{hm}, \link{ms}}}
-\keyword{period}
-\arguments{
- \item{...}{a character vector of hour minute second triples}
-}
-\examples{x <- c("09:10:01", "09:10:02", "09:10:03")
+\examples{
+x <- c("09:10:01", "09:10:02", "09:10:03")
hms(x)
# [1] 9 hours, 10 minutes and 1 second 9 hours, 10 minutes and 2 seconds 9 hours, 10 minutes and 3 seconds
hms("7 6 5")
# [1] 7 hours, 6 minutes and 5 seconds
hms("7,6,5")
-# [1] 7 hours, 6 minutes and 5 seconds}
+# [1] 7 hours, 6 minutes and 5 seconds
+}
+\seealso{
+ \code{\link{hm}, \link{ms}}
+}
+\keyword{period}
+
View
40 man/hour.Rd
@@ -1,28 +1,30 @@
\name{hour}
+\alias{hour}
+\alias{hour<-}
\title{Get/set hours component of a date-time.}
-\usage{hour(x)}
-
-\description{
- Get/set hours component of a date-time.
+\usage{
+ hour(x)
}
-
-\details{
+\arguments{
+ \item{x}{a date-time object}
+}
+\value{
+ the hours element of x as a decimal number
+}
+\description{
Date-time must be a POSIXct, POSIXlt, Date, chron,
yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti,
jul, timeSeries, and fts objects.
}
-\alias{hour}
-\alias{hour<-}
-\keyword{utilities}
-\keyword{manip}
-\keyword{chron}
-\keyword{methods}
-\value{the hours element of x as a decimal number}
-\arguments{
- \item{x}{a date-time object}
-}
-\examples{x <- now()
+\examples{
+x <- now()
hour(x)
hour(x) <- 1
-hour(x) <- 61
-hour(x) > 2}
+hour(x) <- 61
+hour(x) > 2
+}
+\keyword{chron}
+\keyword{manip}
+\keyword{methods}
+\keyword{utilities}
+
View
33 man/int_end.Rd
@@ -1,26 +1,29 @@
\name{int_end}
-\title{Access and change the end date of an interval...}
-\usage{int_end(x)}
-
-\description{
- Access and change the end date of an interval
-}
-
-\details{
- Changing the end date of an interval does not change the
- length of the interval. It shifts when the interval
- occurs.
-}
\alias{int_end}
\alias{int_end<-}
-\value{A POSIXct date object when used as an accessor. Nothing when used as a settor}
+\title{Access and change the end date of an interval}
+\usage{
+ int_end(x)
+}
\arguments{
\item{x}{An interval object}
}
-\examples{int <- new_interval(ymd("2001-01-01"), ymd("2002-01-01"))
+\value{
+ A POSIXct date object when used as an accessor. Nothing
+ when used as a settor
+}
+\description{
+ Changing the end date of an interval does not change the
+ length of the interval. It shifts when the interval
+ occurs.
+}
+\examples{
+int <- new_interval(ymd("2001-01-01"), ymd("2002-01-01"))
# 2001-01-01 -- 2002-01-01
int_end(int)
# "2002-01-01 UTC"
int_end(int) <- ymd("2002-06-01")
int
-# 2001-06-01 -- 2002-06-01}
+# 2001-06-01 -- 2002-06-01
+}
+
View
33 man/int_start.Rd
@@ -1,26 +1,29 @@
\name{int_start}
-\title{Access and change the start date of an interval...}
-\usage{int_start(x)}
-
-\description{
- Access and change the start date of an interval
-}
-
-\details{
- Changing the start date of an interval does not change
- the length of the interval. It shifts when the interval
- occurs.
-}
\alias{int_start}
\alias{int_start<-}
-\value{A POSIXct date object when used as an accessor. Nothing when used as a settor}
+\title{Access and change the start date of an interval}
+\usage{
+ int_start(x)
+}
\arguments{
\item{x}{An interval object}
}
-\examples{int <- new_interval(ymd("2001-01-01"), ymd("2002-01-01"))
+\value{
+ A POSIXct date object when used as an accessor. Nothing
+ when used as a settor
+}
+\description{
+ Changing the start date of an interval does not change
+ the length of the interval. It shifts when the interval
+ occurs.
+}
+\examples{
+int <- new_interval(ymd("2001-01-01"), ymd("2002-01-01"))
# 2001-01-01 -- 2002-01-01
int_start(int)
# "2001-01-01 UTC"
int_start(int) <- ymd("2001-06-01")
int
-# 2001-06-01 -- 2002-06-01}
+# 2001-06-01 -- 2002-06-01
+}
+
View
29 man/is.Date.Rd
@@ -1,17 +1,26 @@
\name{is.Date}
\alias{is.Date}
\title{Is x a Date object?}
-\usage{is.Date(x)}
-
-\description{
- Is x a Date object?
+\usage{
+ is.Date(x)
}
-\value{TRUE if x is a Date object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.POSIXt}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.Date(as.Date("2009-08-03")) # TRUE
-is.Date(difftime(now() + 5, now())) # FALSE}
+\value{
+ TRUE if x is a Date object, FALSE otherwise.
+}
+\description{
+ Is x a Date object?
+}
+\examples{
+is.Date(as.Date("2009-08-03")) # TRUE
+is.Date(difftime(now() + 5, now())) # FALSE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.POSIXt}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
36 man/is.POSIXt.Rd
@@ -1,19 +1,29 @@
\name{is.POSIXt}
+\alias{is.POSIXct}
+\alias{is.POSIXlt}
+\alias{is.POSIXt}
\title{Is x a POSIXct or POSIXlt object?}
-\usage{is.POSIXt(x)}
-
-\description{
- Is x a POSIXct or POSIXlt object?
+\usage{
+ is.POSIXt(x)
}
-\alias{is.POSIXt}
-\alias{is.POSIXlt}
-\alias{is.POSIXct}
-\value{TRUE if x is a POSIXct or POSIXlt object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.Date}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.POSIXt(as.Date("2009-08-03")) # FALSE
-is.POSIXt(as.POSIXct("2009-08-03")) # TRUE}
+\value{
+ TRUE if x is a POSIXct or POSIXlt object, FALSE
+ otherwise.
+}
+\description{
+ Is x a POSIXct or POSIXlt object?
+}
+\examples{
+is.POSIXt(as.Date("2009-08-03")) # FALSE
+is.POSIXt(as.POSIXct("2009-08-03")) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.Date}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
30 man/is.difftime.Rd
@@ -1,18 +1,26 @@
\name{is.difftime}
\alias{is.difftime}
\title{Is x a difftime object?}
-\usage{is.difftime(x)}
-
-\description{
- Is x a difftime object?
+\usage{
+ is.difftime(x)
}
-\value{TRUE if x is a difftime object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.interval}},
-\code{\link{is.period}}.}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.difftime(as.Date("2009-08-03")) # FALSE
-is.difftime(new_difftime(days = 12.4)) # TRUE}
+\value{
+ TRUE if x is a difftime object, FALSE otherwise.
+}
+\description{
+ Is x a difftime object?
+}
+\examples{
+is.difftime(as.Date("2009-08-03")) # FALSE
+is.difftime(new_difftime(days = 12.4)) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.interval}}, \code{\link{is.period}}.
+}
+\keyword{chron}
+\keyword{logic}
+
View
31 man/is.duration.Rd
@@ -1,18 +1,27 @@
\name{is.duration}
\alias{is.duration}
\title{Is x a duration object?}
-\usage{is.duration(x)}
-
-\description{
- Is x a duration object?
+\usage{
+ is.duration(x)
}
-\value{TRUE if x is a duration object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.interval}},
-\code{\link{is.period}}, \code{\link{duration}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.duration(as.Date("2009-08-03")) # FALSE
-is.duration(new_duration(days = 12.4)) # TRUE}
+\value{
+ TRUE if x is a duration object, FALSE otherwise.
+}
+\description{
+ Is x a duration object?
+}
+\examples{
+is.duration(as.Date("2009-08-03")) # FALSE
+is.duration(new_duration(days = 12.4)) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.interval}}, \code{\link{is.period}},
+ \code{\link{duration}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
44 man/is.instant.Rd
@@ -1,27 +1,33 @@
\name{is.instant}
-\title{Is x a date-time object?}
-\usage{is.instant(x)}
-
-\description{
- Is x a date-time object?
-}
-
-\details{
- An instant is a specific moment in time. Most common
- date-time objects (e.g, POSIXct, POSIXlt, and Date
- objects) are instants.
-}
\alias{instant}
\alias{instants}
\alias{is.instant}
-\alias{timepoint}
\alias{is.timepoint}
-\value{TRUE if x is a POSIXct, POSIXlt, or Date object, FALSE otherwise.}
-\seealso{\code{\link{is.timespan}}, \code{\link{is.POSIXt}}, \code{\link{is.Date}}}
-\keyword{logic}
-\keyword{chron}
+\alias{timepoint}
+\title{Is x a date-time object?}
+\usage{
+ is.instant(x)
+}
\arguments{
\item{x}{an R object}
}
-\examples{is.instant(as.Date("2009-08-03")) # TRUE
-is.timepoint(5) # FALSE}
+\value{
+ TRUE if x is a POSIXct, POSIXlt, or Date object, FALSE
+ otherwise.
+}
+\description{
+ An instant is a specific moment in time. Most common
+ date-time objects (e.g, POSIXct, POSIXlt, and Date
+ objects) are instants.
+}
+\examples{
+is.instant(as.Date("2009-08-03")) # TRUE
+is.timepoint(5) # FALSE
+}
+\seealso{
+ \code{\link{is.timespan}}, \code{\link{is.POSIXt}},
+ \code{\link{is.Date}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
31 man/is.interval.Rd
@@ -1,18 +1,27 @@
\name{is.interval}
\alias{is.interval}
\title{Is x an interval object?}
-\usage{is.interval(x)}
-
-\description{
- Is x an interval object?
+\usage{
+ is.interval(x)
}
-\value{TRUE if x is an interval object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.period}},
-\code{\link{is.duration}}, \code{\link{interval}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.interval(new_period(months= 1, days = 15)) # FALSE
-is.interval(new_interval(ymd(20090801), ymd(20090809))) # TRUE}
+\value{
+ TRUE if x is an interval object, FALSE otherwise.
+}
+\description{
+ Is x an interval object?
+}
+\examples{
+is.interval(new_period(months= 1, days = 15)) # FALSE
+is.interval(new_interval(ymd(20090801), ymd(20090809))) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.period}}, \code{\link{is.duration}},
+ \code{\link{interval}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
31 man/is.period.Rd
@@ -1,18 +1,27 @@
\name{is.period}
\alias{is.period}
\title{Is x a period object?}
-\usage{is.period(x)}
-
-\description{
- Is x a period object?
+\usage{
+ is.period(x)
}
-\value{TRUE if x is a period object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.timespan}}, \code{\link{is.interval}},
-\code{\link{is.duration}}, \code{\link{period}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.period(as.Date("2009-08-03")) # FALSE
-is.period(new_period(months= 1, days = 15)) # TRUE}
+\value{
+ TRUE if x is a period object, FALSE otherwise.
+}
+\description{
+ Is x a period object?
+}
+\examples{
+is.period(as.Date("2009-08-03")) # FALSE
+is.period(new_period(months= 1, days = 15)) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.timespan}},
+ \code{\link{is.interval}}, \code{\link{is.duration}},
+ \code{\link{period}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
33 man/is.timespan.Rd
@@ -1,17 +1,28 @@
\name{is.timespan}
+\alias{is.timespan}
\title{Is x a length of time?}
-\usage{is.timespan(x)}
-
-\description{
- Is x a length of time?
+\usage{
+ is.timespan(x)
}
-\alias{is.timespan}
-\value{TRUE if x is a period, interval, duration, or difftime object, FALSE otherwise.}
-\seealso{\code{\link{is.instant}}, \code{\link{is.duration}}, \code{\link{is.difftime}}, \code{\link{is.period}}, \code{\link{is.interval}}}
-\keyword{logic}
-\keyword{chron}
\arguments{
\item{x}{an R object}
}
-\examples{is.timespan(as.Date("2009-08-03")) # FALSE
-is.timespan(new_duration(second = 1)) # TRUE}
+\value{
+ TRUE if x is a period, interval, duration, or difftime
+ object, FALSE otherwise.
+}
+\description{
+ Is x a length of time?
+}
+\examples{
+is.timespan(as.Date("2009-08-03")) # FALSE
+is.timespan(new_duration(second = 1)) # TRUE
+}
+\seealso{
+ \code{\link{is.instant}}, \code{\link{is.duration}},
+ \code{\link{is.difftime}}, \code{\link{is.period}},
+ \code{\link{is.interval}}
+}
+\keyword{chron}
+\keyword{logic}
+
View
15 man/lakers.Rd
@@ -1,12 +1,8 @@
+\docType{data}
\name{lakers}
\alias{lakers}
-\title{Lakers 2008-2009 basketball data set...}
-
+\title{Lakers 2008-2009 basketball data set}
\description{
- Lakers 2008-2009 basketball data set
-}
-
-\details{
This data set contains play by play statistics of each
Los Angeles Lakers basketball game in the 2008-2009
season. Data includes the date, opponent, and type of
@@ -17,6 +13,9 @@
play, and the location on the court where each play was
made.
}
-\docType{data}
-\references{\url{http://www.basketballgeek.com/data/}}
+\references{
+ \url{http://www.basketballgeek.com/data/}
+}
\keyword{data}
+\keyword{dataset}
+
View
30 man/leap_year.Rd
@@ -1,27 +1,29 @@
\name{leap_year}
\alias{leap_year}
\title{Is a year a leap year?}
-\usage{leap_year(date)}
-
-\description{
- Is a year a leap year?
+\usage{
+ leap_year(date)
}
-
-\details{
+\arguments{
+ \item{date}{a date-time object or a year}
+}
+\value{
+ TRUE if x is a leap year, FALSE otherwise
+}
+\description{
If x is a recognized date-time object, leap_year will
return whether x occurs during a leap year. If x is a
number, leap_year returns whether it would be a leap year
under the Gregorian calendar.
}
-\value{TRUE if x is a leap year, FALSE otherwise}
-\keyword{logic}
-\keyword{chron}
-\arguments{
- \item{date}{a date-time object or a year}
-}
-\examples{x <- as.Date("2009-08-02")
+\examples{
+x <- as.Date("2009-08-02")
leap_year(x) # FALSE
leap_year(2009) # FALSE
leap_year(2008) # TRUE
leap_year(1900) # FALSE
-leap_year(2000) # TRUE}
+leap_year(2000) # TRUE
+}
+\keyword{chron}
+\keyword{logic}
+
View
44 man/lubridate.Rd
@@ -1,16 +1,15 @@
+\docType{package}
\name{lubridate}
-\title{Dates and times made easy with lubridate...}
-
+\alias{lubridate}
+\alias{lubridate-package}
+\title{Dates and times made easy with lubridate}
\description{
- Dates and times made easy with lubridate
-}
-
-\details{
Lubridate provides tools that make it easier to parse and
manipulate dates. These tools are grouped below by common
purpose. More information about each function can be
found in #' its help documentation.
-
+}
+\details{
Parsing dates
Lubridate's parsing functions read strings into R as
@@ -41,12 +40,12 @@
instants. \code{\link{is.Date}} tests whether an object
inherits from the Date class. \code{\link{is.POSIXt}}
tests whether an object inherits from the POSIXlt or
- POSIXct classes. \code{\link{is.instant}} tests whether
+ POSIXct classes. \code{\link{is.instant}} tests whether
an object inherits from any of the three classes.
\code{\link{now}} returns the current system time as a
POSIXct object. \code{\link{today}} returns the current
- system date. For convenience, 1970-01-01 00:00:00 is
+ system date. For convenience, 1970-01-01 00:00:00 is
saved to \code{\link{origin}}. This is the instant from
which POSIXct times are calculated from.
@@ -59,10 +58,10 @@
\code{\link{mday}}, \code{\link{wday}},
\code{\link{week}}, \code{\link{month}},
\code{\link{year}}, \code{\link{tz}}, and
- \code{\link{dst}}. Note: the accessor functions are
- named after the singular form of an element. They
- shouldn't be confused with the period helper functions
- that have the plural form of the units as a name (e.g,
+ \code{\link{dst}}. Note: the accessor functions are named
+ after the singular form of an element. They shouldn't be
+ confused with the period helper functions that have the
+ plural form of the units as a name (e.g,
\code{\link{seconds}}).
Rounding dates
@@ -77,7 +76,7 @@
time zones. \code{\link{with_tz}} changes the time zone
in which an instant is displayed. The clock time
displayed for the instant changes, but the moment of time
- described remains the same. \code{\link{force_tz}}
+ described remains the same. \code{\link{force_tz}}
changes only the time zone element of an instant. The
clock time displayed remains the same, but the resulting
instant describes a new moment of time.
@@ -87,8 +86,8 @@
A timespan is a length of time that may or not be
connected to a particular instant. For example, three
months or an hour and a half. Base R uses difftime class
- objects to record timespans. Lubridate creates three
- more timespan classes, \code{\link{intervals}},
+ objects to record timespans. Lubridate creates three more
+ timespan classes, \code{\link{intervals}},
\code{\link{periods}} and \code{\link{durations}}, to
better navigate the nuances of time.
\code{\link{is.difftime}} tests whether an object
@@ -157,9 +156,10 @@
data set that contains information about the Los Angeles
Lakers 2008-2009 basketball season.
}
-\references{Garrett Grolemund, Hadley Wickham (2011). Dates and Times Made
-Easy with lubridate. Journal of Statistical Software, 40(3), 1-25.
-\url{http://www.jstatsoft.org/v40/i03/}.}
-\docType{package}
-\alias{lubridate}
-\alias{package-lubridate}
+\references{
+ Garrett Grolemund, Hadley Wickham (2011). Dates and Times
+ Made Easy with lubridate. Journal of Statistical
+ Software, 40(3), 1-25.
+ \url{http://www.jstatsoft.org/v40/i03/}.
+}
+
View
27 man/make_difftime.Rd
@@ -1,16 +1,23 @@
\name{make_difftime}
\alias{make_difftime}
-\title{Makes a difftime object from a given number of seconds...}
-\usage{make_difftime(x)}
-
-\description{
- Makes a difftime object from a given number of seconds
+\title{Makes a difftime object from a given number of seconds}
+\usage{
+ make_difftime(x)
}
-\value{a difftime object corresponding to x seconds}
-\keyword{chron}
\arguments{
- \item{x}{number value of seconds to be transformed into a difftime object}
+ \item{x}{number value