[R] as.complex

Erich Neuwirth erich.neuwirth at univie.ac.at
Thu Oct 7 00:29:53 CEST 2004

as.complex("2+1i") -> 2+1i
as.complex("2+i") -> NA

Does somebody have a modified version of as.complex
which does the coercion in a less strict manner and
produces a complex number also for strings like the
second example?

Perhaps it would even make sense to change the behavior
of as.complex to handle the second case.
After all, this is an established way of writing
complex numbers in some programming tools
able to deal with complex numbers.

Erich Neuwirth, Computer Supported Didactics Working Group
Visit our SunSITE at http://sunsite.univie.ac.at
Phone: +43-1-4277-38624 Fax: +43-1-4277-9386

More information about the R-help mailing list