Wacek Kusnierczyk wrote:
>
> interestingly,
>
>     as.complex('0i')
>     # NA
>   

but

    as.complex('0+0i')
    # 0+0i

so that while just 0i is valid as a complex literal, '0i' is not valid
as a string representing a complex.  easy to learn and use.  of course,

    eval(parse(text='0i'))
    # 0+0i

so there's a hack to convert '0i' to 0i.  (there are more hacks available.)

vQ

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to