Skip to contents

`set_metadata` fill metadata slot of a joined_chrom object.

Usage

set_metadata(Object, metadata)

# S4 method for joined_chrom,data.frame
set_metadata(Object, metadata)

Arguments

Object

a joined_chrom object

metadata

a data.frame containing the metadata. It must have a column named as Names to merge with the chromatograms.

Examples


GB08_fl <- system.file("extdata", "08GB.cdf", package = "RGCxGC")
GB09_fl <- system.file("extdata", "09GB.cdf", package = "RGCxGC")
GB08 <- read_chrom(GB08_fl, 5L)
#> Warning: The last 51 signals will be omitted
#> Warning: data length [61051] is not a sub-multiple or multiple of the number of rows [500]
#> Retention time ranges:
#> 1D (min): 7.98 18.16 
#> 2D (sec): 0 5 
#> Acquisition rate: 100 
GB09 <- read_chrom(GB09_fl, 5L)
#> Warning: The last 51 signals will be omitted
#> Warning: data length [61051] is not a sub-multiple or multiple of the number of rows [500]
#> Retention time ranges:
#> 1D (min): 7.98 18.16 
#> 2D (sec): 0 5 
#> Acquisition rate: 100 
extra_info <- data.frame(Names = c("GB08", "GB09"),
                       Type = c("Control", "Treatment"))
join_chrom <- join_chromatograms(GB08, GB09)
join_metadata <- set_metadata(join_chrom, metadata = extra_info)