Learn R Programming

teal.slice (version 0.6.0)

sanitize_id: Encodes ids to be used in JavaScript and Shiny

Description

Replaces non-ASCII characters into a format that can be used in HTML, JavaScript and Shiny.

When the id has a character that is not allowed, it is replaced with "_" and a 4 character hash of the original id is added to the start of the resulting id.

Usage

sanitize_id(id)

Value

Sanitized string that removes special characters and spaces.

Arguments

id

(character(1)) The id string.