<font face="trebuchet ms,sans-serif">Saudações,<br><br>Tem pouco tempo que importo arquivos de extensão *xls. Estou com um problema que ao importar um arquivo possuo nomes de cidades brasileiras com acentos no nomes. Ao importar, as letras acentuadas são representadas de outra forma. Quero saber como importar corretamente ou se é possível devolver os nomes certos após importação. Veja o CMR que preparei<br>
<br><span style="font-family: courier new,monospace;">require(gdata) # contém a função read.xls() para importar planilhas</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">teste <- read.xls("<a href="http://www.leg.ufpr.br/~walmes/foo/teste.xls">http://www.leg.ufpr.br/~walmes/foo/teste.xls</a>", sheet=1, method="tab")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">head(teste) # abaixo o print desse comando</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  Sigla  Codigo             mun   a2000</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span></font><font face="trebuchet ms,sans-serif"><span style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">1    AC 1200013   Acrel\xe2ndia 1042.38  </span></font><font face="trebuchet ms,sans-serif"><span style="font-family: courier new,monospace;"># â trocado por \xe2</span></font><br>
<font face="trebuchet ms,sans-serif"><span style="font-family: courier new,monospace;">2    AC 1200054    Assis Brasil  429.22<br>3    AC 1200104    Brasil\xe9ia 2243.25<br>4    AC 1200138          Bujari  786.68<br>5    AC 1200179        Capixaba  603.84<br>
6    AC 1200203 Cruzeiro do Sul 9363.32<br></span><br>Os demais acentos possuem o seu "\xe?" correspondente. Alguém tem uma solução? Outro pacote/função? Meu sistema é Ubuntu 10.04. Os dados são um subconjunto dos dados do ipeadata, baixados no formato.xls.<br>
<br>Outra coisa que percebi é que se o nome das colunas tiver acentos, a importação falha, ex "municipio" (sem acento) importa, mas com "município" (com acento) no nome da coluna não importa. Como evitar isso sem ter que sair renomeando as colunas manualmente? Planilhas de sites coleta de dados do Brasil sempre tem acentos por causa do nomo idioma. Minhas buscas no nabble não retornaram resultado.<br>
<br><span style="font-family: courier new,monospace;"># sheet 2 está escrito "Município" como nome da coluna</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">teste <- read.xls("<a href="http://www.leg.ufpr.br/~walmes/foo/teste.xls">http://www.leg.ufpr.br/~walmes/foo/teste.xls</a>", sheet=2, method="tab")</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">Erro em make.names(col.names, unique = TRUE) : </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">  string multibyte inválida 3</span><br style="font-family: courier new,monospace;">
<br>Certo sua atenção, agradeço.<br>Walmes.<br><br clear="all"></font><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Walmes Marques Zeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">LEG (Laboratório de Estatística e Geoinformação, 25.450418 S, 49.231759 W)</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">Departamento de Estatística - Universidade Federal do Paraná</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">fone: (+55) 41 3361 3573</span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">VoIP: (3361 3600) 1053 1173</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">e-mail: <a href="mailto:walmes@ufpr.br" target="_blank">walmes@ufpr.br</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">twitter: @walmeszeviani</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">homepage: <a href="http://www.leg.ufpr.br/%7Ewalmes" target="_blank">http://www.leg.ufpr.br/~walmes</a></span><br style="font-family: trebuchet ms,sans-serif;">
<span style="font-family: trebuchet ms,sans-serif;">linux user number: 531218</span><br style="font-family: trebuchet ms,sans-serif;"><span style="font-family: trebuchet ms,sans-serif;">==========================================================================</span><br>