Skip to content
This repository
tree: 91bd4ee969
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 50 lines (45 sloc) 1.221 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
\name{month}
\alias{month}
\alias{month<-}
\title{Get/set months component of a date-time.}
\usage{
  month(x, label = FALSE, abbr = TRUE)
}
\arguments{
  \item{x}{a date-time object}

  \item{label}{logical. TRUE will display the month as a
  character string such as "January." FALSE will display
  the month as a number.}

  \item{abbr}{logical. FALSE will display the month as a
  character string #' label, such as #' "January". TRUE
  will display an abbreviated version of the label, such as
  "Jan". abbr is #' disregarded if label = FALSE.}
}
\value{
  the months element of x as a number (1-12) or character
  string. 1 = January.
}
\description{
  Date-time must be a POSIXct, POSIXlt, Date, chron,
  yearmon, yearqtr, zoo, zooreg, timeDate, xts, its, ti,
  jul, timeSeries, and fts objects.
}
\examples{
x <- ymd("2012-03-26")
month(x)
month(x) <- 1
month(x) <- 13
month(x) > 3

month(ymd(080101))
# 1
month(ymd(080101), label = TRUE)
# "January"
month(ymd(080101), label = TRUE, abbr = TRUE)
# "Jan"
month(ymd(080101) + months(0:11), label = TRUE, abbr = TRUE)
# "Jan" "Feb" "Mar" "Apr" "May" "Jun" "Jul" "Aug" "Sep" "Oct" "Nov" "Dec"
}
\keyword{chron}
\keyword{manip}
\keyword{methods}
\keyword{utilities}

Something went wrong with that request. Please try again.