simplify_data: Simplify Watch Data

Description Usage Arguments Details Value See Also

View source: R/simplify.R

Description

Watch data is returned in a list with one element per step of the function evaluation, which is awkward if we want to manipulate the data across steps. This function will simplify variables that are either missing or always of the same type according to the following rules:

Usage

1

Arguments

dat

list the "watch.data" attribute as produced by a watch()ed function.

Details

Variables that change types are just stored in their original format in the list, except for scalars that change to vectors and vice versa, which are treated as vectors.

Not optimized for speed.

Due to the use of the ".scalar", ".id", and ".line" symbols as part of the simplification, the simplification will fail if the watched function contains those symbols. No effort is made to check for that condition.

Value

list with elements '.scalar' which is a data frame of all the scalar variables with one row per step of the function evaluation, and additionally, one element per matrix/data.frame variable, and one list element for each of all the other variables. Except for the ".scalar" element, each top-level element of the return value retains the name of the variable it corresponds to.

See Also

watch(), expand_text()


brodieG/watcher documentation built on Nov. 24, 2019, 12:03 a.m.