well_df_to_mat | R Documentation |
Extracts row and column information from the column specified by well_col
(defaults to 'well') and uses this to create a matrix that contains values
from the values_from
column.
well_df_to_mat(df, values_from, well_col = "well", plate = NULL)
df |
A dataframe containing at least a column called "well" that contains well IDs. |
values_from |
Column that contains values to populate matrix. |
well_col |
Column containing the well IDs to extract row and column information from. |
plate |
Size of the plate, to override the auto-detected plate size. |
A matrix containing the values that were present in the data frame in
the values_from
column
library(wellr)
# pivot a long data frame into a matrix based on the row and col columns,
# with values from a given column
plate <- well_plate(8, 12)
plate$value <- seq(nrow(plate))
well_df_to_mat(plate, values_from = "value")
# the function also handles missing values from a plate, filling with with NA
# if certain wells are missing
plate <- well_plate(7, 11)
plate$value <- seq(nrow(plate))
well_df_to_mat(plate, values_from = "value", plate = 384)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.