Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread Keith Jewell
Sadz A sadz_a1...@yahoo.co.uk wrote in message news:419230.77523...@web24610.mail.ird.yahoo.com... Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread David Winsemius
will be appreciated. Thank you sadz From: David Winsemius dwinsem...@comcast.net To: David Winsemius dwinsem...@comcast.net Cc: Sadz A sadz_a1...@yahoo.co.uk; r-help@r-project.org Sent: Wed, 20 October, 2010 20:45:39 Subject: Re: [R] Changing sign on absolute numbers 0 problems On Oct 20, 2010, at 3

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread Sadz A
Thank you so much! From: David Winsemius dwinsem...@comcast.net Cc: r-help r-help r-help@r-project.org Sent: Thu, 21 October, 2010 15:43:37 Subject: Re: [R] Changing sign on absolute numbers 0 problems With permission I am copying a private communication

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-21 Thread Keith Jewell
Winsemius dwinsem...@comcast.net Cc: Sadz A sadz_a1...@yahoo.co.uk; r-help@r-project.org Sent: Wed, 20 October, 2010 20:45:39 Subject: Re: [R] Changing sign on absolute numbers 0 problems On Oct 20, 2010, at 3:19 PM, David Winsemius wrote: On Oct 20, 2010, at 11:47 AM, Sadz A wrote: Hi

[R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Sadz A
Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation is to use absolute numbers then use the 'sign' function in R to change the answer back to the correct

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 11:47 AM, Sadz A wrote: Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation is to use absolute numbers then use the 'sign'

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Ben Bolker
Sadz A sadz_a1000 at yahoo.co.uk writes: This works fine untill D=0 because then 'sign' does not give 0 a +ve sign it takes it as 0 and multiplies decimal by 0 to give 0. example D-0 decimal-D+(M/60)+(S/3600) decimal.degs-sign(D)*decimal decimal.degs 0 decimal.degs -

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread David Winsemius
On Oct 20, 2010, at 3:19 PM, David Winsemius wrote: On Oct 20, 2010, at 11:47 AM, Sadz A wrote: Hi, I am trying to do some calculations turning DMS data to decimal degrees using the formula (D+(M/60)+(S/3600)), some of the D's involve -ve numbers, the easiest way to do the calculation

Re: [R] Changing sign on absolute numbers 0 problems

2010-10-20 Thread Brian Diggs
On 10/20/2010 12:25 PM, Ben Bolker wrote: Sadz Asadz_a1000at yahoo.co.uk writes: This works fine untill D=0 because then 'sign' does not give 0 a +ve sign it takes it as 0 and multiplies decimal by 0 to give 0. example D-0 decimal-D+(M/60)+(S/3600) decimal.degs-sign(D)*decimal decimal.degs