<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Cordial saludo, adjunto el código en txt ya que en el correo pasado no se anexo bien.<div><br></div><div>Gracias!</div><div><br></div><div>Saludos,<br><br>ANDRÉS FELIPE FLÓREZ RIVERA <br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">From: jorgeivanvelez@gmail.com<br>Date: Fri, 26 Oct 2012 10:43:36 +1100<br>Subject: Re: [R-es] Minería de texto<br>To: andreselestadistico@hotmail.com<br>CC: r-help-es@r-project.org<br><br><font face="arial,helvetica,sans-serif">Hola Andres,</font><div><font face="arial,helvetica,sans-serif"><br></font></div><div><font face="arial,helvetica,sans-serif">Desafortunadamente el codigo es muy dificil de leer y eso hace aun mas dificil ayudarte.  Es posible que lo envies de nuevo (utilizando espacio entre lineas y entre palabras?) o que lo alojes en algun sitio de internet, i.e., Dropbox?</font></div>

<div><font face="arial,helvetica,sans-serif"><br></font></div><div><font face="arial,helvetica,sans-serif">Saludos,</font></div><div><font face="arial,helvetica,sans-serif">Jorge.-</font></div>

<div><br></div><div><br><div class="ecxgmail_quote">On Fri, Oct 26, 2012 at 10:41 AM, ANDRÉS FELIPE FLÓREZ RIVERA <span dir="ltr"><></span> wrote:<br><blockquote class="ecxgmail_quote" style="border-left:1px #ccc solid;padding-left:1ex">

<br>
Cordial Saludo<br>
Actualmente estoy realizando una función para gráficar una nube de palabras el código que tengo es el siguiente:<br>
library(twitteR)library(tm)library(wordcloud)library(RXKCD)library(RColorBrewer)<br>
tweets=searchTwitter('@afflorezr', n=1500)<br>
<br>
 generateCorpus= function(tweets,my.stopwords=c(),min.freq){  #Install the textmining library  require(tm)  require(wordcloud)  tw.df=twListToDF(tweets)  RemoveAtPeople <- function(x){gsub("@\\w+", "",x)}  df<- as.vector(sapply(tw.df$text, RemoveAtPeople))  #The following is cribbed and seems to do what it says on the can  tw.corpus = Corpus(VectorSource(df))  tw.corpus = tm_map(tw.corpus, function(x) iconv(enc2utf8(x), sub = "byte"))  tw.corpus = tm_map(tw.corpus, tolower)    tw.corpus = tm_map(tw.corpus, removePunctuation)  tw.corpus = tm_map(tw.corpus, function(x) removeWords(x, c(stopwords("spanish"),"rt")))  tw.corpus = tm_map(tw.corpus, removeWords, my.stopwords)  tw.corpus = tm_map(tw.corpus, stripWhitespace)  sw <- readLines("stopwords.es.txt",encoding="UTF-8")  sw = iconv(sw, to="ASCII//TRANSLIT")  tw.corpus = tm_map(tw.corpus, removeWords, sw)  doc.m = TermDocumentMatrix(tw.corpus, control = list(minWordLength = 2))  dm = as.matrix(doc.m)  # calculate the frequency of words  v = sort(rowSums(dm), decreasing=TRUE)  d = data.frame(word=names(v), freq=v)  #Generate the wordcloud  pal2 <- brewer.pal(8,"Dark2")  wc=wordcloud(d$word, d$freq, min.freq=min.freq, scale=c(8,.2),               max.words=Inf, random.order=FALSE, rot.per=.15, colors=pal2)  wc}##Generate an image file of the wordcloudpng("gráfico.png", width=1280,height=1600)generateCorpus(tweets,'afflorezr',7)dev.off()<br>


El problema que tengo es que las palabras acentuadas, es decir, que la que llevan tildes como "más" me salen diferentes algo como "â", agradezco la ayuda que me puedan brindar para que las palabras salgan correctamente en español.<br>


<br>
Saludos,<br>
<br>
ANDRÉS FELIPE FLÓREZ RIVERA<br>
<br>
<br>
        [[alternative HTML version deleted]]<br>
<br>
<br>_______________________________________________<br>
R-help-es mailing list<br>
<a href="mailto:R-help-es@r-project.org">R-help-es@r-project.org</a><br>
<a href="https://stat.ethz.ch/mailman/listinfo/r-help-es" target="_blank">https://stat.ethz.ch/mailman/listinfo/r-help-es</a><br>
<br></blockquote></div><br></div></div></div>                                           </div></body>
</html>