Get Traffic Light Colours for Names

name_to_traffic_light(x)

Arguments

x

character of (file or folder) names, e.g. as they appear as node labels in the plot generated with plot_path_network

Value

vector of colour strings each of which is green (name does comply with naming convention), yellow (name does almost comply with naming convention), red (name does not comply with naming convention).

Examples

# Define a vector of names
x <- c("has_speci&l", "has space", "is_ok")

# Colour names by their compliance with naming convention
name_to_traffic_light(x)
#> [1] "red"    "yellow" "green"