Skip to contents

[Stable]

make_machine_readable() makes a string machine-readable by converting it to lowercase, removing special characters, and replacing spaces with hyphens.

This function follows the naming conventions from the Tidyverse Style Guide.

Usage

make_machine_readable(x)

Arguments

x

A character vector.

Value

A character vector with machine-readable names.

See also

Other string functions: replace_in_file(), to_ascii(), to_title_case_pt()

Examples

make_machine_readable("Test - Test ")
#> [1] "test-test"
#> [1] "test-test" # Expected

make_machine_readable("!@#TéSt$$%^")
#> [1] "test"
#> [1] "test" # Expected

make_machine_readable("TeSt_test.txt")
#> [1] "test-test.txt"
#> [1] "test-test.txt" # Expected