Declaration: DuplicateGroupAndAppend (Group: integer; Feedback: boolean): integer;
The function DuplicateGroupAndAppend extends the datacube and appends a copy of the spectra of the spectral group specified by the parameters Group to the datacube. The copied spectra form a new group of which the group number is returned by the function. The parameter Feedback controls whether a visual feedback is provided during the execution of the function.

The function returns the following error codes:

>0 ... everything is OK, the returned number is the new group index
-1 ... there is no data assigned to the specified group
-2 ... invalid group number
-3 ... the maximum number of groups has been reached

Hint: This function requires considerable intermediary memory for copying the existing data to the extended data cube. Depending on the size of the copied group it can be up to three times the size of the original dataset.