Creating an RDO with dependencies

Let’s start by creating a simple RDO that will be a dependency for another RDO.

Now let’s create a new RDO with R code that needs the data_mtcars object to be evaluated first.

The code needs data_mtcars as dependency but no dependency is defined yet.

Running the RDO code will give an error as the dependency is missing.

We can add add the missing dependency to the RDO.

Running the code still gives an error. This time the dependency is present but is not validated. Let’s run the dependency code first.

We can see that our mtcars_half_top RDO has data_mtcars RDO as dependency. The object is validated, and the cache contains top 16 rows of mtcars dataset.

Example RDO definitions

Let’s define more RDOs with respective R code. We can use dependencies argument of the constructor function to set dependencies in one step.

Deep dependencies

Most RDO methods has deep parameter. W hen set to FALSE (default) you won’t be interacting with RDO dependencies. If set to TRUE the method will touch all deep dependencies inside your RDO. By deep dependencies I mean all dependencies of the RDO, their dependencies, and dependencies of their dependencies, etc.

Let’s take the iris_mtcars_test RDO that is at the top of our RDO tree, and see the code needed to reproduce the whole tree.

We can check what dependencies are validated.

Let’s run the code with deep = TRUE. It will run the code of all not validated RDOs.

iris_mtcars_test$run(deep = TRUE)
#> Evaluating RDO: iris_mtcars_test ... has dependencies ...
#> RDO: 'data_mtcars' is validated.
#> RDO: 'mtcars_half_top' is validated.
#> RDO: 'mtcars_half_bottom' is NOT VALIDATED!
#> Evaluating RDO: mtcars_half_bottom ... has dependencies ...
#> RDO: 'data_mtcars' is validated.
#> ...evaluation of mtcars_half_bottom completed.
#> RDO: 'data_iris' is NOT VALIDATED!
#> Evaluating RDO: data_iris ... done!
#> ...evaluation of data_iris completed.
#> RDO: 'iris_selected_rows' is NOT VALIDATED!
#> Evaluating RDO: iris_selected_rows ... has dependencies ...
#> RDO: 'data_iris' is validated.
#> ...evaluation of iris_selected_rows completed.
#> RDO: 'mtcars_whole' is NOT VALIDATED!
#> Evaluating RDO: mtcars_whole ... has dependencies ...
#> RDO: 'mtcars_half_top' is validated.
#> RDO: 'mtcars_half_bottom' is validated.
#> ...evaluation of mtcars_whole completed.
#> RDO: 'iris_selected_columns' is NOT VALIDATED!
#> Evaluating RDO: iris_selected_columns ... has dependencies ...
#> RDO: 'iris_selected_rows' is validated.
#> ...evaluation of iris_selected_columns completed.
#> RDO: 'iris_mtcars' is NOT VALIDATED!
#> Evaluating RDO: iris_mtcars ... has dependencies ...
#> RDO: 'mtcars_whole' is validated.
#> RDO: 'iris_selected_columns' is validated.
#> ...evaluation of iris_mtcars completed.
#> RDO: 'iris_mtcars' is validated.
#> ...evaluation of iris_mtcars_test completed.
iris_mtcars_test$is_validated(deep = TRUE)
#> RDO: 'data_mtcars' is validated.
#> RDO: 'mtcars_half_top' is validated.
#> RDO: 'mtcars_half_bottom' is validated.
#> RDO: 'data_iris' is validated.
#> RDO: 'iris_selected_rows' is validated.
#> RDO: 'mtcars_whole' is validated.
#> RDO: 'iris_selected_columns' is validated.
#> RDO: 'iris_mtcars' is validated.
#> RDO: 'iris_mtcars_test' is validated.
#> [1] TRUE

Now the iris_mtcars_test RDO is deeply validated as all its dependencies are validated as well.

Plotting an RDO tree

We can plot the whole RDO tree. The blue RDOs are validated, the orange ones are not. You can zoom in or out the interactive plot and see the details of each RDO.