filtro <- function(bd,velhoNome)
{
novoNome <- c('Data', 'IBGEorigem', 'IBGEdestino','Especie','TotalAnimais')
for(ii in 1:5) {
names(bd) <- replace(names(bd),names(bd)==velhoNome[ii], novoNome[ii]);
}
#Filtro por bovinos
bd$Especie <- tolower(bd$Especie)
bd <- bd[ grep('bovin',bd$Especie), ]
#Filtra colunas de interesse
bd <- bd[,c('Data','IBGEorigem','IBGEdestino','TotalAnimais')]
return(bd)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.