well_mat_frames_to_df: Turn a Multi-Frame Matrix into a DataFrame

View source: R/plate.R

well_mat_frames_to_dfR Documentation

Turn a Multi-Frame Matrix into a DataFrame

Description

Takes a matrix where each row is a time point and each column is a well and converts it to a DataFrame containing a column for the well, a column for the row, a column for the column, a column for the time and a column for the values.

Usage

well_mat_frames_to_df(mat, value = "value")

Arguments

mat

A matrix where each column is a well and each row is a frame from a multi time point experiment.

value

Name for the column containing the values in the resulting data frame.

Value

a tibble

Examples

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])

# convert the matrix back to a dataframe
well_mat_frames_to_df(mat)


rforbiochemists/wellr documentation built on March 28, 2024, 4:26 a.m.