[R] Problem with number characters

Prof Brian Ripley ripley at stats.ox.ac.uk
Sat Oct 16 10:51:48 CEST 2004


Since ISO-8859 has many different encodings, you need something more
precise.  I am seeing 'iso8859-15' embedded in that email.  AFAIK GNU
`file' or any other Linux utility does not know the encoding of a file,
and it is guessing that it has `ISO-8859 text' when it sees 8-bit files
that are not apparently UTF-8 etc.

R assumes that text files are encoded in the current locale (and does not 
support multibyte locales). That is planned to change one day.

On Sat, 16 Oct 2004, Bobby Corpus wrote:

> Hi Scott,
> 
> What's the result of running  the linux "file" command on your input file?
> Does it give "ISO-8859 text " or something else?
> 
> example:
> [bobby at thor bobby]$ file test2.txt
> test2.txt: ISO-8859 text
> 
> Best regards,
> 
> Bobby
> 
> 
> On Thu, 14 Oct 2004 11:31:33 -0700, Scott Waichler
> <scott.waichler at pnl.gov> wrote:
> > I am trying to process text fields scanned in from a csv file that is
> > output from the Windows database program FileMakerPro.  The characters
> > onscreen look like regular text, but R does not like their underlying binary form.
> > For example, one of text fields contains a name and a number, but
> > R recognizes the number as something other than what it appears
> > to be in plain text.  The character string "Draszt  03" after being
> > read into R using scan and ="" becomes "Draszt 03" where the 3 is
> > displayed in my R session as a superscript.  Here is the result pasted
> > into this email I'm composing in emacs:  "Draszt 0%/1?iso8859-15³"
> > Another clue for the knowledgable:  when I try to display the vector element
> > causing trouble, I get
> >   <CHARSXP: "Draszt 0%/1?iso8859-15³">
> > where again the superscipt part is just "3" in my R session.  I'm working in
> > Linux, R version 1.9.1, 2004-06-21.  Your help will be much appreciated.

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list