simple_IDs: Simple color coding scheme generator

Description Usage Arguments Value Author(s) References See Also Examples

View source: R/simplecodes.R

Description

Creates a simple color (or symbol) coding scheme used to mark and identify individual animals. The sum of each IDs numeric sequence is a multiple of the number of colors used in the scheme. Even if one marking is removed, the entire ID code can be reconstructed.

Usage

1
simple_IDs(total.length, alphabet, available.colors = NULL)

Arguments

total.length

the number of unique positions to be marked on the animal. (This can be thought of as the total number of positions on which color bands or paint marks will be applied.)

alphabet

an integer representing the 'alphabet size.' This is the number of unique markings (think different paint colors, symbols, or varieties of bands) at your disposal.

available.colors

an optional list of strings that contains the names of the unique markings which compose the given 'alphabet' (e.g. "blue", "red", "yellow", etc.). If left blank, the mapping can be done at any later time using codes_to_colors. Additionally, the length of this list must match the 'alphabet size' given above.

Value

a list containing the maximum possible number of unique ID codes that fit the provided parameters.

If an appropriate argument for available.colors is provided, each code will be a sequence of strings, otherwise, each code will be a sequence of numeric values.

Author(s)

Andrew Burchill, andrew.burchill@asu.edu

References

Burchill, A. T., & Pavlic, T. P. (2019). Dude, where's my mark? Creating robust animal identification schemes informed by communication theory. Animal Behaviour, 154, 203-208. doi:10.1016/j.anbehav.2019.05.013

See Also

rs_IDs, brute_IDs.

Examples

1
2
3
4
5
6
7
8
9
total.length <- 4  #we have four positions to mark
alphabet <- 5      #and we currently have five types of paint in stock

 #Generate codes where the sum of the sequence is a multiple of five
simple_IDs(total.length, alphabet)

 #Let's make those into human-readable color sequences
color.names <- c("blue","red","green","pink","cyan")
simple_IDs(total.length, alphabet, available.colors = color.names)

rabi documentation built on Dec. 10, 2019, 1:08 a.m.