Description Usage Arguments Details Value Author(s) References See Also Examples
View source: R/Benford_tests.R
Returns a random sample with length n
satisfying Benford's law.
1 | rbenf(n)
|
n |
Number of observations. |
This distribution has the density:
f≤ft(x\right)=\frac{1}{x\cdot ln≤ft(10\right)} \forall x\in[1,10]
Returns a random sample with length n
satisfying Benford's law.
Dieter William Joenssen Dieter.Joenssen@googlemail.com
Benford, F. (1938) The Law of Anomalous Numbers. Proceedings of the American Philosophical Society. 78, 551–572.
1 2 3 4 5 6 7 8 9 10 | #Set the random seed to an arbitrary number
set.seed(421)
#Create a sample satisfying Benford's law
X<-rbenf(n=20)
#Look at sample
X
#should be
# [1] 6.159420 1.396476 5.193371 2.064033 7.001284 5.006184
#7.950332 4.822725 3.386809 1.619609 2.080063 2.242473 1.944697 5.460581
#[15] 6.443031 2.662821 2.079283 3.703353 1.364175 3.354136
|
[1] 6.159420 1.396476 5.193371 2.064033 7.001284 5.006184 7.950332 4.822725
[9] 3.386809 1.619609 2.080063 2.242473 1.944697 5.460581 6.443031 2.662821
[17] 2.079283 3.703353 1.364175 3.354136
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.