EVOLUTION-MANAGER
Edit File: parseQueryString.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><title>R: Parse a GET query string from a URL</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link rel="stylesheet" type="text/css" href="R.css" /> </head><body> <table width="100%" summary="page for parseQueryString {shiny}"><tr><td>parseQueryString {shiny}</td><td style="text-align: right;">R Documentation</td></tr></table> <h2>Parse a GET query string from a URL</h2> <h3>Description</h3> <p>Returns a named list of key-value pairs. </p> <h3>Usage</h3> <pre> parseQueryString(str, nested = FALSE) </pre> <h3>Arguments</h3> <table summary="R argblock"> <tr valign="top"><td><code>str</code></td> <td> <p>The query string. It can have a leading <code>"?"</code> or not.</p> </td></tr> <tr valign="top"><td><code>nested</code></td> <td> <p>Whether to parse the query string of as a nested list when it contains pairs of square brackets <code>[]</code>. For example, the query <span class="samp">a[i1][j1]=x&b[i1][j1]=y&b[i2][j1]=z</span> will be parsed as <code>list(a = list(i1 = list(j1 = 'x')), b = list(i1 = list(j1 = 'y'), i2 = list(j1 = 'z')))</code> when <code>nested = TRUE</code>, and <code>list(`a[i1][j1]` = 'x', `b[i1][j1]` = 'y', `b[i2][j1]` = 'z')</code> when <code>nested = FALSE</code>.</p> </td></tr> </table> <h3>Examples</h3> <pre> parseQueryString("?foo=1&bar=b%20a%20r") ## 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=", ") }) } ## End(Not run) </pre> <hr /><div style="text-align: center;">[Package <em>shiny</em> version 1.5.0 <a href="00Index.html">Index</a>]</div> </body></html>