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.

merge_data(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.

merge_data() 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

merge_data(flu, tmp)
#> hyperSpec object
#>    6 spectra
#>    4 data columns
#>    181 data points / spectrum