Problem with my to.monthly. It cuts my dataset, I do not know why.
####install.packages("quantmod")
library(quantmod)
####install.packages("PerformanceAnalytics")
library(PerformanceAnalytics)
####install.packages("zoo")
library(zoo)
####Definindo diretório principal
setDefaults(getSymbols, src='google')
StartDate = as.Date("2004-01-01") ####data de começo
EndDate = as.Date("2017-01-01") ####data de término
ibovespa <- getSymbols('IBOV', from=StartDate, to=EndDate, auto.assign = F)
ibovespa_monthly <- to.monthly(ibovespa) #->->->->->->->->->problem#####
colnames(ibovespa_monthly) <- c("Open", "High", "Low", "Close","Volume")
ibovespa_return <- (Return.calculate(ibovespa_monthly$Close)[-1,])*100
plot.zoo(ibovespa_return, xlab="Mês", ylab = "Porcentagem")
table.CalendarReturns(ibovespa_return)