| calendar-names | R Documentation |
These three functions return (abbreviated and full) names of months and days of week as well as AM/PM indicators in the current or user-provided locale.
How the month and weekday names are actually returned depends both on the selected locale and character set / code page setting.
month_names(locale = NULL, abbreviate = TRUE)
weekday_names(locale = NULL, abbreviate = TRUE)
ampm_indicators(locale = NULL)
locale |
a character value determining locale or |
abbreviate |
a logical value, if |
A character vector of length 12, 7, or 2.
Unfortunately, locale and character set naming were not standardised across
different operating systems for many years. On modern operating systems,
however, locale is usually of the form xx_XX (xx for language,
XX for country) optionally followed by a dot and a character set
identifier, for example, UTF-8.
"C" is a special locale that should always be available and
defaults to American English.
format for formatting objects of tind class.
# current system locale
month_names()
weekday_names()
try(
ampm_indicators()
)
try({
# English abbreviated month names
print(month_names("en_GB"))
# French month names
print(month_names("fr_FR.UTF-8", FALSE))
# German abbreviated month names
print(month_names("de_DE.UTF-8"))
# Polish abbreviated month names
print(month_names("pl_PL.UTF-8"))
# English weekday names
print(weekday_names("en_GB", FALSE))
# French abbreviated weekday names
print(weekday_names("fr_FR.UTF-8"))
# German weekday names
print(weekday_names("de_DE.UTF-8", FALSE))
# Polish abbreviated weekday names
print(weekday_names("pl_PL.UTF-8"))
# US am/pm indicators
print(ampm_indicators("en_US"))
# UK am/pm indicators
print(ampm_indicators("en_GB"))
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.