lseq: 'lseq' output a sequence of logarithmically spaced numbers.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/lseq.R

Description

lseq works like seq in that it returns a vector of numbers with from as the first element, to as the last element, and length.out as the length of the vector, but the values are logarithmically spaced.

Usage

1
lseq(from, to, length.out = 10)

Arguments

from

first number in the sequence.

to

last number in the sequence.

length.out

length of the sequence, a positive integer > 1. Default is 10.

Value

A numeric vector.

Author(s)

Boris Steipe (aut)

See Also

seq

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# 20 log-spaced values between 0.1 and 10
lseq(0.1, 10, length.out = 20)

# plot a square, log-spaced grid with 10 cells
lim <- c(0.1, 10)
N <- 10
x <- lseq(lim[1], lim[2], length.out = N + 1)
plot(1, 1, xlim=lim, ylim=lim, type="n", axes=FALSE, xlab="", ylab="", asp=1)
segments(lim[1], x, lim[2], x, col="#3366FF66")
segments(x, lim[1], x, lim[2], col="#3366FF66")

KevinJianLin/GEOSystemBio documentation built on Feb. 14, 2019, 2:26 p.m.