@karthik778 it will be hard to help without a REProducible EXample, or reprex, see
However, looking at the last line of the error,
x ..2 must be a vector, not a function.
there is a function weekdays() . Whatever you have named that, try naming it something else and see if that helps.