make_labels | R Documentation |
Given a requisite number, generates that many unique text labels.
make_labels(N)
N |
The number of labels required, |
Where a list of unique text labels are required (i.e., where simple numbering will not suffice) it can be useful to have a simple function that generates the required amount.
In practice, this is simple in R when N is 26 or less as the LETTERS
object can be used for this purpose. For example, to get ten unique labels:
LETTERS[1:10]
This function works in a similar way but will add a second, third etc. letter where the value of N requires it.
A character vector of N unique labels.
Graeme T. Lloyd graemetlloyd@gmail.com
# Make 40 unique text labels:
make_labels(N = 40)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.