[R] Date conversions

Mark Knecht markknecht at gmail.com
Sat Jul 11 22:07:21 CEST 2009


Thanks. Will do.

Cheers,
Mark

On Sat, Jul 11, 2009 at 12:49 PM, Gabor
Grothendieck<ggrothendieck at 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 <markknecht at gmail.com> wrote:
>>
>> On Sat, Jul 11, 2009 at 12:05 PM, Gabor
>> Grothendieck<ggrothendieck at 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 <- read.zoo("Date1.txt", header = TRUE, sep = ",", FUN = as.chron)
>> >
>> > There are three vignettes that come with zoo that have more info.
>> >
>>
>> Thanks Gabor. That solved the immediate problem. I appreciate the help.
>>
>> I'll take a look at zoo and chron. Any guidance on which package I
>> should look at for getting what day of the week a certain date is?
>> That's something I know I'll need.
>>
>> Cheers,
>> Mark
>
>




More information about the R-help mailing list