rename_mcmc_filenames {beautier} | R Documentation |
Rename the filenames within an MCMC
Description
Rename the filenames within an MCMC
Usage
rename_mcmc_filenames(mcmc, rename_fun)
Arguments
mcmc |
one MCMC.
Use |
rename_fun |
a function to rename a filename, as can be checked by check_rename_fun. This function should have one argument, which will be a filename or NA. The function should return one filename (when passed one filename) or one NA (when passed one NA). Example rename functions are:
|
Value
an 'mcmc' (see create_mcmc) with renamed filenames
Examples
check_empty_beautier_folder()
# Create an MCMC with local filenames
mcmc <- create_mcmc()
mcmc$tracelog$filename <- "trace.log"
mcmc$screenlog$filename <- "screen.log"
mcmc$treelog$filename <- "tree.log"
# Nah, files should be put in '/home/john' folder
mcmc <- rename_mcmc_filenames(
mcmc = mcmc,
rename_fun = get_replace_dir_fun("/home/john")
)
# Nah, files should be put in '/home/doe' folder instead
mcmc <- rename_mcmc_filenames(
mcmc = mcmc,
rename_fun = get_replace_dir_fun("/home/doe")
)
# Nah, files should be put in local folder instead
mcmc <- rename_mcmc_filenames(
mcmc = mcmc,
rename_fun = get_remove_dir_fun()
)
check_empty_beautier_folder()