% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/readSeroData.R
\name{.relabel_columns}
\alias{.relabel_columns}
\title{Relabel column names to Standardised Naming Convention}
\usage{
.relabel_columns(df)
}
\arguments{
\item{df}{Data frame from `readSeroData()` processing.}
}
\value{
A data fame with columns renamed
}
\description{
This is a helper function to be used inside `readSeroData()` to relabel
columns for each plate.
}
\examples{
\donttest{
your_raw_data <- system.file("extdata", "example_MAGPIX_plate1.csv", package = "SeroTrackR")

if (
 requireNamespace("dplyr", quietly = TRUE) &&
 requireNamespace("janitor", quietly = TRUE)
) {

  # Read in raw luminex file
  df <- .read_luminex_file(your_raw_data)

  # Get the start and end rows of the data section: start = "Median", end = "Net MFI"
  row1    <- which(df$xPONENT == "Median")
  row2    <- which(df$xPONENT == "Net MFI")

  # Apply data processing pipeline, including .relabel_columns()
  df |>
    dplyr::slice((row1 + 1):(row2 - 1)) |>
    janitor::row_to_names(row_number = 1) |>
    janitor::clean_names() |>
    dplyr::select(dplyr::where(~ !all(is.na(.x)))) |>
    dplyr::filter(dplyr::if_any(dplyr::everything(), ~ !is.na(.x))) |>
    dplyr::mutate(dplyr::across(everything(), ~ gsub("NaN", 0, .))) |>
    .relabel_columns()
}
}
}
\author{
Dionne Argyropoulos
}
