qcc.ggplot: Convert QCC Plot into GGPlot

Description Usage Arguments Value Examples

View source: R/CusumEWMA.R

Description

Implementation of plot.qcc using ggplot2 and grid

Usage

1
2
qcc.ggplot(object, title = "QCC Chart for AUD/USD Prices", rawplot = FALSE,
  font_size = 8)

Arguments

object

A qcc object returned from qcc() function.

title

Title to put in the plot

rawplot

using raw data or not

font_size

size of font

Value

A grid object containing the complete plot.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
AUD_USD = getOandaInstrumentCandles(.oandaEnv$ACCOUNT_TYPE, .oandaEnv$ACCESS_TOKEN, INSTRUMENTS = 'AUD_USD',
price = 'M', granularity = 'D', count = 250)
for(i in 4:7){
AUD_USD[, i] <- as.numeric(AUD_USD[, i])
}
AUD_USD_p = na.omit(diff(as.matrix(log(AUD_USD[, 4:7]))))
AUD_USD_v = as.numeric(AUD_USD$volume)
x = AUD_USD_p
x = AUD_USD_v
object = qcc(AUD_USD_v[1:200], newdata = AUD_USD_v[201:250], type = "xbar.one")
ggsave("qcc_ggplot.png", qcc.ggplot(object))

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.