dataToXts: dataToXts

Description Usage Arguments Value Examples

View source: R/seeTimeTrend.R

Description

convert csv to xts format to use dygraph function

Usage

1
dataToXts(compileFile, variableName, timestampColumn, timestampFormat)

Arguments

compileFile

data.frame (specific format, add some test ?)

variableName

String of variable code into compileFile (ex. "WTD", or c("WTD","TS_1_1_1"))

timestampColumn

String of the timestampColumn with year, month, day, hour month and second(ex. "timestamp")

timestampFormat

String of the timestampColumn format with year, month, day, hour month and second(ex. "%Y-%m-%d %H:%M:%S")

Value

xts object to used with dygraph with all variable selected ()

Examples

1
2
3
4
5
6
7
8
compileFilePath <- system.file("extdata",
"compilation/Compile_lgt_bm1_2020.csv",
package = "toolboxMeteosol")
compileFile <- read.csv(compileFilePath,header=TRUE,sep=";")
timestampColumn <- "timestamp"
timestampFormat <- "%Y-%m-%d %H:%M:%S" 
variableName <- c("TS_1_1_1","TS_1_2_1")
dataToXts(compileFile,variableName,timestampColumn,timestampFormat)

Rosalien/toolboxMeteosol documentation built on Aug. 15, 2020, 7 a.m.