Hello, in scilab /Matlab there are functions that can create linear sequences (like R's seq()) as well as logarithmic sequences. Is there a logarithmic aequivalent of seq()? Or maybe this would be an idea for newer R-releases, maybe a type-option with "linear" and "logarithmic" as parameters....?! Ciao, Oliver
On 21-Sep-09 18:47:50, Oliver Bandel wrote:> Hello, > in scilab /Matlab there are functions that can create linear > sequences (like R's seq()) as well as logarithmic sequences. > > > Is there a logarithmic aequivalent of seq()? > Or maybe this would be an idea for newer R-releases, > maybe a type-option with "linear" and "logarithmic" as > parameters....?! > > Ciao, > OliverIf you mean going from a to b by "logarithmically equal" steps, then you can quite readily implement it yourself. For example: exp(log(10)*seq(log10(1),log10(100),by=0.25) [1] 1.000000 1.778279 3.162278 5.623413 10.000000 [6] 17.782794 31.622777 56.234133 100.000000 One could turn this sort of thing into a function, though a function which includes the various ways of doing it that are encapsulated in plain seq() would be quite complicated for a "normal" user to write, so I think there is an argument for your proposal! Ted. -------------------------------------------------------------------- E-Mail: (Ted Harding) <Ted.Harding at manchester.ac.uk> Fax-to-email: +44 (0)870 094 0861 Date: 21-Sep-09 Time: 20:32:22 ------------------------------ XFMail ------------------------------
On Sep 21, 2009, at 2:47 PM, Oliver Bandel wrote:> Hello, > > > in scilab /Matlab there are functions that can create linear > sequences (like R's > seq()) as well as logarithmic sequences. > > > Is there a logarithmic aequivalent of seq()? > Or maybe this would be an idea for newer R-releases, > maybe a type-option with "linear" and "logarithmic" as > parameters....?! >A question came up recently to which the answer something along the lines of: exp( seq(log(x[1], log(x[length(x)]), length.out=6) ) Is that what you meant by a logarithmic sequence? Or would it be: log(1:10) # ? David Winsemius, MD Heritage Laboratories West Hartford, CT
Apparently Analagous Threads
- explanation why RandomForest don't require a transformations (e.g. logarithmic) of variables
- High density scatter plot with logarithmic binning
- Can levelplot colorkeys display a logarithmic scale evenly?
- Logarithmic axis
- How to plot data in logarithmic scale