event-logging: Log unusual events occurring during execution

Description Usage Arguments Value See Also Examples

Description

For some occasions (like in long-running computations) it may not be desired to shut down the whole computation if a single error occurrs. It may be better to log the occurred error and carry on with the computation. In such a case, NA will always be the result of a failed computation. The logged information can be retrieved via mbte_event_log() (see examples).

Usage

1

Arguments

x

A tbl_mbte with event-log information stored in attributes.

Value

A tibble with logged event-information. Each row represents an event. The column layout is specific to the function, which produced the event-log.

See Also

raw_signals (dataset in examples)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
library(dplyr, warn.conflicts = FALSE)
data(raw_signals)
raw_signals

# prepare for signal extraction (perform conversion to `tbl_mbte` and nest
# signals)
raw_signals <- raw_signals %>%
  group_by(mv) %>%
  new_tbl_mbte(time = "t", value = "value") %>%
  mbte_nest_signals()

# provoke an error by passing an indexing-function, that will always raise
# an error
faulty_extract <- mbte_extract_subsignals(raw_signals, f = function(x) {
  stop("test")
})

# retrieve event-log
event_log <- mbte_event_log(faulty_extract)
head(event_log)

# show occurred errors
head(event_log$error)

mkerschbaumer/mbte documentation built on May 5, 2019, 11:01 p.m.