X-Git-Url: https://git.auder.net/?p=talweg.git;a=blobdiff_plain;f=pkg%2FR%2FgetData.R;h=9ed021714c45175f40f12fae62300e06e3519abe;hp=a4e1e17b2e1808568dc5b0dd88cbaf5f86abbb26;hb=7f90df63d1ac659d450a180b50b994a76d5fc7b9;hpb=2bc64a5b0d971770bca13f2c199e0f63bf5026d5 diff --git a/pkg/R/getData.R b/pkg/R/getData.R index a4e1e17..9ed0217 100644 --- a/pkg/R/getData.R +++ b/pkg/R/getData.R @@ -49,14 +49,16 @@ getData = function(ts_data, exo_data, input_tz="GMT", date_format="%d/%m/%Y %H:% read.csv(ts_data) else ts_data + # Convert to the desired timezone (usually "GMT" or "Europe/Paris") + formatted_dates_POSIXlt = strptime(as.character(ts_df[,1]), date_format, tz=input_tz) + ts_df[,1] = format(as.POSIXct(formatted_dates_POSIXlt, tz=input_tz), tz=working_tz, usetz=TRUE) + exo_df = if (is.character(exo_data)) read.csv(exo_data) else exo_data - # Convert to the desired timezone (usually "GMT" or "Europe/Paris") - formatted_dates_POSIXlt = strptime(as.character(ts_df[,1]), date_format, tz=input_tz) - ts_df[,1] = format(as.POSIXct(formatted_dates_POSIXlt), tz=working_tz, usetz=TRUE) + # Times in exogenous variables file are ignored: no conversions required line = 1 #index in PM10 file (24 lines for 1 cell) nb_lines = nrow(ts_df)