Skip to contents

Convenience wrapper that calls estimate_concentration_field() once per value in L_values, returning a combined tidy data.frame with a column L identifying each run. Useful for visualising how the diffusion length changes the field.

Usage

sweep_diffusion_length(L_values, mask, transcript_coords, verbose = FALSE, ...)

Arguments

L_values

Numeric vector of diffusion lengths to sweep over.

mask

An sfc polygon mask (see estimate_concentration_field()).

transcript_coords

Transcript coordinates (see estimate_concentration_field()).

verbose

Logical. If FALSE (default), suppress per-run output.

...

Additional arguments passed to estimate_concentration_field() (e.g. method, grid_resolution, D). Do not pass diffusion_length or verbose here; use the dedicated arguments above.

Value

A data.frame combining field_to_df() output for every value in L_values, with an added column L.

Examples

library(sf)
set.seed(1)
sq   <- st_polygon(list(cbind(c(0,10,10,0,0), c(0,0,10,10,0))))
mask <- st_sfc(sq)
tc   <- data.frame(x = runif(60, 1, 9), y = runif(60, 1, 9))
sw   <- sweep_diffusion_length(c(1, 3, 8), mask, tc,
                               grid_resolution = 64L)
unique(sw$L)
#> [1] 1 3 8