diff --git a/DESCRIPTION b/DESCRIPTION index e10541a8aaee81b51b0a27ea1166ca080a5dc217..4bf3f3c577ec19892449d740461208b780b58e7a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: SGLdataGrabber Title: Grab available data from EPTB Seine Grands Lacs web site -Version: 0.1.1 +Version: 0.1.2 Authors@R: person(given = "David", family = "Dorchies", diff --git a/R/sgl.R b/R/sgl.R index 39631cefeaaab57140eb80ea06e1a02f3d97dd77..fb6bbe42327aeaf36b3a22cb0808517746c5d3fd 100644 --- a/R/sgl.R +++ b/R/sgl.R @@ -43,7 +43,7 @@ SGL_GrabVariableListAll <- function( #' #' @param URL Complete URL of the data source. #' -#' @return A dataframe containing stata time series with 2 columns: `datetime` (Unix timestamp format) and `value`. +#' @return A dataframe containing stata time series with 2 columns: `datetime` ([character] format "YYYY-MM-DDThh:mm") and [numeric] `value`. #' @export #' #' @import httr diff --git a/R/thingsboard.R b/R/thingsboard.R index 2369ba35d5260097a1cea86dc0699f40b5bf49d6..5450c1d251db0151bbe8e7cc63a744c831a9971b 100644 --- a/R/thingsboard.R +++ b/R/thingsboard.R @@ -16,7 +16,7 @@ #' ) #' } thingsboard_UploadTelemetry <- function(URL, dfData) { - dfData$datetime <- paste0(format(dfData$datetime), "000") + dfData$datetime <- paste0(format(as.numeric(as.POSIXct(dfData$datetime))), "000") lData <- split(dfData, dfData$datetime) lapply(X = lData, FUN = thingsboard_UploadTimeStep, URL) }