Skip to content
Prev 17362 / 398513 Next

Weekdays

On Fri, 22 Feb 2002, Whit Armstrong wrote:

            
Well, an efficient brute-force solution is a lookup table.

The weekdays() function returns the day of the week, and so you can
construct a 7x7 table of tail lengths and do

   tail<-tailtable[weekdays(start),weekdays(end)]

I don't know if this counts as elegant.

	-thomas



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._