Just to clarify this bit: xts (a package that provides tools for handling time series data) is a dependency of quantmod, as you can see from quantmod’s CRAN listing. By default, install.packages() also installs all the other packages listed as “Depends”, “Imports”, or “LinkingTo”. If there’s an installation error in a dependency, as happened here, installation of the package you originally asked for will also fail.