cache_matrix that force recreating the cached file

call %fcache_matrix% fname

Arguments

call

function call

fname

filename

Examples

temp_file <- tempfile(fileext = ".tsv")
calc_mtcars_cyl <- function(cyl) {
    message("calculating")
    as.matrix(mtcars[mtcars$cyl == cyl, ])
}

# Call "calc_mtcars_cyl" function
res1 <- calc_mtcars_cyl(6) %cache_matrix% temp_file
#> calculating

# Force re-calling the function
res2 <- calc_mtcars_cyl(6) %fcache_matrix% temp_file
#> calculating