[R-SIG-Finance] multiple plots with QQplot of PerformanceAnalytics

Robert Iquiapaza rbali at ufmg.br
Fri Mar 25 15:40:26 CET 2011


William,
There must be some issue with chart.QQPlot, apparently every plot after this 
function goes to another page.
chart.QQPlot(ret.ts[, 1])
chart.Histogram(ret.ts[, 2], main = "Density", breaks = 30,  methods =
"add.density")

Insteat you could use:
qqnorm(ret.ts[, 1])
qqline(ret.ts[, 1], col="blue")

qqnorm(ret.ts[, 2])
qqline(ret.ts[, 2], col="blue")

Good luck

Robert

-----Mensagem Original----- 
From: William Mok
Sent: Friday, March 25, 2011 10:34 AM
To: r-sig-finance at r-project.org
Subject: [R-SIG-Finance] multiple plots with QQplot of PerformanceAnalytics

Hi All,


I am trying to plot 4 graphs on to 1 page using layout(...), or par(mfcol =
c(...)); with the function QQplot from the package PerformanceAnalytics.
The problem is that, no matter what order I use, it only plots 3 graphs on 
to 1
page and the last QQplot is shunted to the next page.
Also, this only happens to the QQplot, i.e. there is no problem with 4
Histograms.


set.seed(1033)
data <- matrix(rnorm(240), 240, 2)
data[,2] <- rt(240, df = 7)

tm <- ts(data, start = c(1990, 1), frequency = 12)
ret.ts <- as.timeSeries(tm)

layout(rbind(c(1, 2), c(3, 4)))
#par(mfcol = c(2, 2))
chart.Histogram(ret.ts[, 1], main = "Density", breaks = 30, methods =
"add.density")
chart.Histogram(ret.ts[, 2], main = "Density", breaks = 30,  methods =
"add.density")
chart.QQPlot(ret.ts[, 1])
chart.QQPlot(ret.ts[, 2])

Any suggestion please. Many thx.

Rgds.,

Will

[[alternative HTML version deleted]]

_______________________________________________
R-SIG-Finance at r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-sig-finance
-- Subscriber-posting only. If you want to post, subscribe first.
-- Also note that this is not the r-help list where general R questions 
should go.



More information about the R-SIG-Finance mailing list