GetReplicate: Generate Replicate Numbers for Plate Data

View source: R/GetReplicate.R

GetReplicateR Documentation

Generate Replicate Numbers for Plate Data

Description

This function takes a plate layout and generates a corresponding matrix of replicate numbers for each sample.

Usage

GetReplicate(plate)

Arguments

plate

A matrix or data frame representing the plate layout, where each cell contains a sample identifier or NA for empty wells.

Value

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.

Note

  • 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.

Examples

plate <- matrix(
  c("A", "B", "C",
    "A", "B", NA,
    "A", "C", "D"),
  nrow = 3, byrow = TRUE
)

replicates <- GetReplicate(plate)
print(replicates)



QuICSeedR documentation built on Sept. 11, 2024, 8:21 p.m.