check_object_class: Check Object Class

View source: R/data_checking.R

check_object_classR Documentation

Check Object Class

Description

This function checks if the provided object belongs to a specified class. It supports multiple classes including "mass_dataset", "tidymass_parameter", "databaseClass", "metIdentifyClass", and "ms2_data".

Usage

check_object_class(
  object,
  class = c("mass_dataset", "tidymass_parameter", "databaseClass", "metIdentifyClass",
    "ms2_data")
)

Arguments

object

The object to be checked.

class

A character vector specifying the class or classes to check against. Default options are "mass_dataset", "tidymass_parameter", "databaseClass", "metIdentifyClass", and "ms2_data".

Details

The function uses the is function to check if the object belongs to the specified class. If the object does not belong to the class, the function stops and returns an error message.

Value

None. The function stops execution and throws an error if the object does not belong to the specified class.

Author(s)

Xiaotao Shen shenxt1990@outlook.com

Examples

data("expression_data")
data("sample_info")
data("variable_info")
object =
  create_mass_dataset(
    expression_data = expression_data,
    sample_info = sample_info,
    variable_info = variable_info,
  )
check_object_class(object, "mass_dataset")

tidymass/massdataset documentation built on Sept. 14, 2024, 4:41 p.m.