NS

0th

Percentile

Namespaced IDs for inputs/outputs

The NS function creates namespaced IDs out of bare IDs, by joining them using ns.sep as the delimiter. It is intended for use in Shiny modules. See http://shiny.rstudio.com/articles/modules.html.

Keywords
datasets
Usage
NS(namespace, id = NULL)

ns.sep

Arguments
namespace

The character vector to use for the namespace. This can have any length, though a single element is most common. Length 0 will cause the id to be returned without a namespace, and length 2 will be interpreted as multiple namespaces, in increasing order of specificity (i.e. starting with the top-level namespace).

id

The id string to be namespaced (optional).

Details

Shiny applications use IDs to identify inputs and outputs. These IDs must be unique within an application, as accidentally using the same input/output ID more than once will result in unexpected behavior. The traditional solution for preventing name collisions is namespaces; a namespace is to an ID as a directory is to a file. Use the NS function to turn a bare ID into a namespaced one, by combining them with ns.sep in between.

Value

If id is missing, returns a function that expects an id string as its only argument and returns that id with the namespace prepended.

Format

An object of class character of length 1.

See Also

http://shiny.rstudio.com/articles/modules.html

Aliases
  • NS
  • ns.sep
Documentation reproduced from package shiny, version 1.4.0, License: GPL-3 | file LICENSE

Community examples

Looks like there are no examples yet.