Re: [R] compare different data-formats

2012-09-14 Thread arun
vec2DateF)==0,TRUE,FALSE) #[1] TRUE TRUE A.K. - Original Message - From: Martin Batholdy To: "r-help@r-project.org" Cc: Sent: Friday, September 14, 2012 5:44 AM Subject: [R] compare different data-formats Hi, I have two data-frames which I want to match by a date-variable. T

Re: [R] compare different data-formats

2012-09-14 Thread Rui Barradas
Hello, Try the following. x <- c("14.Aug.2012-16:32", "3.Sep.2012-16:50") y <- c("2012.08.14", "2012.09.3") as.Date(x, format = "%d.%b.%Y-%H:%M") == as.Date(y, format = "%Y.%m.%d") (Or use %in% instead of ==) But note that the format returned by as.Date uses '-' as separator: as.Date(x, forma

[R] compare different data-formats

2012-09-14 Thread Martin Batholdy
Hi, I have two data-frames which I want to match by a date-variable. The problem now is, that the date-variable has a different format in this two data-frames. So simply matching by this variable wouldn't work. In the one data-frame the date-variable contains strings that look like this: 14.Au