Description Usage Arguments Value Examples
It calculates the probability of digit "d" at the "n"th position.
1 | p.this.digit.at.n(d,n)
|
d |
a digit from 0 to 9 (except at position n=1, where d cannot be 0, it wil give you NA). |
n |
the nth position. |
The probability of d at position n.
1 2 3 4 5 6 7 | p.this.digit.at.n(1,1) # 0.30103
p.this.digit.at.n(1,2) # 0.1138901
p.this.digit.at.n(9,3) # 0.09826716
matrix <- as.data.frame(round(sapply(1:4, function(x) sapply(0:9,p.this.digit.at.n,n=x)),5))
names(matrix) <- paste0("n=",1:4)
rownames(matrix) <- paste0("d=",0:9)
matrix # a table with the probabilities of digits 0 to 9 in positions 1 to 4.
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.