[R] Date conversions

2009-07-11 Thread Mark Knecht
Hi all, I'm having a little bit of trouble with some date conversions and am hoping someone can help me out. Thanks in advance. OK, I have two sources of data that provide date info in a csv file differently. I've attached a small zipped file with two text files that illustrate both. (Is it

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
On Sat, Jul 11, 2009 at 10:20 AM, Gabor Grothendieckggrothendi...@gmail.com wrote: No attachment appeared. I don't think the list allows zip files as attachments. Try plain text. On Sat, Jul 11, 2009 at 1:10 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi all,   I'm having a little bit of

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
No attachment appeared. I don't think the list allows zip files as attachments. Try plain text. On Sat, Jul 11, 2009 at 1:10 PM, Mark Knechtmarkkne...@gmail.com wrote: Hi all,   I'm having a little bit of trouble with some date conversions and am hoping someone can help me out. Thanks in

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
You want %Y, not %y. You might also want to look at the zoo package: library(zoo) z - read.zoo(Date1.txt, header = TRUE, sep = ,, format = %m/%d/%Y) or using chron: library(zoo) library(chron) z - read.zoo(Date1.txt, header = TRUE, sep = ,, FUN = as.chron) There are three vignettes that come

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
On Sat, Jul 11, 2009 at 12:05 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: You want %Y, not %y. You might also want to look at the zoo package: library(zoo) z - read.zoo(Date1.txt, header = TRUE, sep = ,, format = %m/%d/%Y) or using chron: library(zoo) library(chron) z -

Re: [R] Date conversions

2009-07-11 Thread Gabor Grothendieck
Try: format(d, %a) or format(d, %A) or as.POSIXlt(d)$wday There is also day.of.week in chron. On Sat, Jul 11, 2009 at 3:42 PM, Mark Knecht markkne...@gmail.com wrote: On Sat, Jul 11, 2009 at 12:05 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: You want %Y, not %y. You might also

Re: [R] Date conversions

2009-07-11 Thread Mark Knecht
Thanks. Will do. Cheers, Mark On Sat, Jul 11, 2009 at 12:49 PM, Gabor Grothendieckggrothendi...@gmail.com wrote: Try: format(d, %a) or format(d, %A) or as.POSIXlt(d)$wday There is also day.of.week in chron. On Sat, Jul 11, 2009 at 3:42 PM, Mark Knecht markkne...@gmail.com wrote: On Sat,