| store | R Documentation | 
Sometimes you want to use a parsed object to modify a later parser operation,
as in the example below. The store() and retrieve() functions provide the
tools to create such a parser.
store(name, value)
retrieve(name)
| name | a string used as the name of the stored object. | 
| value | object to be stored. | 
Nothing for store() and the stored object for retrieve().
parse_nr <- function(line) {
  m <- stringr::str_extract(line, "number=(\\d+)", group=1)
  if (is.na(m)) list()
  else store("nr", as.numeric(m))
}
p <- function() {
  match_s(parse_nr) %then%
    exactly(retrieve("nr"), literal("A"))
}
p()(c("number=3", "A", "A", "A")) # success
p()(c("number=2", "A", "A", "A")) # failure
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.