how to extract weekday from date in r

# Create a sample date
date <- as.Date("2023-12-13")

# Extract the weekday
weekday <- weekdays(date)