childResourcesATModeling <- improveR::loadChildResources(ident='/improve-tutorial/Modeling/') %>%
select(data) %>%
unnest(data) %>%
select(""name"", ""entityId"", ""path"")
How to…
Common Tasks
and how to solve them
This guide provides quick examples for common improveR operations.
get all steps of an analysis tree
get all analysis trees witin a folder
Get all analysis trees inside the folder ‘improve-tutorial’.
allAnalysisTrees <- improveR::loadChildResources(ident="/improve-tutorial/")
allAnalysisTrees$data[[1]] %>% select(nodeType, name, path)
## nodeType name path
## 1 Analysis Tree DataOrder /improve-tutorial/DataOrder
## 2 Analysis Tree Modeling /improve-tutorial/Modeling
## 3 Analysis Tree demoSteps /improve-tutorial/demoSteps
## 4 Analysis Tree yourTree /improve-tutorial/yourTree
## 5 Analysis Tree Review /improve-tutorial/Review
## 6 Analysis Tree newWorkflow /improve-tutorial/newWorkflow
## 7 Analysis Tree EDA /improve-tutorial/EDA
## 8 Analysis Tree Reporting /improve-tutorial/Reportingget all child steps of a step
Version 1:
dfChild <- loadChildSteps(ident="improve-tutorial/Modeling/Step 1")
dfChild$data[[1]] %>%
select(path, resourceId)
## path resourceId
## 1 /improve-tutorial/Modeling/Step 7 ED49CA61567D4F8AB3207C5451AFBA8F
## 2 /improve-tutorial/Modeling/Step 6 9C3323B91A244AAABABFEDE65287891E
## 3 /improve-tutorial/Modeling/Step 8 0C1B181FCC7F441C97AB5986618CBD62
## 4 /improve-tutorial/Review/Step 1 CCC0F17214854EE3977CE373B2C9E13EVersion 2:
envStep <- getStep(ident="improve-tutorial/Modeling/Step 1")
envStep$children$load()
## 2025-10-16 21:34:20.229329 INFO::adding Step 7 ST-54672 to children
## 2025-10-16 21:34:22.608786 INFO::adding Step 6 ST-54651 to children
## 2025-10-16 21:34:24.973057 INFO::adding Step 8 ST-54675 to children
## 2025-10-16 21:34:27.410519 INFO::adding Step 1 ST-65316 to children
ls(envStep$children)
## [1] "load" "Modeling/Step 6/54651" "Modeling/Step 7/54672" "Modeling/Step 8/54675" "Review/Step 1/65316"get the workflow leading to a step
envATReportingStep1 <- getStep("/improve-tutorial/Reporting/Step 1")
# get the workflow and show details on Step 'Modeling/Step 10'
envATReportingStep1$lineage$load(treeDepth=-1)
#show all steps which form part of the workflow
envATReportingStep1$workflow$df()Note that before calling lineage$load(), the df() in the workflow binding will only return the step itself, i.e. Reporting/Step 1.
get the elements aka resources of a step’s inventory
# appraoch 1
stepInventory <- loadChildResources(ident="/improve-tutorial/Modeling/Step 1")$data[[1]]
ncol(stepInventory)
# approach 2
envStep <- getStep(ident="/improve-tutorial/Modeling/Step 1")
stepInventory2 <- envStep$getStepInventory()$data[[1]]
ncol(stepInventory2)
# the approach with getStep returns two additional columns
setdiff(names(stepInventory2), names(stepInventory)) # 'isVersion', 'inventoryPath'
# approach 3
envStep <- getStep(ident="/improve-tutorial/Modeling/Step 1")
envStep$stepDf #no does not show content of inventory; in the inventory is more than remote files;… remove a step from a workflow
step$workflow$removeStep()… get the outdated elements of an inventory
envATReportingStep1 <- getStep("/improve-tutorial/Reporting/Step 1")
changedAndOutdatedFiles <- envATReportingStep1$workflow$changedAndOutdatedFiles()
#outdated elements in an inventory
inventory <- envATReportingStep1$getStepInventory()
inventoryOutdatedLinks <- inventory %>%
select(data) %>%
unnest(data) %>%
filter(outdatedLink==TRUE)
nrow(inventoryOutdatedLinks)
#outdated link in resource
x <- loadResource("/improve-tutorial/Reporting/Step 1")
x$outdatedLink #outdatedLink can be FALSE even if in the inventory of the Step are outdated elements- elaborate on the difference between outdated elements of an inventory and changedAndOutdated in the workflow context
- outdatedAndChanged is different; also includes changed; changes input is a different one; outdatedLink=>here only outdated links; changed: files are not the same; changed red frame; outdated yellow frame
… rerun changed and outdated steps with in a workflow
step$workflow$rerunChangedandOutdated… create a step template
stepTemplateEnv <- createStepTemplateEnv()delete a resource (folder, analysis tree, step)
#Get steps inside the analysis tree
steps <- loadChildResources("improve-tutorial/yourTree")$data[[1]]
steps %>% select(nodeType, name, path, entityId)
## nodeType name path entityId
## 1 Step Step 1 /improve-tutorial/yourTree/Step 1 envhost1.hc.scintecodev.internal-5310:ST-114967
#Delete the steps via their entityId, or equivalent ident
delete(res=steps$entityId)
## [1] TRUE
#Loading child resources of tree again confirms that step(s) were removed
loadChildResources("improve-tutorial/yourTree")$data[[1]]
## data frame with 0 columns and 0 rows