Re: [R] getting a timeseries element into a string

2009-07-14 Thread spencerg
Hello: 1. I tried the example. The first thing I noticed was that "library(fSeries)" loaded with the following comment: # The new version of 'fSeries' has been renamed to 'timeSeries' 2. With this, I tried "library(timeSeries)". Then your first example worked without error

Re: [R] getting a timeseries element into a string

2009-07-13 Thread tradenet
Thanks Ron. I apologize for not properly specifying which class/package I was using. I am using the timeSeries class from the timeSeries Package, version 2100.83 from rmetrics.org The code you supplied works for me! -- thanks again. Warm regards, Andrew -- Ron Burns-2 wrote: > > Here is w

Re: [R] getting a timeseries element into a string

2009-07-12 Thread Ron Burns
Here is what I do: R> library(fBasics) R> ts<-dummyDailySeries(x = rnorm(365), units = NULL, zone = "", FinCenter ="") R> class(ts) [1] "timeSeries" attr(,"package") [1] "timeSeries" R> (s <- as.character(time(ts)[1])) [1] "1970-01-01" R> class(s) [1] "character" tradenet wrote: I added

Re: [R] getting a timeseries element into a string

2009-07-12 Thread David Winsemius
On Jul 12, 2009, at 1:05 PM, David Winsemius wrote: On Jul 12, 2009, at 8:10 AM, tradenet wrote: I added a reproducible example to my question... ts<-dummyDailySeries(x = rnorm(365), units = NULL, zone = "", FinCenter = "") "Heads up" is an English colloquial warning. It may be repr

Re: [R] getting a timeseries element into a string

2009-07-12 Thread tradenet
I added a reproducible example to my question... ts<-dummyDailySeries(x = rnorm(365), units = NULL, zone = "", FinCenter = "") > (ts[1,0]) #returns first date in return series GMT 1970-01-01 > ttt<-(sprintf("%s",ts[1,0])) > print(ttt) character(0) > ttt<-(ts[1,0]) > print(ttt) GMT 1970-01

[R] getting a timeseries element into a string

2009-07-10 Thread tradenet
I have a timeseries object, ts, and want to get the first date in the series into a string so I can concatenate it with a SQL query. Input and output are shown below. I must be missing something very basic, but I can't seem to pry the data ("2008-07-01") into a string variable. Any suggestions w