save_temperature_scenarios function

Save temperature scenarios generated with temperature_generation

Save temperature scenarios generated with temperature_generation

The temperature_generation can produce synthetic temperature scenarios, but it can take a while to run, especially for large ensembles of climate scenarios. The save_temperature_scenarios function can then save these scenarios to disk as a series of .csv files, so that they can later be used again, without re-running the generation function. Conversely, the load_temperature_scenarios function allows reading the data back into R. This function also works with any other list of data.frames.

save_temperature_scenarios(generated_temperatures, path, prefix)

Arguments

  • generated_temperatures: list of temperature scenarios produced with the temperature_generation function.
  • path: character string indicating the file path where the files are to be written.
  • prefix: character string specifying the prefix for all files.

Returns

no values are returned, but files are written as a side_effect.

Examples

temps<-list(Element1=data.frame(a=1,b=2),Element2=data.frame(a=c(2,3),b=c(8,4))) # save_temperature_scenarios(temps,path=getwd(),prefix="temperatures") # temps_reloaded<-load_temperature_scenarios(path=getwd(),prefix="temperatures")

Author(s)

Eike Luedeling

  • Maintainer: Eike Luedeling
  • License: GPL-3
  • Last published: 2024-11-14

Useful links