Re: [R] Converting date format

2010-03-24 Thread Muhammad Rahiz
The following functions may help; strptime() ISOdate() Muhammad Hosack, Michael wrote: R community: Hello, I would to like to convert a character date variable from %m/%d/%Y to %m/%d/%y. Any advice would be greatly appreciated. I have tried functions for changing the formatting and rem

Re: [R] Converting date format

2010-03-23 Thread jim holtman
try this: > x <- c('1/1/1970','12/13/2010', '2/3/2001') > gsub("(\\d+/\\d+/)\\d\\d(\\d\\d )", > "\\1\\2", x) [1] "1/1/70" "12/13/10" "2/3/01" On Tue, Mar 23, 2010 at 10:10 AM, Hosack, Michael wrote: > R community: > > Hello, I would to like to convert a character date variable from %m/%d/%Y

Re: [R] Converting date format

2010-03-23 Thread Nutter, Benjamin
If x is your vector of character date variables: orig.date <- as.Date(x, format=c("%m/%d/%Y")) new.date <- format(x, format=c("%m/%d/%y")) -Original Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of Hosack, Michael Sent: Tuesday, March 23, 2010