This function allows you to create new computational jobs (just like batchMap
based on the results of
a Registry
.
batchMapResults( fun, ids = NULL, ..., more.args = list(), target, source = getDefaultRegistry() )
fun | [ |
---|---|
ids | [ |
... | [ANY] |
more.args | [ |
target | [ |
source | [ |
[data.table
] with ids of jobs added to target
.
The URI to the result files in registry source
is hard coded as parameter in the target
registry.
This means that target
is currently not portable between systems for computation.
Other Results:
loadResult()
,
reduceResultsList()
,
reduceResults()
batchtools:::example_push_temp(2) # Source registry: calculate square of some numbers tmp = makeRegistry(file.dir = NA, make.default = FALSE)#>#>#>#>#> [1] TRUE# Target registry: calculate the square root on results of first registry target = makeRegistry(file.dir = NA, make.default = FALSE)#>#>batchMapResults(fun = function(x, y) list(sqrt = sqrt(x$square)), ids = 4:8, target = target, source = tmp)#>#>#> [1] TRUE# Map old to new ids. First, get a table with results and parameters results = unwrap(rjoin(getJobPars(reg = target), reduceResultsDataTable(reg = target))) print(results)#> job.id .id sqrt #> 1: 1 4 4 #> 2: 2 5 5 #> 3: 3 6 6 #> 4: 4 7 7 #> 5: 5 8 8# Parameter '.id' points to job.id in 'source'. Use a inner join to combine: ijoin(results, unwrap(reduceResultsDataTable(reg = tmp)), by = c(".id" = "job.id"))#> job.id .id sqrt square #> 1: 1 4 4 16 #> 2: 2 5 5 25 #> 3: 3 6 6 36 #> 4: 4 7 7 49 #> 5: 5 8 8 64