Learn R Programming

RKorAPClient (version 1.4.0)

withCachedResults: Take cached results as they are for the duration of an expression

Description

Sets the cacheAs mode (see cacheAs) while expr is evaluated and puts it back afterwards, so that a whole document can be knitted from the files that are there, without a stray options() call outliving it.

Usage

withCachedResults(expr, mode = c("reuse", "offline"))

Value

the value of expr

Arguments

expr

the code to evaluate

mode

"reuse" to take what the files hold, "offline" to refuse computing anything that is not in one already

See Also

Other cacheAs: blessCacheAs(), cacheAsInfo()

Examples

Run this code
if (FALSE) {
withCachedResults({
  ca <- KorAPConnection() |> collocationAnalysis("Klima", cacheAs = "klima.rds")
  freq <- KorAPConnection() |> frequencyQuery("Klima", cacheAs = "klima-freq.rds")
})
}

Run the code above in your browser using DataLab