Skip to contents

The Engine R6 class is used to harmonize the interface across different data types for data management and processing.

Note

The engine data is saved in an rds file and loaded in the app. If save file is defined in the engine it is used, otherwise the save file name is automatically set to the engine class name and the date in the format rds. Changes made in the app can be saved in the rds file and then loaded to continue working on the engine by scripting.

Active bindings

Metadata

A Metadata object. When setting it can also be a named list with elements of length one.

Workflow

A Workflow S7 class object. When settings can also be a list of ProcessingStep objects or a full path string to an rds or json file containing a Workflow object.

Analyses

An Analyses S7 class object or a child for a specific data type.

Results

A named list of Results S7 class objects or a child for specific results.

AuditTrail

An AuditTrail S7 class object. Only getter method.

Config

An EngineConfig S7 class object.

type

A character string with the data type of the engine. This is a read-only field.

Methods


Method new()

Creates an Engine R6 class object.

Usage

Engine$new(metadata = NULL, workflow = NULL, analyses = NULL, ...)

Arguments

metadata

A named list or a Metadata object. Each list element must have length one. There is no type restrictions except for name (must be type character), author (must be type character) and date (must be class POSIXct or POSIXt). A file entry must be a character string with a full path to a file.

workflow

A Workflow object, a list of ProcessingStep objects or a character string with a full path to a rds or json file containing a Workflow.

analyses

An Analyses child class or a data specific analyses input. See each data specific engine for details.

...

Additional arguments passed to the method, internal use only.


Method clear_cache()

Clears the cache.

Usage

Engine$clear_cache(value = NULL)

Arguments

value

A character vector with the names of the cache categories to clear. An integer vector with the indices of the categories to clear can alternatively be given to remove categories. If NULL (the default), the entire cache is cleared. Use the method get_cache_info to get the cached categories.


Method clear_results()

Clears all result objects in the Analyses field.

Usage

Engine$clear_results()


Method get_cache_info()

Gets a data.table with the cached data categories.

Usage

Engine$get_cache_info()


Method get_cache_size()

Gets the current size of the cache file.

Usage

Engine$get_cache_size()


Method has_analyses()

Checks if there are analyses files/objects in the Analyses field.

Usage

Engine$has_analyses()


Method has_results()

Checks if there are Results in the Analyses field.

Usage

Engine$has_results(value = NULL)

Arguments

value

A string or a vector of strings with the name/s of the Results child/s for checking the presence.


Method load()

Loads engine data from an sqlite or rds file.

Usage

Engine$load(file = NA_character_)

Arguments

file

A string with the full file path of the sqlite or rds file.

Returns

Invisible.


Method print()

Prints a summary to the console.

Usage

Engine$print()


Method save()

Saves the engine data as an sqlite or rds file. If no file path is given, the engine data is saved in the file of the Metadata field. If no file is specified in the Metadata the engine data is saved as rds format with the engine class and date in the Metadata as file name.

Usage

Engine$save(file = NA_character_)

Arguments

file

A string with the full file path of the sqlite or rds file.

Returns

Invisible.


Method run()

Runs a processing method defined by the ProcessingStep object.

Usage

Engine$run(step = NULL)

Arguments

step

A ProcessingStep object.


Method run_workflow()

Runs all ProcessingStep objects in the Workflow.

Usage

Engine$run_workflow()


Method run_app()

Runs the StreamFind Shiny app to explore, process and manage the engine data.

Usage

Engine$run_app()


Method clone()

The objects of this class are cloneable with this method.

Usage

Engine$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.