R: [R] absolute value

Vito Muggeo vito.muggeo at giustizia.it
Fri Apr 30 08:25:44 CEST 2004


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. <phddas at yahoo.com>
To: r help <r-help at stat.math.ethz.ch>
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
>
> ______________________________________________
> R-help at stat.math.ethz.ch 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




More information about the R-help mailing list