R/loadResult.R

Defines functions loadResult

Documented in loadResult

#' @title Load the Result of a Single Job
#'
#' @description
#' Loads the result of a single job.
#'
#' @template id
#' @template reg
#' @return [\code{ANY}]. The stored result.
#' @family Results
#' @export
loadResult = function(id, reg = getDefaultRegistry()) {
  assertRegistry(reg, sync = TRUE)
  id = convertId(reg, id)
  if (nrow(.findDone(reg, id)) == 0L)
    stopf("Job with id %i not terminated", id$job.id)
  fn = getResultFiles(reg, id)
  return(readRDS(fn))
}

Try the batchtools package in your browser

Any scripts or data that you put into this service are public.

batchtools documentation built on April 20, 2023, 5:09 p.m.