Columns from y that are not in x are merged into x. Columns in x and y are considered equal if they have the same name, the same content, and the same label.

mergeextra(x, y)

Arguments

x

hyperSpec object into which extra data columns of y are to be merged

y

hyperSpec object with further extra data columns

Value

x amended with columns from y

Details

Columns with different content than a column in x with the same name will get ".y" appended to its name.

mergeextra() relies on x and y having the same row order.

Examples

tmp <- flu [, FALSE, ] tmp$prediction <- 1:6 tmp
#> hyperSpec object #> 6 spectra #> 2 data columns #> 0 data points / spectrum #> wavelength: lambda/nm [numeric] #> data: (6 rows x 2 columns) #> 1. spc: [matrix, array0] #> 2. prediction: prediction [integer] 1 2 ... 6
mergeextra(flu, tmp)
#> hyperSpec object #> 6 spectra #> 4 data columns #> 181 data points / spectrum #> wavelength: lambda/nm [numeric] 405.0 405.5 ... 495 #> data: (6 rows x 4 columns) #> 1. spc: I[fl]/"a.u." [matrix, array181] 27.15000 66.80133 ... 294.6495 #> 2. filename: filename [character] rawdata/flu1.txt rawdata/flu2.txt ... rawdata/flu6.txt #> 3. c: c / (mg / l) [numeric] 0.05 0.10 ... 0.3 #> 4. prediction: prediction [integer] 1 2 ... 6