You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: combineFactors.m
    path of file: ./repos/matStats/matStats/@Table
    
    the code of the file until where you have to start completion: function res = combineFactors(obj, varargin)
% Aggregate two factors to create a new factor.
%
%   RES = combineFactors(GROUP)
%   Extract group indices and names from the input GROUP. The input GROUP
%   can be either:
%   * a cell array of values
%   * a numeric array
%   * a data table (assuming factor columns)
%   The output variable RES is a new data table, containing for each row
%   the result of the combination of the different factors.
%
%   Example
%     % create a table with two different group values
%     TAB = Table([1 1; 1 2; 1 1; 1 2; 2 3; 2 4; 2 3], {'group1', 'group2'});
%     TAB.setAsFactor([1 2]);
%     % combine the two factor columns
%     COMBI = combineFactors(TAB(:, [1 2]))
%         COMBI = 
%                  group1*group2
%         1                  1*1
%         2                  1*2
%         3                  1*1
%         4                  1*2
%         5                  2*3
%         6                  2*4
%         7                  2*3
%     % show the unique levels of the resulting factor
%     COMBI.levels{1}
%         ans = 
%             '1*1'
%             '1*2'
%             '2*3'
%             '2*4'
%
%   See also
%     reorderLevels

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2013-04-26,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2013 INRA - Cepia Software Platform.


%% Parse input arguments

    
function res = combineFactors(obj, varargin)
% Aggregate two factors to create a new factor.
%
%   RES = combineFactors(GROUP)
%   Extract group indices and names from the input GROUP. The input GROUP
%   can be either:
%   * a cell array of values
%   * a numeric array
%   * a data table (assuming factor columns)
%   The output variable RES is a new data table, containing for each row
%   the result of the combination of the different factors.
%
%   Example
%     % create a table with two different group values
%     TAB = Table([1 1; 1 2; 1 1; 1 2; 2 3; 2 4; 2 3], {'group1', 'group2'});
%     TAB.setAsFactor([1 2]);
%     % combine the two factor columns
%     COMBI = combineFactors(TAB(:, [1 2]))
%         COMBI = 
%                  group1*group2
%         1                  1*1
%         2                  1*2
%         3                  1*1
%         4                  1*2
%         5                  2*3
%         6                  2*4
%         7                  2*3
%     % show the unique levels of the resulting factor
%     COMBI.levels{1}
%         ans = 
%             '1*1'
%             '1*2'
%             '2*3'
%             '2*4'
%
%   See also
%     reorderLevels

% ------
% Author: David Legland
% e-mail: david.legland@inra.fr
% Created: 2013-04-26,    using Matlab 7.9.0.529 (R2009b)
% Copyright 2013 INRA - Cepia Software Platform.


%% Parse input arguments

keepFactorNames = false;

% parse input options
while length(varargin) > 1
    paramName = lower(varargin{1});
    switch paramName
        case 'keepfactornames'
            keepFactorNames = varargin{2};
        otherwise
            error(['Unknown parameter name: ' paramName]);
    end