#' Clean bioanalyzer resuts
#'
#'clean_bioanalyzer_results() tidies bioanalyzer results.
#'
#' @param data path to Results.csv file exported from bioanalyzer.
#'
#' @return A data.frame containing tidied bioanalyzer results.
#'
#' @export
#'
#' @examples
#'
clean_bioanalyzer_results <- function(data) {
data <- read.csv(file = data, header = F)
data <- data.frame(sample_id = data[data$V1 == "Sample Name", "V2"][1:length(data[data$V1 == "Sample Name", "V2"])-1],
concentration_pg.ul = data[data$V1 == "RNA Concentration:", "V2"][1:length(data[data$V1 == "RNA Concentration:", "V2"])-1],
rin = data[data$V1 == "RNA Integrity Number (RIN):", "V2"])
data$concentration_pg.ul <- as.double(data$concentration_pg.ul)
data$rin <- as.double(gsub(pattern = "\\s.*$", replacement = "", x = data$rin))
data
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.