Skip to contents

Execute a CDO operation

Usage

cdo_execute(
  operation,
  output = temp_output(operation),
  options = NULL,
  verbose = FALSE,
  cache = FALSE
)

cdo_execute_list(
  operations,
  output = NULL,
  options = NULL,
  verbose = FALSE,
  cache = FALSE
)

Arguments

operation

a CDO operation

output

an output file or base string for output files. Defaults to temporary files that will be deleted when its bond variable is garbage collected.

options

character vector with CDO options.

verbose

whether to print the command being executed.

cache

whether to cache results.

operations

a list of CDO operations

Details

When cache = TRUE cdo_execute will try to reuse results. When first executing the operation, it will create a ".hash" file matching the output file name with a hash generated from the current cdo version, the text of the command, the sum of the file sizes of the input files and the max modified time of the input files. The next time the same command is executed, cdo_execute will compute the same hash and compare it with the file and, if it matches, it will return the output file without running the command. Caching currently only works with operations with only one output file.