Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Patrick Connolly
On Tue, 08-Jun-2004 at 02:57PM +1200, Richard A. O'Keefe wrote: |> Rolf Turner <[EMAIL PROTECTED]> attacked: |> Have you ***any*** evidence that R's procedure degrades |> performance, under any circumstances? (Apparently not.) In |> that case why are you goi

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Shin, Daehyok
ckage. Daehyok Shin (Peter) > -Original Message- > From: Richard A. O'Keefe [mailto:[EMAIL PROTECTED] > Sent: Monday, June 07, 2004 PM 10:50 > To: [EMAIL PROTECTED] > Subject: RE: [R] Vectors of years, months, and days to dates? > > > as.Date(c(years, months,

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Richard A. O'Keefe
Rolf Turner <[EMAIL PROTECTED]> attacked: Have you ***any*** evidence that R's procedure degrades performance, under any circumstances? (Apparently not.) In that case why are you going on and on about it? I did the following: library(ch

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Roger Bivand
much more data run through them, and the time you might > > save trying to avoid integer to character conversion will/should be eaten > > up by debugging. > > > > > > > > Daehyok Shin (Peter) > > > Terrestrial Hydrological Ecosystem Modellers > > >

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Rolf Turner
Daehyok Shin (Peter) wrote: > Is what I asked such an exceptional case? Apparently. > A lot of data I am dealing with (usually hydrologic data) are > recorded with three columns of years, months, and days. In my > opinion, the direct conversion from numeric vectors of years, months > an

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Shin, Daehyok
r Bivand [mailto:[EMAIL PROTECTED] > Sent: Monday, June 07, 2004 PM 1:02 > To: Shin, Daehyok > Cc: R, Help > Subject: RE: [R] Vectors of years, months, and days to dates? > > > On Mon, 7 Jun 2004, Shin, Daehyok wrote: > > > > > res <- as.POSIXlt(paste(years, mon

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Gabor Grothendieck
Shin, Daehyok email.unc.edu> writes: > > Thanks, but, what I want is to convert three vectors of years, months, and > days directly into POSIXlt or Date objects > without creating character vectors. I would probably just convert it to character using paste and from that to Date as others have a

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Peter Dalgaard
"Shin, Daehyok" <[EMAIL PROTECTED]> writes: > Thanks, but, what I want is to convert three vectors of years, months, and > days directly into POSIXlt or Date objects > without creating character vectors. Well, if you insist: x <- as.POSIXlt(structure(rep(0,2),class="POSIXct")) x$year <- years-

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Roger Bivand
om: Roger Bivand [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 07, 2004 PM 12:20 > > To: Daehyok Shin > > Cc: R, Help > > Subject: Re: [R] Vectors of years, months, and days to dates? > > > > > > On Mon, 7 Jun 2004, Daehyok Shin wrote: > > &

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Peter Dalgaard
Prof Brian Ripley <[EMAIL PROTECTED]> writes: > On Mon, 7 Jun 2004, Shin, Daehyok wrote: > > > The interface for dates in R is a little confusing to me. > > I want to create a vector of Date objects from vectors of years, months, and > > days. > > One solution I found is: > > > > years <- c(1991

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Shin, Daehyok
"Shin, Daehyok" > > <[EMAIL PROTECTED]To: "R, > Help" <[EMAIL PROTECTED]> > >cc: > > Sent by: Subject: [R] > Vectors of ye

RE: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Shin, Daehyok
"We can do no great things, only small things with great love." - Mother Teresa > -Original Message- > From: Roger Bivand [mailto:[EMAIL PROTECTED] > Sent: Monday, June 07, 2004 PM 12:20 > To: Daehyok Shin > Cc: R, Help > Subject: Re:

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Roger Bivand
On Mon, 7 Jun 2004, Daehyok Shin wrote: > How can I create POSIXlt directly from the numbers? > I failed to find the solution from help documents. ?POSIXlt ?as.POSIXlt: > res <- as.POSIXlt(paste(years, months, days, sep="-")) > str(res) `POSIXlt', format: chr [1:2] "1991-01-01" "1992-10-02" > r

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Daehyok Shin
How can I create POSIXlt directly from the numbers? I failed to find the solution from help documents. Daehyok --On Monday, June 07, 2004 4:44 PM +0100 Prof Brian Ripley <[EMAIL PROTECTED]> wrote: On Mon, 7 Jun 2004, Shin, Daehyok wrote: The interface for dates in R is a little confusing to me. I

Re: [R] Vectors of years, months, and days to dates?

2004-06-07 Thread Prof Brian Ripley
On Mon, 7 Jun 2004, Shin, Daehyok wrote: > The interface for dates in R is a little confusing to me. > I want to create a vector of Date objects from vectors of years, months, and > days. > One solution I found is: > > years <- c(1991, 1992) > months <- c(1, 10) > days <- c(1, 2) > > dates <- as

[R] Vectors of years, months, and days to dates?

2004-06-07 Thread Shin, Daehyok
The interface for dates in R is a little confusing to me. I want to create a vector of Date objects from vectors of years, months, and days. One solution I found is: years <- c(1991, 1992) months <- c(1, 10) days <- c(1, 2) dates <- as.Date(ISOdate(years, months, days)) But, in this solution the