Different functions may produce a dataframe of counts or something per cell_id for various attributes. This converts it to a matrix with rownames of cell_id and columns of some feature of interest from the dataframe that can be pivoted out.
Examples
cell_df <- data.frame(
cell_id = c("cell_1", "cell_1", "cell_1"),
some_col = c("A", "B", "C"),
some_val = 1:3
)
make_cellid_matrix(cell_df, name_col = "some_col", val_col = "some_val")
#> A B C
#> cell_1 1 2 3
# A B C
# cell_1 1 2 3