well_df_to_mat_frames | R Documentation |
Converts a DataFrame to a matrix where each row is a single time point, and each column is a single well. The wells are in index order, indexing across the rows so the first values are all from row A.
well_df_to_mat_frames(data, value, frame, well)
data |
Data frame or tibble to convert to a multi-frame matrix. |
value |
Column with value data that will be used to populate the matrix. |
frame |
Column with the frame or time data that will be used to create the rows of the matrix. |
well |
Column with the well IDs which will be used to create the columns of the matrix. |
a matrix where each column is a well and each row is a time point.
df_list <- lapply(1:10, function(x) {
df <- wellr::well_plate()
df$value <- rnorm(96)
df$frame <- x
df
})
df_frames <- do.call(rbind, df_list)
# convert the data frame to multi-frame matrix
mat <- well_df_to_mat_frames(
data = df_frames,
value = value,
frame = frame,
well = well
)
head(mat[, 1:14])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.