[R] Sweave and complex numbers

Robin Hankin r.hankin at noc.soton.ac.uk
Mon Jul 11 13:25:49 CEST 2005


When using Sweave, most of my functions get called with complex  

They get typeset in with additions that I don't want; "1+1i" appears  
as "1 + (0 + 1i)"
and I would rather have plain old "1+1i".

Example follows:


\title{A Test File}
\author{Robin Hankin}




A simple example:
f <- function(x){

Question: why does \verb=c(1,1+1i)= get printed as
\verb=c(1,1 + (0+1i))= ?

And how can I stop it?


can anyone help me here?

Robin Hankin
Uncertainty Analyst
National Oceanography Centre, Southampton
European Way, Southampton SO14 3ZH, UK
  tel  023-8059-7743

More information about the R-help mailing list