Those interested in this issue will find a follow up on stackoverflow:
http://stackoverflow.com/questions/18876204/imaginary-units-of-complex-numbers-dropped-by-knitr

Briefly, the observed behaviour is related to an upstream bug in
getParseData(), which should be fixed in the first R-patched following the
release of R-3.0.2, as announced by Duncan Murdoch.

Cheers,
Andrzej


On Wed, Sep 18, 2013 at 12:41 PM, Andrzej Oleś <andrzej.oles@gmail.com>wrote:

> Hi,
> I came across a strange issue in 'knitr' with R code containing complex
> numbers entered directly using the "x + yi" notation. For an illustration
> see the minimal example: http://goo.gl/Yj77kI
>
> The sample code evaluates correctly, both in R console and as a code chunk
> when compiled with Sweave, resulting in:
> > 1i^2
> [1] -1+0i
>
> However, when trying to use 'knitr' on the same document, the imaginary
> unit seems to get lost and what I get is:
> 1^2
> ## [1] 1
>
> Any ideas?
>
> Cheers,
> Andrzej
>

	[[alternative HTML version deleted]]

