View source: R/numberScientific.R
| numberScientific | R Documentation | 
Recognises a number in scientific notation, i.e., a floating-point number with an (optional) exponential part.
  numberScientific(action = function(s) list(type="numberScientific",value=s), 
                   error  = function(p) list(type="numberScientific",pos=p)  ) 
| action | Function to be executed if recognition succeeds. Character stream making up the token is passed as parameter to this function | 
| error | Function to be executed if recognition does not succeed. Position of  | 
Anonymous function, returning a list.
function(stream) –>   list(status,node,stream) 
From input parameters, an anonymous function is defined. This function admits just one parameter, stream, with type streamParser, and returns a three-field list:
status
"ok" or "fail"
node
With action or error function output, depending on the case
stream
With information about the input, after success or failure in recognition
# fail
stream  <- streamParserFromString("Hello world")
( numberScientific()(stream) )[c("status","node")]
# ok 
stream  <- streamParserFromString("-1234e12")
( numberScientific()(stream) )[c("status","node")]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.