peg_sum: Example PEG

Description Usage Arguments Value Examples

View source: R/RcppExports.R

Description

an example of a Parsing Expression Grammar (PEG) that takes a comma-separated string of digits and sums them together

Usage

1

Arguments

x

a vector of strings, each containing a comma-separated set of digits

Value

a vector of numbers, containing either the sum of the equivalent element of x or (if the element could not be parsed) NA.

Examples

1
2
# Simple example
peg_sum("1,2, 5, 91, 34")

piton documentation built on Nov. 16, 2020, 9:13 a.m.