papply: Apply function to all particles

Description Usage Arguments Value

View source: R/particle-apply.R

Description

Function must be formatted to take rows from particle matrix.

Usage

1
2
3
4
5
6
7
8
9
papply(
  particles,
  fun,
  comp_time = F,
  cores = 1L,
  weights = NULL,
  save_comps = !is.null(weights),
  ...
)

Arguments

particles

Particle object.

fun

Function to apply.

comp_time

Record time taken for comutation? Logical.

cores

Use multicore to evaluate? Uses parallel package.

weights

Weights to sum output from fun, if applicable, i.e. if output is a vector.

save_comps

Save components from output of fun, if applicable, i.e. if output is a vector.

...

Other arguments to pass to fun.

Value

Function evaluated at each row.


bonStats/smcdar documentation built on Dec. 19, 2021, 10:47 a.m.