n_times | R Documentation |
Set of (tiny) functions that convert integers into words.
n_times(n)
n_th(n)
n_letter(n)
n |
An integer vector. |
It returns a character vector of length one.
n_th()
: Transforms the integer n
to nth
appropiately.
n_letter()
: Transforms small integers to words.
Laurent Berge
find = function(v, x){
if(x %in% v){
message("The number ", n_letter(x), " appears ", n_times(sum(v == x)),
", the first occurrence is the ", n_th(which(v==x)[1]), " element.")
} else message("The number ", n_letter(x), " was not found.")
}
v = sample(100, 500, TRUE)
find(v, 6)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.