[R] Weekdays only on x-axis

Gabor Grothendieck ggrothendieck at gmail.com
Thu Apr 17 00:30:44 CEST 2008


If z is your zoo object then you plot it like this:

plot(zoo(coredata(z)), xaxt = "n")

and then add a custom axis using axis or Axis.  Also the quantmod
package has this type of graphics built in.

On Wed, Apr 16, 2008 at 3:57 PM, rsan <ryan.sandor at credit-suisse.com> wrote:
>
> Hi All,
>
> I am a relative newbie at R and I am trying to plot some intraday price data
> over a long period of time. I would like to use a weekday(only) scale for
> x-axis. Can anyone tell me how to go about this?
>
> When I plot just the prices it looks fine, but when I add in the Dates/Times
> vs prices - I get gaps on the weekends and holidays... by default R wants to
> use a continuous time scale inclusive of weekends
>
> i looked at zoo and gap.plot from plotrix but neither of these seem to do
> what I want...
>
> Any help is much appreciated
>
> Cheers
> --
> View this message in context: http://www.nabble.com/Weekdays-only-on-x-axis-tp16732269p16732269.html
>
> Sent from the R help mailing list archive at Nabble.com.
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list