GetReplicate {QuICSeedR} | R Documentation |
This function takes a plate layout and generates a corresponding matrix of replicate numbers for each sample.
GetReplicate(plate)
plate |
A matrix or data frame representing the plate layout, where each cell contains a sample identifier or NA for empty wells. |
A data frame with the same dimensions as the input plate, where each cell contains the replicate number for the corresponding sample in the input plate.
Sample identifiers are converted to character type before processing.
The function assumes that the input plate is organized such that replicate samples are encountered sequentially.
The output maintains the column names from the input plate.
plate <- matrix(
c("A", "B", "C",
"A", "B", NA,
"A", "C", "D"),
nrow = 3, byrow = TRUE
)
replicates <- GetReplicate(plate)
print(replicates)