Are you looking for Re() and friends?

Toy examples:

> abs(Re(3+4i))
[1] 3
> abs(Re(-3+4i))
[1] 3
> abs(Re(3))
[1] 3

see ?complex  for further details on complex numbers in R

vito

----- Original Message -----
From: Fred J. <[EMAIL PROTECTED]>
To: r help <[EMAIL PROTECTED]>
Sent: Friday, April 30, 2004 7:56 AM
Subject: [R] absolute value


> Hello
>
> could you please tell me what is the function to get
> the absolute value of the real or complex number.
> most of other languages it is abs(x) , what is it in
> r?
>
> I did few searhces in the help docs for no avail.
>
> thanks
> F.J
>
> ______________________________________________
> [EMAIL PROTECTED] mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide!
http://www.R-project.org/posting-guide.html

______________________________________________
[EMAIL PROTECTED] mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to