Jiang, Jincai (Institutional Securities Management)
2006-May-02 22:21 UTC
[R] Time series plot
I have some time series data like 01/02/1990 0.531 0.479 01/03/1990 0.510 0.522 01/06/1990 0.602 0.604 there is no weekends and holidays. how do I graph them in a single plot that the x-axis is the dates and the y-axis is the time series? Thank you Regards, Jincai Jiang (Office) 212-761-3984 -------------------------------------------------------- This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. Any ModelWare, research or other information referenced herein is subject to the ClientLink and ModelWare terms of use including all applicable disclosures and disclaimers. The information provided speaks only as of its date. We have not undertaken, and will not undertake, any duty to update the information or otherwise advise you of changes in our opinion or in the research or information. Continued access to the research and other information is provided for your convenience only, and is not a republication or reconfirmation of the opinions or information contained therein. For additional information and important disclosures, contact me or see the ModelWare website. Past performance is not indicative of future returns. This communication is solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules). [[alternative HTML version deleted]]
Try this (where you can replace textConnection(L) with name of file containing data): L <- "01/02/1990 0.531 0.479 01/03/1990 0.510 0.522 01/06/1990 0.602 0.604" library(zoo) z <- read.zoo(textConnection(L), format = "%m/%d/%Y") plot(z, plot.type = "single") This will give more info on zoo: library(zoo) vignette("zoo") library(help = zoo) On 5/2/06, Jiang, Jincai (Institutional Securities Management) <Jincai.Jiang at morganstanley.com> wrote:> I have some time series data like > > 01/02/1990 0.531 0.479 > 01/03/1990 0.510 0.522 > 01/06/1990 0.602 0.604 > > there is no weekends and holidays. > how do I graph them in a single plot that the x-axis is the dates and > the y-axis is the time series? > Thank you > > Regards, > > Jincai Jiang > (Office) 212-761-3984 > > -------------------------------------------------------- > This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned. Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers. Any ModelWare, research or other information referenced herein is subject to the ClientLink and ModelWare terms of use including all applicable disclosures and disclaimers. The information provided speaks only as of its date. We have not undertaken, and will not undertake, any duty to update the information or otherwise advise you of changes in our opinion or in the research or information. Continued access to the research and other information is provided for your convenience only, and is not a republication or reconfirmation of the opinions or information contained therein. For additional information and important disclosures, contact me or see the ModelWare website. Past performance is not indicative of future returns. This communication is ! > solely for the addressee(s) and may contain confidential information. We do not waive confidentiality by mistransmission. Contact me if you do not wish to receive these communications. In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules). > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at stat.math.ethz.ch mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html >
Dear Jiang, We do a lot of plots of that sort. At first I read the time values with as.Date(timevariable, format = "%d/%m/%Y"). Then You can plot along like Plot(as.Date-variable, "your target variable", type = "l") If You set axes = F than you can customize the xAxis with axis(1, ...) The AT and LABELS options in axis I fill with something like: at.x <- seq(as.Date("2006-01-01"), as.Date("2006-05-30"), "month") lab.x <- paste(format(at.x, "%b"), c(rep("'06", 5))) So only the month will appear as labels and tickmarks... HTH Dubravko YOU WROTE: [R] Time series plot Jiang, Jincai \(Institutional Securities Management\) Tue, 02 May 2006 15:28:13 -0700 I have some time series data like 01/02/1990 0.531 0.479 01/03/1990 0.510 0.522 01/06/1990 0.602 0.604 there is no weekends and holidays. how do I graph them in a single plot that the x-axis is the dates and the y-axis is the time series? Thank you Regards, Dubravko Dolic Head of eConsulting Tel: +49 (0)89-55 27 44 - 4630 Fax: +49 (0)89-55 27 44 - 2463 Email: dubravko.dolic@komdat.com <mailto:dubravko.dolic@komdat.com> ------------------------------------------------------ Komdat GmbH Nymphenburger Straße 86 80636 München www.komdat.com <http://www.komdat.com/> ------------------------------------------------------ ONLINE MARKETING THAT WORKS ------------------------------------------------------ This electronic message contains information from Komdat Gmb...{{dropped}}