-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpf_access_history_files.Rd
53 lines (49 loc) · 1.87 KB
/
pf_access_history_files.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/pf_access.R
\name{pf_access_history_files}
\alias{pf_access_history_files}
\title{List `history' files from a PF algorithm}
\usage{
pf_access_history_files(
root,
use_absolute_paths = FALSE,
use_list = FALSE,
...
)
}
\arguments{
\item{root}{A string that defines the directory in which files are located.}
\item{use_absolute_paths}{A logical variable that defines whether to return relative paths (\code{FALSE}) or absolute paths (\code{TRUE}) (see \code{\link[tools]{file_path_as_absolute}}).}
\item{use_list}{A logical variable that defines whether or not return a vector (\code{use_list = FALSE}) or a list (\code{use_list = TRUE}).}
\item{...}{Additional arguments passed to \code{\link[base]{list.files}} (excluding \code{full.names}).}
}
\value{
The function returns an ordered list of file paths.
}
\description{
This function creates an ordered vector (or list) of `history' files derived from the particle filtering (PF) algorithm (\code{\link[flapper]{pf}}). This is applicable if \code{\link[flapper]{pf}} is implemented with the \code{write_history} argument specified.
}
\details{
This function requires the \code{\link[stringr]{stringr}} package.
}
\examples{
#### 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)
}
\seealso{
This function is designed to list outputs from \code{\link[flapper]{pf}} (see the \code{write_history} argument).
}
\author{
Edward Lavender
}