pf_access_history_files | R Documentation |
This function creates an ordered vector (or list) of ‘history’ files derived from the particle filtering (PF) algorithm (pf
). This is applicable if pf
is implemented with the write_history
argument specified.
pf_access_history_files(
root,
use_absolute_paths = FALSE,
use_list = FALSE,
...
)
root |
A string that defines the directory in which files are located. |
use_absolute_paths |
A logical variable that defines whether to return relative paths ( |
use_list |
A logical variable that defines whether or not return a vector ( |
... |
Additional arguments passed to |
This function requires the stringr
package.
The function returns an ordered list of file paths.
Edward Lavender
This function is designed to list outputs from pf
(see the write_history
argument).
#### Example (1): Example with default arguments
# Define a directory in which to save files from PF
root <- paste0(tempdir(), "/pf/")
dir.create(root)
# Implement the PF algorithm with write_history specified
# ... For speed, we will implement the algorithm using pre-defined data
pf_args <- dat_dcpf_histories$args
pf_args$calc_distance_euclid_fast <- TRUE
pf_args$write_history <- list(file = root)
do.call(pf, pf_args)
# List the files
files <- pf_access_history_files(root)
utils::head(files)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.