Create a log sequence across multiple orders of magnitude

There is also a lseq() function in library("emdbook"), that I just copy/paste into my code for log-ticks: http://artax.karlin.mff.cuni.cz/r-help/library/emdbook/html/lseq.html

I've written my own function to use it thusly:

lseq <- function(from=1, to=100000, length.out=6) {
  # logarithmic spaced sequence
  # blatantly stolen from library("emdbook"), because need only this
  exp(seq(log(from), log(to), length.out = length.out))
}

Running lseq() then returns 1 10 100 1000 10000 100000


I like this one:

c(2:10 %o% 10^(3:7))

Tags:

R

Ggplot2

Seq