I'm trying to read a data file that contains characters from the Spanish 
language:

> Station <- read.fwf("LosDatos.txt",widths=c(7,7,25,8,8,5),header=FALSE,
+                     skip=3,n=separ[1]-4)

Then the R interpreter issues the following message:

  Error en substring(x, first, last) : 
    invalid multibyte string at '<d1>A, S.'
  Calls: read.fwf -> cat -> sapply -> lapply -> FUN -> substring

I know that the message is because there is a "Ñ" before the text "A, S.".

Is there a way to tell R that the text file is UTF-8 encoded?

Thanks,

--Sergio.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to