Skip to content
Prev 32369 / 398513 Next

dates in chron package, split warning message

On Thu, 22 May 2003, Steve Su wrote:

            
The dates function (not command) does work of course.  It's cut.dates
which fails.  The short answer to you is this is a great opportunity to
learn to debug R functions, and the hint is that the line

    from <- switch(by, days = from, 
	weeks = (from - day.of.week(mdy$m,mdy$d, mdy$y) + as.numeric(start.on.monday)), 
        months = chron(julian(mdy$m, 1, mdy$y, origin = orig)),
        years = chron(julian(1, 1,mdy$y, origin = orig)))

contains two bugs.
Try reading the help pages in each system.  They do not define split in 
the same way, and your usage is incorrect in R but not in S-PLUS 6.1.