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,
...
)
A string that defines the directory in which files are located.
A logical variable that defines whether to return relative paths (FALSE
) or absolute paths (TRUE
) (see file_path_as_absolute
).
A logical variable that defines whether or not return a vector (use_list = FALSE
) or a list (use_list = TRUE
).
Additional arguments passed to list.files
(excluding full.names
).
The function returns an ordered list of file paths.
This function requires the stringr
package.
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)
#> Warning: '/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf' already exists
# 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)
#> flapper::pf() called (@ 2023-08-29 15:45:00)...
#> ... Setting up function...
#> ... Determining the set of possible starting locations (t = 1)...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... Implementing algorithm iteratively over time steps...
#> ... ... Time = 1...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 2...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 3...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 4...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 5...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 6...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 7...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 8...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 9...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 10...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 11...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 12...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 13...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 14...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 15...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 16...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 17...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... ... ... For each particle, getting the possible positions for the next time step...
#> Warning: GEOS support is provided by the sf and terra packages among others
#> ... ... Time = 18...
#> ... ... ... Selecting candidate starting positions for the current time step...
#> ... flapper::pf() call completed (@ 2023-08-29 15:45:00) after ~0.01 minutes.
#> $history
#> $history[[1]]
#> id_current pr_current timestep
#> 1 3243 2.425569e-04 1
#> 2 2921 1.312336e-04 1
#> 3 3396 3.947544e-05 1
#> 4 3159 2.364016e-04 1
#> 5 3320 2.525012e-04 1
#> 6 3237 1.312336e-04 1
#> 7 3318 1.942855e-04 1
#> 8 3559 9.359471e-05 1
#> 9 3722 1.808832e-05 1
#> 10 3320 2.525012e-04 1
#>
#> $history[[2]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 3312 1.114181e-04 2
#> 2 NA NA 3634 1.498497e-04 2
#> 3 NA NA 3167 1.114181e-04 2
#> 4 NA NA 3397 2.358249e-04 2
#> 5 NA NA 3244 2.358249e-04 2
#> 6 NA NA 3003 2.174004e-04 2
#> 7 NA NA 2999 2.230610e-04 2
#> 8 NA NA 3398 2.358249e-04 2
#> 9 NA NA 2997 1.960451e-04 2
#> 10 NA NA 3647 4.875953e-05 2
#>
#> $history[[3]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 3557 1.959173e-04 3
#> 2 NA NA 3250 1.569277e-04 3
#> 3 NA NA 3089 1.909455e-04 3
#> 4 NA NA 3713 2.039494e-04 3
#> 5 NA NA 2835 1.721888e-04 3
#> 6 NA NA 2844 1.909455e-04 3
#> 7 NA NA 3470 1.721888e-04 3
#> 8 NA NA 3951 4.721224e-05 3
#> 9 NA NA 2923 2.071280e-04 3
#> 10 NA NA 3395 1.959173e-04 3
#>
#> $history[[4]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 2921 1.826367e-04 4
#> 2 NA NA 3570 9.881423e-05 4
#> 3 NA NA 2603 1.462901e-04 4
#> 4 NA NA 3555 1.826367e-04 4
#> 5 NA NA 2598 8.394284e-05 4
#> 6 NA NA 2515 9.881423e-05 4
#> 7 NA NA 3796 1.462901e-04 4
#> 8 NA NA 4189 1.226931e-04 4
#> 9 NA NA 3472 1.826367e-04 4
#> 10 NA NA 3004 1.901244e-04 4
#>
#> $history[[5]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 3244 1.547789e-04 5
#> 2 NA NA 2355 1.840187e-04 5
#> 3 NA NA 3626 1.032911e-05 5
#> 4 NA NA 2360 1.236215e-04 5
#> 5 NA NA 2522 1.915630e-04 5
#> 6 NA NA 3325 9.191661e-05 5
#> 7 NA NA 3477 1.793489e-04 5
#> 8 NA NA 4508 9.191661e-05 5
#> 9 NA NA 2839 1.793489e-04 5
#> 10 NA NA 4432 8.457801e-05 5
#>
#> $history[[6]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 4348 1.939844e-04 6
#> 2 NA NA 2433 1.890617e-04 6
#> 3 NA NA 2756 1.553795e-04 6
#> 4 NA NA 2522 2.085028e-04 6
#> 5 NA NA 4185 4.674646e-05 6
#> 6 NA NA 2363 1.890617e-04 6
#> 7 NA NA 3159 1.049538e-04 6
#> 8 NA NA 3640 1.303164e-04 6
#> 9 NA NA 2353 1.939844e-04 6
#> 10 NA NA 3164 2.050845e-04 6
#>
#> $history[[7]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 3877 1.203601e-04 7
#> 2 NA NA 2444 2.726068e-04 7
#> 3 NA NA 3078 2.726068e-04 7
#> 4 NA NA 1963 6.310574e-05 7
#> 5 NA NA 3485 1.308034e-04 7
#> 6 NA NA 3316 1.759216e-04 7
#> 7 NA NA 3002 2.301544e-04 7
#> 8 NA NA 3561 2.726068e-04 7
#> 9 NA NA 3887 3.053203e-06 7
#> 10 NA NA 3959 1.308034e-04 7
#>
#> $history[[8]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 4372 4.63305e-06 8
#> 2 NA NA 4293 4.63305e-06 8
#> 3 NA NA 4372 4.63305e-06 8
#> 4 NA NA 4372 4.63305e-06 8
#> 5 NA NA 4372 4.63305e-06 8
#> 6 NA NA 4293 4.63305e-06 8
#> 7 NA NA 4293 4.63305e-06 8
#> 8 NA NA 4293 4.63305e-06 8
#> 9 NA NA 4293 4.63305e-06 8
#> 10 NA NA 4293 4.63305e-06 8
#>
#> $history[[9]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 4618 4.901427e-05 9
#> 2 NA NA 4776 4.901427e-05 9
#> 3 NA NA 4379 7.149016e-05 9
#> 4 NA NA 4697 4.901427e-05 9
#> 5 NA NA 4777 2.185204e-05 9
#> 6 NA NA 4458 1.560181e-04 9
#> 7 NA NA 4459 5.380996e-05 9
#> 8 NA NA 4776 4.901427e-05 9
#> 9 NA NA 4697 4.901427e-05 9
#> 10 NA NA 4538 9.550208e-05 9
#>
#> $history[[10]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 4939 0.0009488491 10
#> 2 NA NA 5099 0.0004165840 10
#> 3 NA NA 5098 0.0005392584 10
#> 4 NA NA 4621 0.0009488491 10
#> 5 NA NA 4699 0.0011238661 10
#> 6 NA NA 4304 0.0002359938 10
#> 7 NA NA 5100 0.0002601637 10
#> 8 NA NA 4383 0.0005841121 10
#> 9 NA NA 4701 0.0008647521 10
#> 10 NA NA 4700 0.0010522080 10
#>
#> $history[[11]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 4308 6.361323e-04 11
#> 2 NA NA 5266 6.599593e-05 11
#> 3 NA NA 5258 1.175753e-03 11
#> 4 NA NA 4229 2.570111e-04 11
#> 5 NA NA 5659 2.923330e-05 11
#> 6 NA NA 4781 1.243031e-03 11
#> 7 NA NA 5102 1.175753e-03 11
#> 8 NA NA 4468 4.536843e-04 11
#> 9 NA NA 4466 1.033352e-03 11
#> 10 NA NA 5345 1.171298e-04 11
#>
#> $history[[12]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5820 0.0013383210 12
#> 2 NA NA 4628 0.0013731676 12
#> 3 NA NA 5022 0.0014517424 12
#> 4 NA NA 4154 0.0003001645 12
#> 5 NA NA 5667 0.0005298601 12
#> 6 NA NA 5430 0.0005298601 12
#> 7 NA NA 4310 0.0014294642 12
#> 8 NA NA 5508 0.0009224773 12
#> 9 NA NA 5030 0.0003309066 12
#> 10 NA NA 5586 0.0010998927 12
#>
#> $history[[13]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5826 0.0016741450 13
#> 2 NA NA 5027 0.0014447953 13
#> 3 NA NA 4155 0.0018160272 13
#> 4 NA NA 5905 0.0011539540 13
#> 5 NA NA 5910 0.0007894996 13
#> 6 NA NA 5108 0.0016741450 13
#> 7 NA NA 5666 0.0018160272 13
#> 8 NA NA 5821 0.0018160272 13
#> 9 NA NA 3995 0.0016741450 13
#> 10 NA NA 4869 0.0016741450 13
#>
#> $history[[14]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5908 0.002710093 14
#> 2 NA NA 5905 0.002912924 14
#> 3 NA NA 5111 0.002279472 14
#> 4 NA NA 5916 0.000222458 14
#> 5 NA NA 6071 0.002641320 14
#> 6 NA NA 5747 0.002821201 14
#> 7 NA NA 6226 0.001353681 14
#> 8 NA NA 5825 0.002865169 14
#> 9 NA NA 6065 0.002710093 14
#> 10 NA NA 5909 0.002865169 14
#>
#> $history[[15]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5915 0.004175310 15
#> 2 NA NA 5355 0.000951710 15
#> 3 NA NA 6306 0.004175310 15
#> 4 NA NA 6229 0.003471003 15
#> 5 NA NA 6159 0.001815174 15
#> 6 NA NA 6228 0.003949324 15
#> 7 NA NA 6071 0.004244902 15
#> 8 NA NA 5835 0.004111237 15
#> 9 NA NA 5829 0.004175310 15
#> 10 NA NA 6151 0.004175310 15
#>
#> $history[[16]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 6390 0.006772105 16
#> 2 NA NA 5994 0.007233304 16
#> 3 NA NA 6398 0.005565623 16
#> 4 NA NA 6312 0.006772105 16
#> 5 NA NA 5197 0.006106878 16
#> 6 NA NA 5917 0.006948435 16
#> 7 NA NA 5998 0.006772105 16
#> 8 NA NA 6079 0.007346035 16
#> 9 NA NA 6158 0.007346035 16
#> 10 NA NA 6158 0.007346035 16
#>
#> $history[[17]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5840 0.015619515 17
#> 2 NA NA 6239 0.018500566 17
#> 3 NA NA 5920 0.017320962 17
#> 4 NA NA 5839 0.017320962 17
#> 5 NA NA 6078 0.018788897 17
#> 6 NA NA 6078 0.018788897 17
#> 7 NA NA 5919 0.018500566 17
#> 8 NA NA 6397 0.018788897 17
#> 9 NA NA 5520 0.004282695 17
#> 10 NA NA 6159 0.018788897 17
#>
#> $history[[18]]
#> id_previous pr_previous id_current pr_current timestep
#> 1 NA NA 5680 0.02369594 18
#> 2 NA NA 5680 0.02369594 18
#> 3 NA NA 5759 0.02505186 18
#> 4 NA NA 6399 0.02369594 18
#> 5 NA NA 6079 0.02505186 18
#> 6 NA NA 5600 0.02505186 18
#> 7 NA NA 5519 0.02505186 18
#> 8 NA NA 5440 0.02505186 18
#> 9 NA NA 6240 0.02505186 18
#> 10 NA NA 6000 0.02505186 18
#>
#>
#> $method
#> [1] "pf"
#>
#> $args
#> $args$record
#> $args$record[[1]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0002624672 (min, max)
#>
#>
#> $args$record[[2]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.000241371 (min, max)
#>
#>
#> $args$record[[3]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0002119992 (min, max)
#>
#>
#> $args$record[[4]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0001976285 (min, max)
#>
#>
#> $args$record[[5]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0001991239 (min, max)
#>
#>
#> $args$record[[6]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0002099076 (min, max)
#>
#>
#> $args$record[[7]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.0002833664 (min, max)
#>
#>
#> $args$record[[8]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.000547046 (min, max)
#>
#>
#> $args$record[[9]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.001037344 (min, max)
#>
#>
#> $args$record[[10]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.001168224 (min, max)
#>
#>
#> $args$record[[11]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.001272265 (min, max)
#>
#>
#> $args$record[[12]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.001485884 (min, max)
#>
#>
#> $args$record[[13]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.001858736 (min, max)
#>
#>
#> $args$record[[14]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.002932551 (min, max)
#>
#>
#> $args$record[[15]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.004273504 (min, max)
#>
#>
#> $args$record[[16]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.007518797 (min, max)
#>
#>
#> $args$record[[17]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.01923077 (min, max)
#>
#>
#> $args$record[[18]]
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 0, 0.02564103 (min, max)
#>
#>
#>
#> $args$data
#> NULL
#>
#> $args$origin
#> [,1] [,2]
#> [1,] 708886.3 6254404
#>
#> $args$calc_distance
#> [1] "euclid"
#>
#> $args$calc_distance_euclid_fast
#> [1] TRUE
#>
#> $args$bathy
#> class : RasterLayer
#> dimensions : 80, 80, 6400 (nrow, ncol, ncell)
#> resolution : 25, 25 (x, y)
#> extent : 707884.6, 709884.6, 6253404, 6255404 (xmin, xmax, ymin, ymax)
#> crs : NA
#> source : memory
#> names : layer
#> values : 37.08789, 192.5775 (min, max)
#>
#>
#> $args$calc_distance_graph
#> NULL
#>
#> $args$calc_movement_pr
#> function(distance, ...) {
#> pr <- stats::plogis(5 + distance * -0.05)
#> pr[distance > 200] <- 0
#> return(pr)
#> }
#> <bytecode: 0x12f2554f8>
#>
#> $args$calc_movement_pr_from_origin
#> function(distance, ...) {
#> pr <- stats::plogis(5 + distance * -0.05)
#> pr[distance > 200] <- 0
#> return(pr)
#> }
#> <bytecode: 0x12f23ef10>
#>
#> $args$mobility
#> [1] 200
#>
#> $args$mobility_from_origin
#> [1] 200
#>
#> $args$n
#> [1] 10
#>
#> $args$resample
#> NULL
#>
#> $args$update_history
#> NULL
#>
#> $args$update_history_from_time_step
#> [1] 1
#>
#> $args$write_history
#> $args$write_history$file
#> [1] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf/"
#>
#>
#> $args$cl
#> NULL
#>
#> $args$use_all_cores
#> [1] FALSE
#>
#> $args$seed
#> [1] 5
#>
#> $args$verbose
#> [1] TRUE
#>
#> $args$optimisers
#> $use_raster_operations
#> [1] TRUE
#>
#> $use_calc_distance_euclid_backend_grass
#> [1] FALSE
#>
#> $use_grass_dir
#> NULL
#>
#> attr(,"class")
#> [1] "list" "pf_optimiser"
#>
#>
#> attr(,"class")
#> [1] "list" "pf_archive"
# List the files
files <- pf_access_history_files(root)
utils::head(files)
#> [1] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_1.rds"
#> [2] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_2.rds"
#> [3] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_3.rds"
#> [4] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_4.rds"
#> [5] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_5.rds"
#> [6] "/var/folders/nl/ygb3g6tj24z06jddbqqhj6hw0000gn/T//Rtmpwb5KFV/pf//pf_6.rds"