[R-es] Leer datos de Unicode

Juan JosŽé Vidal Agust’ín juanjova en um.es
Jue Abr 22 02:01:09 CEST 2010


Hola,

Podemos conocer la codificación de un fichero con el comando file en 
GNU/Linux. Un ejemplo:

juanjo en foundation:~/ejemplo $ file db/seeds.rb
db/seeds.rb: UTF-8 Unicode English text

juanjo en foundation:~/ejemplo $ file db/schema.rb
db/schema.rb: ASCII English text

Aquí podéis ver cómo cambiar la codificación con iconv:
http://mindspill.net/computing/linux-notes/determine-and-change-file-character-encoding.html


Un saludo!



El 21/04/10 17:24, Carlos J. Gil Bellosta escribió:
> Hola, ¿qué tal?
>
> Es difícil saber cuál puede ser el problema: ignoro la configuración
> de tu sistema.
>
> ?read.table dice:
>
> encoding: encoding to be assumed for input strings.  It is used to mark
>            character strings as known to be in Latin-1 or UTF-8: it is
>            not used to re-encode the input, but allows R to handle
>            encoded strings in their native encoding (if one of those
>            two).  See �Value�.
>
> Prueba
>
> read.table("example_unicode.txt", sep="\t", dec=".", header=T,
> encoding = "UTF-8", fill=T)
>
> a ver si funciona.
>
> (Nunca he sabido muy a las ciertas cómo saber cuál es el "encoding" de
> un fichero de texto. Lo suelo abrir con el navegador de internet y voy
> probando.)
>
> Un saludo,
>
> Carlos J. Gil Bellosta
> http://www.datanalytics.com
>
> _______________________________________________
> R-help-es mailing list
> R-help-es en r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-help-es
>



Más información sobre la lista de distribución R-help-es