-
Notifications
You must be signed in to change notification settings - Fork 25
/
geometric.sequence.Rd
executable file
·47 lines (32 loc) · 847 Bytes
/
geometric.sequence.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\name{geometric.sequence}
\alias{GeometricSequence}
\Rdversion{1.0}
\title{
Create a Geometric Sequence
}
\description{ Create a geometric sequence.}
\usage{
GeometricSequence(length, initial.value = 1, discount.factor = .5)
}
\arguments{
\item{length}{A positive integer giving the length of the desired sequence.}
\item{initial.value}{The first term in the sequence. Cannot be zero.}
\item{discount.factor}{The ratio between a sequence term and the
preceding term. Cannot be zero.}
}
\value{
A numeric vector containing the desired sequence.
}
\author{
Steven L. Scott \email{[email protected]}
}
\examples{
GeometricSequence(4, .8, .6)
# [1] 0.8000 0.4800 0.2880 0.1728
GeometricSequence(5, 2, 3)
# [1] 2 6 18 54 162
\dontrun{
GeometricSequence(0, -1, -2)
# Error: length > 0 is not TRUE
}
}