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
abbreviate: 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 is used to find out the month on a specific date and return as a string.
Syntax:
months(date)
Parameters:
x : date
abbreviate : 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.
Australia
UK
UAE
Singapore
Canada
New
Zealand
Malaysia
USA
India
South
Africa
Ireland
Saudi
Arab
Qatar
Kuwait
Hongkong
Copyright 2016-2023 www.programmingshark.com - All Rights Reserved.
Disclaimer : Any type of help and guidance service given by us is just for reference purpose. We never ask any of our clients to submit our solution guide as it is, anywhere.