I had to install the quantmod package in order to execute your code. But after doing that and executing you code exactly as written, I got the following image. Am I correct that this is the image you were hoping to get?
If so, my guess is that one your packages is out of date. I would type update.packages()
from the R console and try again. Can you report back if that fixed your issue?