Gabor Grothendieck <[EMAIL PROTECTED]> wrote:
> Assuming, as in your post:
>
> set.seed(123)
> mychron <- chron(sort(runif(10, 0, 10)))
> breaks <- quantile(mychron)
>
> # is one of these adequate?
>
> cut(mychron, breaks)
>
> cut(unclass(mychron), unclass(breaks), lab = FALSE)

Thank you Gabor, that showed me I really needed to be more creative with
the 'breaks' argument. So what I needed was (with mychron as above):

breaks <- seq(min(mychron, na.rm = TRUE),
              ceiling(max(mychron, na.rm = TRUE)), by = 1/2)

cut(unclass(mychron), unclass(breaks),
    include.lowest = TRUE, labels = FALSE)


in order to cut the chron object into 1/2 day units.


Thanks so much,
-- 
Sebastian P. Luque

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to