Re: [R] how to transform db query result into a set of timeseries ?

2016-09-07 Thread Joshua Ulrich
There's no reason to create multiple xts objects if you intend to merge them all into one object. You say the user can select timeseries, so I assume you have column names in a vector. If so, you can do something like this: series <- c("M", "G", "N") ... zonnen <- xts(df[,series], as.POSIXct(df$

Re: [R] how to transform db query result into a set of timeseries

2016-09-07 Thread Stef Mientki
Thanks Paul, I'm just a beginner with R, so I tried your simplest solution ( zonnen <- xts( cbind( ... ) and it seems to work fine. cheers, Stef On 06-Sep-16 22:12, Paul Gilbert wrote: There is a utility function TSquery() in package TSsql that attempts to do this. Most of the functions in t

Re: [R] how to transform db query result into a set of timeseries

2016-09-07 Thread Paul Gilbert
There is a utility function TSquery() in package TSsql that attempts to do this. Most of the functions in that package are for databases with a specific layout intended for storing time series, but TSquery() attempts to build a series from a somewhat arbitrary database. It is hard to be complet

[R] how to transform db query result into a set of timeseries ?

2016-09-05 Thread Stef Mientki
hello, I've a number of timeseries into a database and want to display these timeseries into graph. Now the code below works well, but as the user can select which timeseries should be shown (up to 20 timeseries) the code below should be dynamic and can be quiet large and complex. Is there