IT_tickets[,"ticket_age"] <- NA
{R aging_count for Tasks}
IT_tickets$ticket_age[c(all_tasks)] <- difftime(IT_tickets$closed_at_date[c(all_tasks)], IT_tickets$sys_created_date[c(all_tasks)], units = "days")
I have this column called "ticket age" in my dataset IT_tickets, which calculates the difference in days when a ticket gets created and closed. How can I recode this so that it excludes weekends from the difference in days.
Similar to how NETWORK days function works in Excel.
If you don't have to include the holidays, you can do this
If you want to include the start date into the count, you can remove the subtraction of 1.
Another way: