Creates a vector of logarithmicly increasing values between 0 and a specified value `n`. If `n` is specified as 1, the vector will be scaled to between 0 and 1.

log_seq(n, ln = 15, round_values = TRUE, rmv_extremes = FALSE)

Arguments

n

The maximum value that the values in the sequence are scaled to.

ln

How long the vector should be (defaults to 15).

round_values

Option to round values to whole numbers (defaults to `TRUE`).

rmv_extremes

Option to remove zero and the maximum value (i.e. `n`) from the beginning and the end of the returned vector (defaults to `FALSE`). Note that this will mean the length of the returned vector will be `n` - 2.

Value

A vector containing logarithmicly increasing values between 0 and a specified value `n`.

Examples

# Create sequence of length 20, scaled between 0 and 500
log_seq(500,20)
#>  [1]   0   1   5   9  15  20  26  33  40  47  56  65  76  88 103 120 143 176 230
#> [20] 500

# Create sequence of length 15, scaled between 0 and 1
log_seq(1,12)
#>  [1] 0.00000000 0.01378309 0.02901789 0.04604662 0.06534885 0.08762656
#>  [7] 0.11396728 0.14619111 0.18770495 0.24613758 0.34569044 1.00000000