Skip to contents

Retrieve the execution counts from a coverage object

Usage

value(x, ...)

Arguments

x

a coverage object, or one of its elements.

...

additional arguments passed to methods.

Value

For a coverage object, a named numeric vector with the number of times each traced expression or line was executed, named like the elements of x (see coverage). For a single element, its count.

Examples

cov <- code_coverage("add <- function(x, y) { x + y }", "add(1, 2)")
value(cov)
#> source.R19a1217d96d1:1:25:1:29:25:29:1:1 
#>                                        1