Description Usage Arguments Details Author(s) See Also Examples
formatDate
converts characters or numbers to dates.
is.Date
indicates which elements are Dates.
1 2 3 | formatDate(x, format = "dmY", sep = "/", century = NULL)
is.Date(x)
|
x |
a character or numeric object |
format |
only for character vectors: |
sep |
separator character for date components |
century |
specify either 2000 or 1900 for two-digit years |
"dmY" represents dd mm YYYY format.
In combination with separators from sep
, this can change to
several date formats.
For example, "dmy" + "-" convert to "dd-mm-YYYY" format.
See as.Date
for more date formats.
Myo Minn Oo (Email: dr.myominnoo@gmail.com | Website: https://myominnoo.github.io/)
1 2 3 4 5 6 7 8 9 10 | dates <- c("2019-01-15", "2019-01-20", "2019-01-21", "2019-01-22")
is.Date(dates)
formatDate(dates, "Ymd", "-")
y <- formatDate(dates, "Ymd", "-")
is.Date(y)
y
# dates in numeric format MS excel
x <- 42705:42710
y <- formatDate(x)
y
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.