Re: [R] More elegant magnitude method

2010-12-07 Thread Phil Spector
Jonathan - If I understand correctly, max(0,floor(log(x,10))) will return the value you want. - Phil Spector Statistical Computing Facility Department of Statistics

Re: [R] More elegant magnitude method

2010-12-07 Thread Ravi Varadhan
Message- From: r-help-boun...@r-project.org [mailto:r-help-boun...@r-project.org] On Behalf Of David L Lorenz Sent: Tuesday, December 07, 2010 2:53 PM To: Jonathan P Daily Cc: r-help@r-project.org; r-help-boun...@r-project.org Subject: Re: [R] More elegant magnitude method Jonathan, I'd just r

Re: [R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
#x27;s the word... imbue it." - Jubal Early, Firefly David Winsemius wrote on 12/07/2010 02:50:34 PM: > [image removed] > > Re: [R] More elegant magnitude method > > David Winsemius > > to: > > Jonathan P Daily > > 12/07/2010 02:50 PM > &

Re: [R] More elegant magnitude method

2010-12-07 Thread David L Lorenz
Jonathan, I'd just return the integer part of the common log: floor(log10(x)) Dave From: Jonathan P Daily To: r-help@r-project.org Date: 12/07/2010 01:44 PM Subject: [R] More elegant magnitude method Sent by: r-help-boun...@r-project.org I have a need to find the order of number to

Re: [R] More elegant magnitude method

2010-12-07 Thread David Winsemius
On Dec 7, 2010, at 2:43 PM, Jonathan P Daily wrote: I have a need to find the order of number to get a scaling parameter as a power of 10. I have a function that works *so far*, but it is ugly and probably buggy. In the interest of avoiding code-based outliers in my data, I thought I would as

[R] More elegant magnitude method

2010-12-07 Thread Jonathan P Daily
I have a need to find the order of number to get a scaling parameter as a power of 10. I have a function that works *so far*, but it is ugly and probably buggy. In the interest of avoiding code-based outliers in my data, I thought I would ask if anyone here has a better way. > scl <- function(x