pf_setup_record | R Documentation |
This function creates an ordered list of ‘record’ files derived from the AC/DC/ACDC algorithm (ac
, dc
or acdc
) for particle filtering (PF) via pf
.
pf_setup_record(root, type = c("acs", "dc"), use_absolute_paths = FALSE, ...)
root |
A string that defines the directory in which files are loaded. |
type |
A character that defines the source of the files ( |
use_absolute_paths |
A logical variable that defines whether to return relative paths ( |
... |
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 ac
, dc
or acdc
(see the write_record_spatial_for_pf
argument) as required by pf
(see the record
argument).
#### Example (1): Example with the AC algorithm
# Define a directory in which to save files
root <- paste0(tempdir(), "/ac/")
dir.create(root)
# Implement the AC algorithm for some example time series
acc <- dat_acoustics[dat_acoustics$individual_id == 25, ][1:5, ]
out_ac <- ac(
acoustics = acc,
step = 120,
bathy = dat_gebco,
detection_containers = dat_containers,
mobility = 250,
write_record_spatial_for_pf = list(filename = root)
)
# List the files for pf()
files <- pf_setup_record(root, type = "acs", pattern = "*.grd")
utils::head(files)
# Implement pf() using files (not shown).
#### Example (2): Example with the DC algorithm
# Define a directory in which to save files
root <- paste0(tempdir(), "/dc/")
dir.create(root)
# Implement the DC algorithm for some example time series
depth <- dat_archival[dat_archival$individual_id == 25, ][1:5, ]
out_dc <- dc(
archival = depth,
bathy = dat_gebco,
write_record_spatial_for_pf = list(filename = root)
)
# List the files for pf()
files <- pf_setup_record(root, type = "dc", pattern = "*.grd")
utils::head(files)
# Implement pf() using files (not shown).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.