Learn R Programming

chillR (version 0.75)

save_temperature_scenarios: Save temperature scenarios generated with temperature_generation

Description

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.

Usage

save_temperature_scenarios(generated_temperatures, path, prefix)

Value

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

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.

Author

Eike Luedeling

Examples

Run this code

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")

 

Run the code above in your browser using DataLab