Re: [R] Strptime/ date time classes

2008-07-14 Thread Mark Difford
Hi Caroline, >> is.na(strptime("19810329012000",format="%Y%m%d%H%M%S")) >> [1] TRUE >> The problem was to do with daylight saving time. I need to specify a >> time zone as this time >> doesn't exist in my operating system's current >> time zone. I still think this is odd behaviour >> though!

Re: [R] Strptime/ date time classes

2008-07-14 Thread Caroline Keef
is.na(strptime("19810329012000",format="%Y%m%d%H%M%S")) [1] TRUE The problem was to do with daylight saving time. I need to specify a time zone as this time doesn't exist in my operating system's current time zone. I still think this is odd behaviour though! When you look at the missing obje

Re: [R] Strptime/ date time classes

2008-07-09 Thread Gabor Grothendieck
Suggest you read the relevant article in R News 4/1. Also the zoo package and read.zoo, in particular, might help. On Wed, Jul 9, 2008 at 6:09 AM, Caroline Keef <[EMAIL PROTECTED]> wrote: > Dear all, > > I've come across a problem using strptime, can anyone explain what's > going on? I'm using ve

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
01:18:00" [16] > >> "2000-03-26 01:28:00" > > Which obviously aren't missing. > > I do want POSIXlt as I need to extract the day of the month (I'm > extracting daily maxima from irregulrly observed time series). > > This seems like a bug to me, I j

Re: [R] Strptime/ date time classes

2008-07-09 Thread Caroline Keef
who know more than I do. Caroline -Original Message- From: jim holtman [mailto:[EMAIL PROTECTED] Sent: 09 July 2008 17:24 To: Caroline Keef Cc: r-help@r-project.org Subject: Re: [R] Strptime/ date time classes You probably want POSIXct instead of POSIXlt: x <- read.tabl

Re: [R] Strptime/ date time classes

2008-07-09 Thread Mark Difford
Hi Caroline, Because POSIXlt is a complicated structure: you are dealing with a list, not with what you think you are. Maybe this will help you to see more clearly. strptime(19800604062759, format="%Y%m%d%H%M%S") [1] "1980-06-04 06:27:59" str(strptime(19800604062759, format="%Y%m%d%H%M%S")) P

Re: [R] Strptime/ date time classes

2008-07-09 Thread jim holtman
You probably want POSIXct instead of POSIXlt: x <- read.table(textConnection("#TZUTC+0|*|SANR08002|*|SNAMENAUL|*|SWATERDELVIN|*|CNR98808|*| + #CNAMEQ|*|CTYPEn-min-ip|*|CMW1440|*|RTIMELVLhigh-resolution|*| + #CUNITm3/s|*|RINVAL-777|*|RNR-1|*|REXCHANGE98913|*| + #RTYPEinstantaneous values|*| + 198

[R] Strptime/ date time classes

2008-07-09 Thread Caroline Keef
Dear all, I've come across a problem using strptime, can anyone explain what's going on? I'm using version 2.7.0 on Windows XP. Thank you Caroline First read in a data file using read.table alldata = read.table(file, header=F, skip=4, colClasses = c("character","numeric")) dim(alldata) [1] 2