I’m trying to write an R function to calculate the number of weekdays between two dates. For example, something like Nweekdays('01/30/2011','02/04/2011') that would return 5.
Similar to this question.
Update: I was wondering if anyone could think of a way to vectorize this, so that it’ll work on 2 columns of dates.
EDIT: This can be vectorized: