[R] Importing dates from SPSS file

Gabor Grothendieck ggrothendieck at gmail.com
Fri Feb 4 15:56:53 CET 2011


On Fri, Feb 4, 2011 at 9:47 AM, dunner <ross.dunne at tcd.ie> wrote:
>
> Hello all, kind regards,
>
> I have imported a data.frame from SPSS using "foreign":read.spss but
> unfortunately it is reading dates in a way neither R nor myself can
> understand.
>
>> book$DATE
>  [1] 13502246400 13443321600 13477795200 13472956800 13501728000 13445395200
> 13501382400 13502851200 13444185600 13461465600 13457232000
> [12] 13458096000 13432435200 13431484800 13495334400 13491964800 13451184000
> 13490755200 13505616000 13505616000 13502851200 13436928000
> [23] 13497408000 13465094400 13484707200 13447555200 13438483200 13464489600
> 13494816000 13432435200 13455676800 13463884800 13455417600
> [34] 13478400000 13504665600 13490150400 13504060800 13471401600 13492915200
> 13465958400 13445136000
>
> I have looked around the documentation but can find nothing similar there or
> in Spector's chapter on Dates
>
> How do I coerce these to %d%m%Y form?
>
> Thank you for your time and patience

SPSS uses seconds since the beginning of the Gregorian calendar.  See
the help desk article in R News 4/1 for details:
http://cran.r-project.org/doc/Rnews/Rnews_2004-1.pdf


-- 
Statistics & Software Consulting
GKX Group, GKX Associates Inc.
tel: 1-877-GKX-GROUP
email: ggrothendieck at gmail.com



More information about the R-help mailing list