[R] Error:non-numeric argument in my function
Wacek Kusnierczyk
Waclaw.Marcin.Kusnierczyk at idi.ntnu.no
Wed Jun 3 00:49:21 CEST 2009
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
More information about the R-help
mailing list