[R-SIG-Finance] XTS Modification
Jeff Ryan
jeff.a.ryan at gmail.com
Wed Oct 22 16:09:09 CEST 2008
Try:
write.zoo(IBM, index.name="Date")
?write.zoo
HTH
Jeff
On Wed, Oct 22, 2008 at 8:39 AM, SMS CHAUHAn <sms.chauhan at mu-sigma.com> wrote:
> Hi,
>
> I am a newbie to R.
>
> I am trying to write some stock data to a csv file.
>
> Here is the code.
>
>
>
> <code>
>
> library(xts)
>
> library(Defaults)
>
> library(quantmod)
>
> library(TTR)
>
> getSymbols("IBM")
>
> write.csv(IBM, file="IBM.csv")
>
> </code>
>
>
>
> Later I would use this csv file to write data into an SQL database. Here is
> where I face the problem. In the tool I will be using, column headers have
> to be mapped between csv and SQL fields. In the CSV file I get, the date
> column does not have any column header. There is a workaround to edit the
> csv and add the column header. But can I dynamically add the date id field
> as a regular field in the xts data above before I write it to the csv.
>
>
>
> Thanks,
>
> SMS Chauhan
>
>
> ***********************************************************************
> This e-mail and any files transmitted with it are for the sole use of the intended recipient(s) and may contain confidential and privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies and the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this email or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful.
>
> The recipient acknowledges that Mu Sigma or its subsidiaries and associated companies (collectively " Mu Sigma Inc), are unable to exercise control or ensure or guarantee the integrity of over the contents of the information contained in e-mail transmissions and further acknowledges that any views expressed in this message are those of the individual sender and no binding nature of the message shall be implied or assumed unless the sender does so expressly with due authority of Mu Sigma. Before opening any attachments please check them for viruses and defects.
> ***********************************************************************
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
--
Jeffrey Ryan
jeffrey.ryan at insightalgo.com
ia: insight algorithmics
www.insightalgo.com
More information about the R-SIG-Finance
mailing list