error in quantmod

I am not sure what exactly you are trying to obtain but the barChart() function in the quantmod package will not work with a data.frame. You need to transform your data in the right format. After creating the dataset in your code above:

barChart(as.xts(ts(data)))
1 Like