parseQueryString

0th

Percentile

Parse a GET query string from a URL

Returns a named character vector of key-value pairs.

Usage
parseQueryString(str)
Aliases
Examples
parseQueryString("?foo=1&bar=b%20a%20r")

# Example of usage within a Shiny app
shinyServer(function(input, output, clientData) {

  output$queryText <- renderText({
    query <- parseQueryString(clientData$url_search)

    # Ways of accessing the values
    if (as.numeric(query$foo) == 1) {
      # Do something
    }
    if (query[["bar"]] == "targetstring") {
      # Do something else
    }

    # Return a string with key-value pairs
    paste(names(query), query, sep = "=", collapse=", ")
  })
})
Documentation reproduced from package shiny, version 0.9.1, License: GPL-3

Community examples

Looks like there are no examples yet.