parseQueryString
parseQueryString(str, nested = FALSE)Arguments
| str | The query string. It can have a leading "?"or not. | 
|---|---|
| nested | Whether to parse the query string of as a nested list when it
contains pairs of square brackets []. For example, the query
a[i1][j1]=x&b[i1][j1]=y&b[i2][j1]=z will be parsed aslist(a =
list(i1 = list(j1 = 'x')), b = list(i1 = list(j1 = 'y'), i2 = list(j1 =
'z')))whennested = TRUE, andlist(`a[i1][j1]` = 'x',
`b[i1][j1]` = 'y', `b[i2][j1]` = 'z')whennested = FALSE. | 
Description
Returns a named list of key-value pairs.
Examples
$foo
[1] "1"
$bar
[1] "b a r"
## Not run: ------------------------------------
# # Example of usage within a Shiny app
# function(input, output, session) {
# 
#   output$queryText <- renderText({
#     query <- parseQueryString(session$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=", ")
#   })
# }
## ---------------------------------------------