
Create a Functional Matrix from Long Data
make_functional_matrix.RdConverts long-format repeated measurements into a common-grid matrix suitable for functional analyses. Each row corresponds to one subject and each column to one time value, such as days after planting.
Usage
make_functional_matrix(
data,
id_col,
time_col,
value_col,
time_grid = NULL,
fill = NA_real_
)Arguments
- data
A data frame in long format.
- id_col
Subject identifier column.
- time_col
Time column, such as relative day or days after planting.
- value_col
Measured series column.
- time_grid
Optional vector defining the common time grid. If
NULL, the sorted unique values intime_colare used.- fill
Value used for missing combinations.