Learn R Programming

sensors4plumes (version 0.9.3)

copySimulations: Copy Simulations (including raster files)

Description

Copy or move the raster files associated with a Simulations object to another directory and update the paths in the Simulations. The resulting Simulations may be saved.

Usage

copySimulations(simulations, newPath, newFile, 
  overwrite = FALSE, deleteOld = FALSE)

Arguments

simulations

Simulations

newPath

path to the directory where to save the files; if it is missing, the raster files are not copied

newFile

filename where to save the resulting simulations; if missing, the simulations are not saved and just returned; the file is saved in the directory newPath if given and else in the current directory

overwrite

logical if files may be overwritten when copying the raster files -- has no influence on saving of the simulations themselves as .Rdata file

deleteOld

logical if the old raster files are to be deleted (move files to new directory instead of copy)

Value

The simulations with paths in the values updated to the new raster files. In addition the raster files are copied or moved to newPath and the simulations may be saved in a .Rdata file. If the values of the simulations are in memory, there are no raster files to be copied. In this case the function will only save the simulations if a newFile is given.

Examples

Run this code
# NOT RUN {
library(sensors4plumesData)
data(radioactivePlumes_area)
radioactivePlumes_area2 = 
  copySimulations(radioactivePlumes_area, 
  newPath = paste0(path.package("sensors4plumesData"), 
  newFile = "radioactivePlumes_area2")
# }

Run the code above in your browser using DataLab