Rename the filenames within an MCMC
create_mcmc to create an MCMC.
create_ns_mcmc to create an MCMC
for a Nested Sampling run.
check_mcmc to check if an MCMC is valid.
rename_mcmc_filenames to rename the filenames in an MCMC.
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:
get_remove_dir_fun get a function that removes the directory paths from the filenames, in effect turning these into local files
get_replace_dir_fun get a function that replaces the directory paths from the filenames
get_remove_hex_fun get a function that removes the
hex string from filenames.
# 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() )