knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = TRUE,
  out.width = "100%"
)

When you use the functions which need specific identification for Subject or QC samples in class of sample_info, if there is a error:

Error: error: No Subject samples in object, please check and see here:

You need to change the column class in sample_info.

Step 1: check the class in your sample_info

load("object_neg")
object <- object_neg
library(masscleaner)
library(tidyverse)
object@sample_info$class

We can see there are no "Subject" in the class, so we need to change the case and control to Subject.

Step 2: change class

object <- 
  object %>% 
  activate_mass_dataset(what = "sample_info") %>% 
  mutate(class = case_when(
    class == "QC" ~ "QC",
    TRUE ~ "Subject"
  ))
object@sample_info$class

Session information

sessionInfo()


tidymass/masscleaner documentation built on Sept. 4, 2023, 3:21 a.m.