Usage of weekdays

I tried to create new variables from my data set. This is what I typed:

dt4w05S <- read.csv("w05S.csv")
dt4w05S <- dt4w05S %>%
mutate(productPriceUnit = RetailPriceUnit/1.13,
productType =
Revenue = SalesQuantityproductPriceUnit,
productCost = SalesQuantity
grossProfit = Revenue - productCost,
Day = weekdays(SalesDate))

Then it said: Error in UseMethod("weekdays") :
no applicable method for 'weekdays' applied to an object of class "factor"

Anyone knows how to fix this?
Thank you.

Hard to tell for sure without a reproducible example, but very likely the problems is that read.csv() is reading SalesDate as factors instead of dates, use read_csv() instead, if you need more specific help, please provide a proper REPRoducible EXample (reprex)

This error means that you apply the function weekdays on a variable of type factor but this function is made to work on Dates. see ?weekdays
you need to correctly prepare your data I guess