Ahmed Salhin Ahmed Salhin - 2 months ago 20
R Question

Modifying plot title and Y axis label when plotting acf & ccf

I have the following cross correlation function (ccf) with an

acf
class which I am trying to plot:

> data.ccf<-structure(list(acf = structure(c(0.00370070496127902, 0.00206467231169963,
0.0225750357110768, 0.00298746518949757, 0.0145032913293758,
0.00963688419028638, 0.0333911509122289, 0.0339875564324283,
0.0250934925494934, 0.000676008442887869, 0.00492135501146539,
-0.00592692854683653, -0.0107895022365464, 0.00609386610167392,
-0.00984595563932813, -0.0171226578533912, -0.0293648412902752,
-0.0462922652753253, -0.0353820065425828, -0.0183974934967957,
0.0288914327057706, 0.0464637907082781, 0.054885909543429, 0.0700788950534636,
0.0693506012009064, 0.0859920376824603, 0.104448361559048, 0.077634145913444,
0.0749334881299481, 0.0624151983030089, 0.0681461368510607, 0.0646564935926327,
0.0420602515535845, 0.047867004655121, 0.0393482900110428, 0.0176073231017014,
0.0215130830865146, -0.00489290354607561, -0.0134508219619577,
-0.0363364336004547, -0.0193789240783189), .Dim = c(41L, 1L,
1L)), type = "correlation", n.used = 360L, lag = structure(c(-20,
-19, -18, -17, -16, -15, -14, -13, -12, -11, -10, -9, -8, -7,
-6, -5, -4, -3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
12, 13, 14, 15, 16, 17, 18, 19, 20), .Dim = c(41L, 1L, 1L)),
series = "X", snames = "Variable 1 & Variable 2 "), .Names = c("acf",
"type", "n.used", "lag", "series", "snames"), class = "acf")

> plot(data.ccf)


That results in the following plot:

enter image description here

Simply, I want to get rid of the title and Y axis label. I have tried to set the
main
and
ylab
to
NULL
without any sucess.

Answer

You can try:

plot(data.ccf, main = "", ylab = "")

or

plot(data.ccf, main = NA, ylab = NA)

both of which result in the following for me:

enter image description here