[R] Sweave and complex numbers

From: Robin Hankin <r.hankin_at_noc.soton.ac.uk>
Date: Mon 11 Jul 2005 - 21:25:49 EST


Hi

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

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:

\documentclass[a4paper]{article}

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

\usepackage{a4wide}

\begin{document}

\maketitle

A simple example:
<<print=TRUE>>=
f <- function(x){
x+c(1,1+1i)}
f(6+7i)
@

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

And how can I stop it?

\end{document}

can anyone help me here?

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

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
Received on Mon Jul 11 21:34:37 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:33:28 EST