Last data update: 2014.03.03

R: Plotting BCDating Objects, and Plotting Time-Series on...
plot-methodsR Documentation

Plotting BCDating Objects, and Plotting Time-Series on BCDating Plot Background

Description

Methods for function plot. Some arguments are not applicable to all methods, but most are common.

Arguments

dates

If TRUE, plots the dates of peaks and troughs on the plot. default=FALSE

yearrep

Number of digits a year is represented if dates are plotted (i.e. dates = TRUE), eg. yearrep = 2 plots dates like 72:3, and yearrep = 4 plots dates like 1372:3. default = 2

col.bg

Background Color of Dating plot (i.e. the color for periods with unknown cycle state). default=gery(0.8)

col.exp

Color for Expansions. default=grey(1)

col.rec

Color for Recessions. default=grey(0.45)

main

Main Title of the Plot, if not provided, the name of the Dating will be used. default=""

xlab

Label of the X axis. default=""

ylab

Label of the Y axis. default=""

lwd

The line Width. default=2

cex

Relative magnification factor. default=0.5

vert

A vector of dates in which vertical lines should be plotted. default=NULL

col.vert

Color of added vertical lines. default="darkblue"

windos

If TRUE, plots the time series in the time horizon where the Dating is available, else plots the entire time series. default=FALSE

averages

If TRUE, plots the averages of times series in each cycle phases. This can be either a vector with the length equal to number of time series in mts object, or just a single value, which would be used for all time series. default=FALSE

col

Color of each of the time series plotted. This can be either a vector with the length equal to number of time series in mts object, or just a single value, which would be used for all time series. default="red"

Methods

signature(x = "BCDating", y = "missing")

Plots a BCDating.

signature(x = "BCDating", y = "ts")

Plot a Time-Series, (or multiple time serires in case y's class is mts) on a BCDating.

signature(x = "ts", y = "BCDating")

Plot a Time-Series, (or multiple time serires in case y's class is mts) on a BCDating.

signature(x = "BCDating", y = "BCDating")

Plots 2 BCDatings, so you can compare them.

signature(x = "list", y = "missing")

Plots a list of BCDating Objects, so you can compare them.

Author(s)

Majid Einian,m.einian@mbri.ac.ir,
Monetary and Banking Research Institute, Central Bank of Islamic Republic of Iran

Franck Arnaud ,
National Institute of Statistics and Economic Studies (INSEE), France

Examples

library(BCDating)
data("MBRI.Iran.Dating")
plot(MBRI.Iran.Dating)
plot(MBRI.Iran.Dating,dates=TRUE)

data("Iran.non.Oil.GDP.Cycle")
plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Cycle)
plot(Iran.non.Oil.GDP.Cycle,MBRI.Iran.Dating)

data("Iran.non.Oil.GDP.Quarterly.Growth")
plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Quarterly.Growth,averages=TRUE)
plot(MBRI.Iran.Dating,cbind(Iran.non.Oil.GDP.Cycle*100,Iran.non.Oil.GDP.Quarterly.Growth))

dat <- BBQ(Iran.non.Oil.GDP.Cycle, name="Dating Business Cycles of Iran")
plot(dat,MBRI.Iran.Dating)
plot(list(dat,MBRI.Iran.Dating))

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(BCDating)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/BCDating/plot-methods.Rd_%03d_medium.png", width=480, height=480)
> ### Name: plot-methods
> ### Title: Plotting BCDating Objects, and Plotting Time-Series on BCDating
> ###   Plot Background
> ### Aliases: plot,BCDating,missing-method plot,BCDating,ts-method
> ###   plot,ts,BCDating-method plot,BCDating,list-method
> ###   plot,list,BCDating-method plot,BCDating,BCDating-method
> ###   plot,list,missing-method
> 
> ### ** Examples
> 
> library(BCDating)
> data("MBRI.Iran.Dating")
> plot(MBRI.Iran.Dating)
> plot(MBRI.Iran.Dating,dates=TRUE)
> 
> data("Iran.non.Oil.GDP.Cycle")
> plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Cycle)
> plot(Iran.non.Oil.GDP.Cycle,MBRI.Iran.Dating)
> 
> data("Iran.non.Oil.GDP.Quarterly.Growth")
> plot(MBRI.Iran.Dating,Iran.non.Oil.GDP.Quarterly.Growth,averages=TRUE)
Warning messages:
1: In .local(x, y, ...) :
  BCDating: Plotting Averages only in windowed mode
2: In window.default(x, ...) : 'start' value not changed
3: In window.default(x, ...) : 'start' value not changed
4: In window.default(x, ...) : 'start' value not changed
> plot(MBRI.Iran.Dating,cbind(Iran.non.Oil.GDP.Cycle*100,Iran.non.Oil.GDP.Quarterly.Growth))
> 
> dat <- BBQ(Iran.non.Oil.GDP.Cycle, name="Dating Business Cycles of Iran")
> plot(dat,MBRI.Iran.Dating)
> plot(list(dat,MBRI.Iran.Dating))
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>