[R-SIG-Finance] Time Series Data Analysis of Financial Data

Mark Knecht markknecht at gmail.com
Mon Mar 3 16:15:12 CET 2014


On Mon, Mar 3, 2014 at 7:04 AM, Kapil Shukla <shukla.kapil at gmail.com> wrote:
> Hi All
>
> I am totally new to R so this question may sound basic to many of you. I am
> trying to use R for time series analysis of some financial instruments.
> Currently i have hourly data of a stock which has OPEN/HIGH/LOW/CLOSE in a
> CSV file. I used read.table to import the data in R in to a dataframe but i
> am following below issues:
>
> 1. Date is coming in character format and i am not sure whats the best
> package of function to format the date in "DD/MM/YY HH:MM" format
> 2. When i plot the data using PLOT() data points are so overlapping on the
> chart that its hard to identify the data points. I am not able to specify
> XLIM parameter as my dates are in character. I tried using the C() function
> to provide the first hour and last hour of the data but it won't accept it.
> Is there any better package for plotting time series data.
> 3. Any package which can help me plot the candle stick chart for this OHLC
> data and help me do some statistical analysis on the data.
>
> Thanks in Advance.
>
> Regards
> Kapil


Kapil,
   Welcome to R.

   You will do better here if you provide a reproducible example. Read
your data in and then segment a little piece using dput to show what
it looks like. Build an example that uses maybe 10 lines of data. Post
the code. From there's it's likely an issue of better defining for R
how to handle data/time. Look at the xts package for more info and
post real R code showing what you are doing so others can help.

   Also, there are examples of doing this sort of thing in Stack
Overflow so possibly spend some time there.

- Mark



More information about the R-SIG-Finance mailing list