From a1188da26368fe003beb80229f983199b2c388c5 Mon Sep 17 00:00:00 2001 From: florianm Date: Thu, 2 Apr 2015 17:54:49 +0800 Subject: [PATCH] mucking around with date recognition --- global.R | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/global.R b/global.R index 6a5e396..6897d8a 100644 --- a/global.R +++ b/global.R @@ -42,13 +42,10 @@ get_data <- function(url, read.table(url, sep=',', header=T, stringsAsFactors=T), function(x) { if(is.factor(x)){ - try( - if(is.Date(as.Date(x))){ - x <- lubridate::parse_date_time(x, orders=ldo, tz=ltz) - } - ) + # insert test whether factor x really is a date + x <- lubridate::parse_date_time(x, orders=ldo, tz=ltz) + x } - x })) }