Skip to content
Prev 86320 / 398506 Next

?bug? strange factors produced by chron

1) The obvious test is via is.factor(), and you have not used that.

2) Your example works for me, so what versions of R and chron is this?

3) Here's my guess. split is using the C-level test isFactor.  That tests 
that the factor is of type integer, so please try
I suspect you will get "double" and not "integer", and if so you can fix 
this by

storage.mode(kvartaly) <- "integer"

So here's an example which will fail
[1] TRUE
Error in split(x, f) : second argument must be a factor

I think it is an error that the R-level and C-level tests for is.factor() 
are different.
On Mon, 13 Feb 2006, Petr Pikal wrote:

            
Why not Sys.Date() ?