replicate_df {sdmTMB} | R Documentation |
Replicate a prediction data frame over time
Description
Useful for replicating prediction grids across time slices used in model fitting.
Usage
replicate_df(dat, time_name, time_values)
Arguments
dat |
Data frame. |
time_name |
Name of time column in output. |
time_values |
Time values to replicate |
Value
A data frame replicated over time_values
with a new column based on
time_name
.
Examples
df <- data.frame(variable = c("a", "b"))
replicate_df(df, time_name = "year", time_values = 1:3)
head(qcs_grid)
nd <- replicate_df(qcs_grid, "year", unique(pcod$year))
head(nd)
table(nd$year)
[Package sdmTMB version 0.6.0 Index]