s-news
[Top] [All Lists]

[S] Use of latin characters !

To: s-news@wubios.wustl.edu
Subject: [S] Use of latin characters !
From: "Gérald Jean" <Gerald.Jean@spgdag.ca>
Date: Mon, 25 Oct 1999 10:06:05 -0400
Sender: owner-s-news@wubios.wustl.edu

Hello S_users,

a little while ago Ernesto Jardim posted a question about the use of special
characters in S+.  He got a reply from  Alan Zaslavsky.  His exemple sure
doesn't work for me:

> X_"ssdfa\"\347\"as\tdfa\n"
> print(X)
[1] "ssdfa\"\347\"as\tdfa\n"
> cat(X)
ssdfa""as dfa

I assume that the sequence of escape characters are system's specific?  My
questions:

Under Windows NT 4.0, S+ 2000 how do I find what sequence to use for the latin
characters, for exemple: é, è, ê, ç, etc. and
secondly once I find them how do I use them for plot's main titles, axis labels
etc.

Following is Alan Zaslavsky's original reply to Ernesto Jardim.

Thanks,

Gérald Jean
Analyste-conseil (statistiques), Actuariat
télephone            : (418) 835-8839
télecopieur          : (418) 835-5865
courrier électronique: gerald.jean@spgdag.ca

"In God we trust all others must bring data"



From: Ernesto Jardim
> The problem is that when using the "read.table" function to import the
> data the names are imported beteween "" with slashes (\" name \") and
> the special characters are converted in numbers (ç = \347).

The problem with the cedilla and similar characters is not with the way
the data are read in, but with the way they are printed.  Every character
is represented by numbers in the computer but they are not all printed
that way.  By default print() and similar functions will represent
non-standard ASCII characters (e.g.  the ISO Latin extensions that you
are using) using escape sequences for octal coding.  Hence ç = \347.
I'm sure this seems odd to you in an environment where these characters
are part of the standard character set of your language, but not so at
Bell Labs. :-)

Also, some characters are printed out as escape sequences, e.g. \n
for a newline, \t for a tab.  The double quote is one of these, to
distinguish between double quote to delimit the string and double
quote as a character in the string.

If you use cat(), every character goes out as a single character rather
than an escape, e.g.

> X_"ssdfa\"\347\"as\tdfa\n"
> print(X)
[1] "ssdfa\"\347\"as\tdfa\n"
> cat(X)
ssdfa"ç"as     dfa
>

If you use write.table() to write out the contents, you also get the
original characters back.
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news


-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>
  • [S] Use of latin characters !, "Gérald Jean" <=