Re: [R] function to calculate networkdays?

2008-04-11 Thread Henrique Dallazuanna
Try: networkdays - function(start, end, holidays) { dates - seq(as.Date(start), as.Date(end), by=day) if(missing(holidays))holidays - 0 else holidays - length(holidays) sum(as.numeric(format(dates, %w) 1)) - holidays } networkdays(2008-04-01, 2008-04-30) networkdays(2008-04-01, 2008-04-30,

[R] function to calculate networkdays?

2008-04-10 Thread tom soyer
Hi, Does anyone know if R has a built-in function that is similar to Excel's NETWORKDAYS function? i.e., Returns the number of whole working days between two dates. Working days exclude weekends. Thanks, -- Tom [[alternative HTML version deleted]]