[R] Sweave issue: quotes in verbatim-like output print incorrectly

Peter Dunn dunn at usq.edu.au
Wed Mar 7 06:33:40 CET 2007


Hi all

I love Sweave; use it all the time.

But I recently received a new computer, and ever since I
have had a problem I've never seen before.

For example, I place the following in my Snw file:

<<>>=
sms <- 
read.table("http://www.sci.usq.edu.au/staff/dunn/Datasets/applications/popular/smsspeed.dat",
header=TRUE)
attach(sms)

sms.lm <- lm( Time ~ Age*Phone, subset=(Age>30) )
summary(sms.lm)
@

Standard stuff.   The output appears in the corresponding LaTeX
file as it should, in a verbatim-like environment as it should. 

But since I have had this new machine, this line of output:

Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

appears in my resulting pdf document as

Signif. codes: 0 ^a˘A¨Y***^a˘A´Z0.001 ^a˘A¨Y**^a˘A´Z0.01 ^a˘A¨Y*^a
˘A´Z0.05 ^a˘A¨Y.^a˘A´Z0.1 ^a˘A¨Y^a˘A´Z1

In short, every quote is replaced by garbage.  This makes my
output looks incredibly bad.  (This is true for all cases; the above
is the output from my example.)

I also imagine (hope!) there is a very simple fix.  Can anyone help me?

Documents which used to produce the correct output document
now do this, so it must be something to do with my machine 
set up, or R set up, rather than the documents themselves, I guess.

Any help appreciated.  I have no idea where to look for the solution
(the FAQ. manuals and mailing archives were no help that I could see;
happy to be corrected).

P.


> version
               _
platform       i486-pc-linux-gnu
arch           i486
os             linux-gnu
system         i486, linux-gnu
status         Patched
major          2
minor          4.0
year           2006
month          11
day            25
svn rev        39997
language       R
version.string R version 2.4.0 Patched (2006-11-25 r39997)

> sessionInfo()
R version 2.4.0 Patched (2006-11-25 r39997)
i486-pc-linux-gnu

locale:
LC_CTYPE=en_AU.UTF-8;LC_NUMERIC=C;LC_TIME=en_AU.UTF-8;LC_COLLATE=en_AU.UTF-8;LC_MONETARY=en_AU.UTF-8;LC_MESSAGES=en_AU.UTF-8;LC_PAPER=en_AU.UTF-8;LC_NAME=C;LC_ADDRESS=C;LC_TELEPHONE=C;LC_MEASUREMENT=en_AU.UTF-8;LC_IDENTIFICATION=C

attached base packages:
[1] "stats"     "graphics"  "grDevices" "utils"     "datasets"  "methods"
[7] "base"

-- 
Dr Peter Dunn  |  dunn <at> usq.edu.au
Faculty of Sciences, USQ; http://www.sci.usq.edu.au/staff/dunn
Aust. Centre for Sustainable Catchments: www.usq.edu.au/acsc

This email (including any attached files) is confidential an...{{dropped}}



More information about the R-help mailing list