addSampleMetaData: Add sample meta data

View source: R/addSampleMetaData.R

addSampleMetaDataR Documentation

Add sample meta data

Description

Function to populate slot @meta_sample of the SPATA2 object.

Usage

addSampleMetaData(object, meta_data)

Arguments

object

An object of class SPATA2.

meta_data

A named list of meta data.

See Also

source_df for meta slots known to the SPATAData package.

Examples

# example code

library(SPATA2)
data("example_data")

object <- example_data$object_UKF275T_diet

meta_list <- list(donor_id = "UKF275", organ = "Cerebrum", hist_class = "Glioblastoma")

# prior
getSampleMetaData(object)

# add meta data
object <- addSampleMetaData(object, meta_data = meta_list)

# afterwards
getSampleMetaData(object)

getSampleMetaData(object, as_list = FALSE) # return as data.frame

getSampleMetaData(object, na_rm = FALSE) # return all source_df slots


theMILOlab/SPATAData documentation built on Aug. 27, 2024, 5:04 p.m.