weekdays() function in R Language is used to find out a day on a specific date and return as a string.
Syntax:
weekdays(date)Parameters:
x: date
abbrevate: logical value
Example 1: Weekdays function
# R program to illustrate # weekday function # Create example date date <- as.POSIXlt("2020-5-19") # Apply weekdays function weekdays(date, abbreviate = FALSE) |
Output:
Tuesday
Here in the above code we have created an example date and using the weekdays() function found the day on that date.
months() Function
months() function is used to find out the month on a specific date and return as a string.
Syntax:
months(date)Parameters:
x : date
abbrevate : logical value
Example 1: Months function
# R program to illustrate # months function # Create example date date <- as.POSIXlt("2020-5-19") # Apply months function months(date, abbreviate = FALSE) |
Output:
May
Here in the above code we have created an example date and found out the month on that particular date using months() function.
Recommended Posts:
- Determine the Weekday on a Specific Date in R Programming - weekdays() Function
- Determine the Month on a Specific Date in R Programming - months() Function
- Get Date and Time in different Formats in R Programming - date(), Sys.Date(), Sys.time() and Sys.timezone() Function
- Determine the Quarter in which the Specific Date lies in R Programming - quarters() Function
- Convert a String into Date Format in R Programming - as.Date() Function
- Rounding off a value to specific digits in R Programming - round() Function
- Choose Specific Columns of a Data Frame in R Programming - select() Function
- Finding Inverse of a Matrix in R Programming - inv() Function
- Find Location and Character Vector of an Object with partial name in R Language - apropos() and find() Function
- Getting attributes of Objects in R Language - attributes() and attr() Function
- Case conversion of a String in R Language - toupper(), tolower(), casefold() and cartr() Function
- Changing row and column values of a Matrix in R Language - sweep() function
- Parsing Date and Time in R Programming - strptime() Function
- Getting String Representation of the given Date and Time Object in R Programming - strftime() Function
- Playing a beep Sound in R Language - beep() Function
- Modify values of a Data Frame in R Language - transform() Function
- Remove Leading whitespaces from a String in R Language - trimws() Function
- Rounding off values in R Language - round() Function
- Converting a List to Vector in R Language - unlist() Function
- Convert elements of a Vector to Strings in R Language - toString() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

