Generate log-linearly spaced sequences.

logspace(x1, x2, n = 50)
  logseq(x1, x2, n = 100)

Arguments

x1

numeric scalar specifying starting point

x2

numeric scalar specifying ending point

n

numeric scalar specifying number of points to be generated

Details

These functions will generate logarithmically resp. exponentially spaced points between x1 and x2 resp. 10^x1 and 10^x2.

If \(n < 2\), the result will be the ending point x2. For logspace(), if x2 = pi, the endpoint will be pi and not 10^pi!

Value

vector containing n points between x1 and x2 inclusive.

See also

logspace, seq

Examples

logspace(1, pi, 36)
#>  [1] 10.000000  9.674596  9.359781  9.055211  8.760551  8.475479  8.199684
#>  [8]  7.932863  7.674725  7.424987  7.183375  6.949625  6.723482  6.504697
#> [15]  6.293032  6.088255  5.890141  5.698473  5.513043  5.333646  5.160088
#> [22]  4.992176  4.829729  4.672568  4.520521  4.373422  4.231109  4.093427
#> [29]  3.960225  3.831358  3.706684  3.586067  3.469376  3.356481  3.247260
#> [36]  3.141593
logseq(0.05, 1, 20)
#>  [1] 0.05000000 0.05853900 0.06853628 0.08024090 0.09394443 0.10998826
#>  [7] 0.12877204 0.15076372 0.17651114 0.20665569 0.24194833 0.28326825
#> [13] 0.33164478 0.38828304 0.45459399 0.53222951 0.62312362 0.72954061
#> [19] 0.85413150 1.00000000