View source: R/seq_geometric.R
seq_geometric | R Documentation |
Function to generate a sequence of equal ratios, also known as a geometric sequence. Geometric sequence, also known as a Geometric progression, is a sequence of non-zero numbers where each term after the first is found by multiplying the previous one by a fixed, non-zero number called the common ratio. This function can only generate finite sequences of numbers, not infinite sequences.
seq_geometric(from, to, by.ratio, length.out = NULL)
from |
Number. First term. Scale factor, equal to the sequence's start value. |
to |
Number. If the value closest to the last term in the finite series you want is not 'to' in the identity series, the value closest to 'to' and closest to 'from' in the identity series will be the last term. If 'to' is contained on an geometric sequence, it is the last term. |
by.ratio |
Number. Common ratio. |
length.out |
Number. Desired length of the sequence. A non-negative number. It will be rounded up if fractional. |
Numerical inputs should all be finite (that is, not infinite, NaN or NA).
numeric arguments return a vector of type integer or double: programmers should not rely on which.
seq
seq_geometric(1, 10, 2)
seq_geometric(1, 10, 2, length.out = 3)
seq_geometric(1, 0.001, 0.1)
seq_geometric(1, 0.001, 0.1, length.out = 3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.