Re: [R] write function to convert to date or delete

2014-02-27 Thread William Dunlap
trings may be in one of several formats, loop through the formats and decide which to accept. Bill Dunlap TIBCO Software wdunlap tibco.com > -Original Message- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On > Behalf > Of Bill > Sent: Wednesday, February 2

Re: [R] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello, Maybe one possiblity is to search complete cases, such as complete.cases(z), and subset according to the output. It might also be interesting to check why you sometimes get NA. Regards, Pascal On 27 February 2014 16:11, Bill wrote: > Yes! that worked. > By the way, still puzzled about h

Re: [R] write function to convert to date or delete

2014-02-26 Thread Bill
Yes! that worked. By the way, still puzzled about how to write the function that would delete ones where there was an error in the function I used. Any idea on that? On Thu, Feb 27, 2014 at 8:06 PM, Pascal Oettli wrote: > z <- strptime(radSampTrim$Captured.Time[1:30], "%F %T") > [[a

Re: [R] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello, I think this should be z <- strptime(radSampTrim$Captured.Time[1:30], "%F %T") Regards, Pascal On 27 February 2014 15:58, Bill wrote: > I just tried this: > > z <- strptime(radSampTrim$Captured.Time[1:30], "%d%b%Y") >> z[1:3] > [1] NA NA NA > > On Thu, Feb 27, 2014 at 7:39 PM,

Re: [R] write function to convert to date or delete

2014-02-26 Thread Bill
I just tried this: z <- strptime(radSampTrim$Captured.Time[1:30], "%d%b%Y") > z[1:3] [1] NA NA NA On Thu, Feb 27, 2014 at 7:39 PM, Pascal Oettli wrote: > strptime [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

Re: [R] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello, Did you tried the "strptime" function? Regards, Pascal On 27 February 2014 15:24, Bill wrote: > Hi. Thanks. Actually I don't know which ones are causing problems. I cannot > search through it because it is quite large (15 million records) > > > On Thu, Feb 27, 2014 at 7:22 PM, Pascal Oet

Re: [R] write function to convert to date or delete

2014-02-26 Thread Bill
Hi. Thanks. Actually I don't know which ones are causing problems. I cannot search through it because it is quite large (15 million records) On Thu, Feb 27, 2014 at 7:22 PM, Pascal Oettli wrote: > Hello, > > Could you provide an example of unproperly formatted entry? > > Regards, > Pascal > > >

Re: [R] write function to convert to date or delete

2014-02-26 Thread Pascal Oettli
Hello, Could you provide an example of unproperly formatted entry? Regards, Pascal On 27 February 2014 15:03, Bill wrote: > I have a dataframe that looks like the below. I want to convert the > Captured.Time field to a date object. but some of the entries are not > properly formated and I get

[R] write function to convert to date or delete

2014-02-26 Thread Bill
I have a dataframe that looks like the below. I want to convert the Captured.Time field to a date object. but some of the entries are not properly formated and I get a message saying Error in as.POSIXlt.character(as.character(x), ...) : character string is not in a standard unambiguous format.