<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
</style></head><body style=" font-family:'Ubuntu'; font-size:9pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Parece ser que el problema puede ser el "encoding".</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">El fichero txt.txt: </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">$ file txt.txt</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">txt.txt: Little-endian UTF-16 Unicode text, with very long lines, with CR line terminators</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Si ejecutamos en R:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">aa <- read.delim("txt.txt", fileEncoding="UTF-16")</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">parece leerlo.</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Un saludo,</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Jorge</p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">On Miércoles, 12 de Marzo de 2014 10:20:44 Carlos Ortega escribió:<br /></p>
<p style=" margin-top:12px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Creo que no se ve la imagen incrustada...<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Lo adjunto como un "zip"...<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:40px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">El 12 de marzo de 2014, 10:18, Carlos Ortega <<a href="mailto:cof@qualityexcellence.es"><span style=" text-decoration: underline; color:#0057ae;">cof@qualityexcellence.es</span></a>> escribió:<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hola Jorge,<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Algo pasa con el fichero...<br />He abierto el link de Dropbox, y he salvado el texto como "txt.txt" en local.<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Pruebo a abrirlo en R y...:<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Consolas'; font-size:10pt; color:#0000ff;">> scan(file="txt.txt")</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Consolas'; font-size:10pt; color:#c5060b;">Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  : </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Consolas'; font-size:10pt; color:#c5060b;">  scan() expected 'a real', got 'ÿþM'</span></p>
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; "> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Consolas'; font-size:10pt; color:#0000ff;">> getwd()</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'Consolas'; font-size:10pt;">[1] "C:/Users/xIs12136/Downloads"</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Pruebo a abrirlo con "vi"... y:<br /><img src="cid:619477670@KDE" /><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">El 12 de marzo de 2014, 9:58, Jorge I Velez <<a href="mailto:jorgeivanvelez@gmail.com"><span style=" text-decoration: underline; color:#0057ae;">jorgeivanvelez@gmail.com</span></a>> escribió:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif'; font-size:small;">Gracias, Miguel.  </span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif'; font-size:small;"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif'; font-size:small;">Desafortunadamente tampoco funciona:</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif'; font-size:small;"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';">head(r)</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';">[1] "\xff\xfeM" "a"         "d"         "f"         "a"         "p"  </span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';">El texto original comienza con </span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';">"Muchos años después, frente al pelotón de fusilamiento, el coronel Aureliano Buendía había de recordar aquella tarde remota en que su padre lo llevó a conocer el hielo...</span><span style=" font-family:'arial,helvetica,sans-serif';">"</span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';">y el objeto r  parece no contener  la informacion en ese orden.</span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';">Alguna otra sugerencia?</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';">Saludos,</span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial,helvetica,sans-serif';">Jorge.- </span> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><span style=" font-family:'arial, helvetica, sans-serif';"><br /></span></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">2014-03-12 19:53 GMT+11:00 <<a href="mailto:miguel.angel.rodriguez.muinos@sergas.es"><span style=" text-decoration: underline; color:#0057ae;">miguel.angel.rodriguez.muinos@sergas.es</span></a>>:</p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:48px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:52px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">Hola.<br /><br />Con r <- scan(txt, character(0)) creo que debiera montarse el texto carácter a carácter.<br />He comprobado que funciona pero no he validado la importación del texto.<br />Igual es un camino que lleva a alguna parte....<br /><br />Un Saludo,<br />Miguel.<br /><br /><br /><br /><br />-----Mensaje original-----<br />De: <a href="mailto:r-help-es-bounces@r-project.org"><span style=" text-decoration: underline; color:#0057ae;">r-help-es-bounces@r-project.org</span></a> [mailto:<a href="mailto:r-help-es-bounces@r-project.org"><span style=" text-decoration: underline; color:#0057ae;">r-help-es-bounces@r-project.org</span></a>] En nombre de Carlos Ortega<br />Enviado el: miércoles, 12 de marzo de 2014 9:48<br />Para: Jorge I Velez<br />CC: R-help-es<br />Asunto: Re: [R-es] Lectura de texto<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:52px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br />Hola Jorge,<br /><br />A mi tampoco me funciona con "scan()", pero sí con "readLines()", aunque el<br />resultado es muy extraño...<br />Aunque puede ser también debido al tipo de conexión que estoy usando en<br />este momento...<br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">> txt <- '<a href="http://dl.dropboxusercontent.com/u/9601860/txt.txt"><span style=" text-decoration: underline; color:#0057ae;">http://dl.dropboxusercontent.com/u/9601860/txt.txt</span></a>'> r <- scan(txt)Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,  :<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:52px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">  scan() expected 'a real', got 'ÿþM'> rr <- readLines(txt, n=-1,<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">encoding="UTF-8")There were 50 or more warnings (use warnings() to see<br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:52px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">the first 50)> head(rr,30) [1] "\xff\xfeM" ""          ""          ""<br />        ""          ""<br /> [7] ""          ""          ""          ""          ""          ""<br />[13] ""          ""          ""          ""          ""          ""<br />[19] ""          ""          ""          ""          ""          ""<br />[25] ""          ""          ""          ""          ""          ""<br /><br /><br /><br /><br />Saludos,<br />Carlos Ortega<br /><a href="http://www.qualityexcellence.es"><span style=" text-decoration: underline; color:#0057ae;">www.qualityexcellence.es</span></a><br /><br /><br /><br /><br />2014-03-12 4:26 GMT+01:00 Jorge I Velez <<a href="mailto:jorgeivanvelez@gmail.com"><span style=" text-decoration: underline; color:#0057ae;">jorgeivanvelez@gmail.com</span></a>>:<br /><br />> Hola a todos,<br />><br />> Me gustaria leer el texto que se encuentra en<br />> <a href="http://dl.dropboxusercontent.com/u/9601860/txt.txt"><span style=" text-decoration: underline; color:#0057ae;">http://dl.dropboxusercontent.com/u/9601860/txt.txt</span></a><br />><br />> He intentado<br />><br />> txt <- '<a href="http://dl.dropboxusercontent.com/u/9601860/txt.txt"><span style=" text-decoration: underline; color:#0057ae;">http://dl.dropboxusercontent.com/u/9601860/txt.txt</span></a>'<br />> r <- scan(txt)<br />> #Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,<br />>  :<br />> # invalid multibyte string at '<ff><fe>M'<br />><br />> r <- read.table(txt, header = FALSE)<br />> #Error in type.convert(data[[i]], <a href="http://as.is"><span style=" text-decoration: underline; color:#0057ae;">as.is</span></a> = <a href="http://as.is"><span style=" text-decoration: underline; color:#0057ae;">as.is</span></a>[i], dec = dec, na.strings<br />> =<br />> #   character(0L)) :  invalid multibyte string at '<ff><fe>M'<br />><br />> Esta es mi sessionInfo():<br />><br />> > sessionInfo()<br />> R version 3.0.2 Patched (2013-12-11 r64449)<br />> Platform: x86_64-apple-darwin10.8.0 (64-bit)<br />><br />> locale:<br />> [1] en_AU.UTF-8/en_AU.UTF-8/en_AU.UTF-8/C/en_AU.UTF-8/en_AU.UTF-8<br />><br />> attached base packages:<br />> [1] stats     graphics  grDevices utils     datasets  methods   base<br />><br />> other attached packages:<br />> [1] foreign_0.8-59<br />><br />> loaded via a namespace (and not attached):<br />> [1] tools_3.0.2<br />><br />><br />> Alguna sugerencia?<br />><br />> Muchas gracias,<br />> Jorge.-<br />><br />>         [[alternative HTML version deleted]]<br />><br />> _______________________________________________<br />> R-help-es mailing list<br />> <a href="mailto:R-help-es@r-project.org"><span style=" text-decoration: underline; color:#0057ae;">R-help-es@r-project.org</span></a><br />> <a href="https://stat.ethz.ch/mailman/listinfo/r-help-es"><span style=" text-decoration: underline; color:#0057ae;">https://stat.ethz.ch/mailman/listinfo/r-help-es</span></a><br />><br /><br /><br /><br />--<br />Saludos,<br />Carlos Ortega<br /><a href="http://www.qualityexcellence.es"><span style=" text-decoration: underline; color:#0057ae;">www.qualityexcellence.es</span></a><br /><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;">        [[alternative HTML version deleted]]<br /><br /><br />________________________________<br /><br />Nota: A información contida nesta mensaxe e os seus posibles documentos adxuntos é privada e confidencial e está dirixida únicamente ó seu destinatario/a. Se vostede non é o/a destinatario/a orixinal desta mensaxe, por favor elimínea. A distribución ou copia desta mensaxe non está autorizada.<br /><br />Nota: La información contenida en este mensaje y sus posibles documentos adjuntos es privada y confidencial y está dirigida únicamente a su destinatario/a. Si usted no es el/la destinatario/a original de este mensaje, por favor elimínelo. La distribución o copia de este mensaje no está autorizada.<br /><br />See more languages: <a href="http://www.sergas.es/aviso_confidencialidad.htm"><span style=" text-decoration: underline; color:#0057ae;">http://www.sergas.es/aviso_confidencialidad.htm</span></a><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /></p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:44px; margin-right:40px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /><br />-- <br /><span style=" font-family:'verdana,sans-serif';">Saludos,<br />Carlos Ortega<br /></span><a href="http://www.qualityexcellence.es"><span style=" font-family:'verdana,sans-serif'; text-decoration: underline; color:#0057ae;">www.qualityexcellence.es</span></a> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /><br />-- <br /><span style=" font-family:'verdana,sans-serif';">Saludos,<br />Carlos Ortega<br /></span><a href="http://www.qualityexcellence.es"><span style=" font-family:'verdana,sans-serif'; text-decoration: underline; color:#0057ae;">www.qualityexcellence.es</span></a> </p>
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br /><br /></p></body></html>