LG_save: Save function for local Gaussian related information

View source: R/LG_save.R

LG_saveR Documentation

Save function for local Gaussian related information

Description

This internal function simplifies the code of the scribe-functions. It will ensure that the data will be saved with informative names that reveals what part of the code the data originates from.

Usage

LG_save(
  data,
  save_file.Rda = NULL,
  LG_type = c("par_five", "par_one"),
  bootstrap = FALSE,
  part = " ",
  save_dir = ".",
  compression_level = 9
)

Arguments

data

The data we want to store.

save_file.Rda

A file name to be used when saving data. The default value NULL will imply that a name is computed based on the values given to the arguments LG_type, bootstrap and part.

LG_type

One of c("par_five", "par_one"). This tells us whether the data is based on the local Gaussian autocorrelations estimated from the five parameter bivariate Gaussian probability density distribution ("par_five"), or if they have been obtained by the help of the simplified one parameter bivariate Gaussian probability density distribution ("par_one"). This argument will be ignored when save_file.Rda is different from NULL.

bootstrap

This tells us whether our data have been computed from an original time series, or from bootstrap-replicates of it. Default value FALSE. This argument will be ignored when save_file.Rda is different from NULL.

part

This will be used if memory-issues requires that a computation must be partitioned into smaller chunks, in which case a "part_a_of_b" will be added at the end of the file-names. This argument will be ignored when save_file.Rda is different from NULL.

save_dir

The directory into which the data will be saved. The default is ".", i.e. the working directory will be used. The path to the directory can be delivered as a vector containing the different pieces of the path, and this is the way the main functions will do it. This strategy has been selected in order to simplify the bookkeeping in the central info-file, where the folder hierarchy will be stored in a sequence of nested lists.

compression_level

This argument will be delivered to the save-function, in order to reduce the needed disk-space required for the saving of the files. The default value is 9, i.e. the highest level of compression will be used.

Value

This function will save data under a descriptive name in a corresponding named file. The file-name will be returned to the workspace/parent function.

Note

Regarding the case where the LG_type-argument is equal to "par_one": The author of this package has always considered the "par_one"-approach to be reasonable when the aim of the investigation is to estimate a density at a given point. However, the extraction of the correlation value from the resulting density-estimate will in general not capture the local geometrical properties of the targeted distribution at the point of investigation. The "par_one"-approach is as such (in general) a complete waste of computation resources.


LAJordanger/localgaussSpec documentation built on May 6, 2023, 4:31 a.m.