[R] cut.Date functionality for chron date/time objects

2005-08-02 Thread Sebastian Luque
Hello, I've encountered the need to cut some chron objects of the form: R mychron - chron(sort(runif(10, 0, 10))) R mychron [1] (01/01/70 16:36:20) (01/02/70 00:08:46) (01/03/70 16:54:49) [4] (01/04/70 06:45:00) (01/07/70 06:21:24) (01/07/70 18:28:44) [7] (01/08/70 00:47:05) (01/08/70

Re: [R] cut.Date functionality for chron date/time objects

2005-08-02 Thread Gabor Grothendieck
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) On 8/2/05, Sebastian Luque [EMAIL PROTECTED] wrote: Hello, I've encountered

Re: [R] cut.Date functionality for chron date/time objects

2005-08-02 Thread Sebastian Luque
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

Re: [R] cut.Date functionality for chron date/time objects

2005-08-02 Thread Spencer Graves
How about the following: set.seed(123) mychron - chron(sort(runif(10, 0, 10))) (breaks - chron(pretty(quantile(mychron [1] 01/01/70 01/03/70 01/05/70 01/07/70 01/09/70 01/11/70 spencer graves Sebastian Luque wrote: Gabor Grothendieck [EMAIL PROTECTED] wrote: Assuming, as in your

Re: [R] cut.Date functionality for chron date/time objects

2005-08-02 Thread Sebastian Luque
Spencer Graves [EMAIL PROTECTED] wrote: How about the following: set.seed(123) mychron - chron(sort(runif(10, 0, 10))) (breaks - chron(pretty(quantile(mychron [1] 01/01/70 01/03/70 01/05/70 01/07/70 01/09/70 01/11/70 I was looking for a way to cut it into specified units of time, rather