Diff of /inst/@dataframe/dataframe.m [afaced] .. [591ef1] Maximize Restore

  Switch to unified view

a/inst/@dataframe/dataframe.m b/inst/@dataframe/dataframe.m
...
...
138
              df._name{2} = cellstr (varargin{indi+1});
138
              df._name{2} = cellstr (varargin{indi+1});
139
            otherwise
139
            otherwise
140
              df._name{2} = cellstr (num2str (varargin{indi+1}));
140
              df._name{2} = cellstr (num2str (varargin{indi+1}));
141
          endswitch
141
          endswitch
142
          %# detect assignment - functions calls - ranges
142
          %# detect assignment - functions calls - ranges
143
          dummy = cellfun ('size', cellfun (@(x) strsplit (x, ":=("), df._name{2}, \
143
          dummy = cellfun ('size', cellfun (@(x) strsplit (x, ":=("), df._name{2}, ...
144
                                           "UniformOutput", false), 2);
144
                                           "UniformOutput", false), 2);
145
          if (any (dummy > 1))
145
          if (any (dummy > 1))
146
            warning ('dataframe colnames taken literally and not interpreted');
146
            warning ('dataframe colnames taken literally and not interpreted');
147
          endif
147
          endif
148
          df._name{2} = genvarname (df._name{2});
148
          df._name{2} = genvarname (df._name{2});
...
...
296
        disp('line 245 -- binary garbage in the input file ? '); keyboard
296
        disp('line 245 -- binary garbage in the input file ? '); keyboard
297
      end
297
      end
298
          %# remove the EOL character(s)
298
          %# remove the EOL character(s)
299
          lines(1 == dummy) = {""};
299
          lines(1 == dummy) = {""};
300
          %# use a positive lookahead -- eol is not part of the match
300
          %# use a positive lookahead -- eol is not part of the match
301
          lines(dummy > 1) = cellfun (@(x) regexp (x, ['.*?(?=' eol ')'], \
301
          lines(dummy > 1) = cellfun (@(x) regexp (x, ['.*?(?=' eol ')'], ...
302
                                                   'match'), lines(dummy > 1));
302
                                                   'match'), lines(dummy > 1));
303
          %# a field either starts at a word boundary, either by + - . for
303
          %# a field either starts at a word boundary, either by + - . for
304
          %# a numeric data, either by ' for a string. 
304
          %# a numeric data, either by ' for a string. 
305
          
305
          
306
          %# content = cellfun(@(x) regexp(x, '(\b|[-+\.''])[^,]*(''|\b)', 'match'),\
306
          %# content = cellfun(@(x) regexp(x, '(\b|[-+\.''])[^,]*(''|\b)', 'match'),\
307
          %# lines, 'UniformOutput', false); %# extract fields
307
          %# lines, 'UniformOutput', false); %# extract fields
308
          
308
          
309
          if (strfind (sep, ' '))
309
          if (strfind (sep, ' '))
310
            content = cellfun (@(x) strsplit (x, sep, true), lines, \
310
            content = cellfun (@(x) strsplit (x, sep, true), lines, ...
311
                               'UniformOutput', false); %# extract fields  
311
                               'UniformOutput', false); %# extract fields  
312
          else
312
          else
313
            content = cellfun (@(x) strsplit (x, sep), lines, \
313
            content = cellfun (@(x) strsplit (x, sep), lines, ...
314
                               'UniformOutput', false); %# extract fields 
314
                               'UniformOutput', false); %# extract fields 
315
          endif
315
          endif
316
          
316
          
317
      indl = 1; indj = 1; %# disp('line 151 '); keyboard
317
      indl = 1; indj = 1; %# disp('line 151 '); keyboard
318
          
318
          
...
...
378
        %# it does not look like the trigger. Good.
378
        %# it does not look like the trigger. Good.
379
        %# try to convert to float
379
        %# try to convert to float
380
        if (~ isempty(conv_regexp))
380
        if (~ isempty(conv_regexp))
381
          dummy = regexprep (dummy, conv_regexp{});
381
          dummy = regexprep (dummy, conv_regexp{});
382
        endif
382
        endif
383
        the_line = cellfun (@(x) sscanf (x, "%f"), dummy, \
383
        the_line = cellfun (@(x) sscanf (x, "%f"), dummy, ...
384
                                    'UniformOutput', false);
384
                                    'UniformOutput', false);
385
                
385
                
386
        indk = 1; indm = 1;
386
        indk = 1; indm = 1;
387
        while (indk <= size (the_line, 2))
387
        while (indk <= size (the_line, 2))
388
          if (isempty (the_line{indk}) || any (size (the_line{indk}) > 1)) 
388
          if (isempty (the_line{indk}) || any (size (the_line{indk}) > 1)) 
...
...
511
      %# allow overwriting of column names
511
      %# allow overwriting of column names
512
      df._over{2}(1, indj) = true;
512
      df._over{2}(1, indj) = true;
513
  
513
  
514
    elseif (~isempty (indj))        
514
    elseif (~isempty (indj))        
515
      %# x is an array, generates fieldnames from names given as args
515
      %# x is an array, generates fieldnames from names given as args
516
      if (1 == length (df._name{2}) && length (df._name{2}) < \
516
      if (1 == length (df._name{2}) && length (df._name{2}) < ...
517
          length (indj))
517
          length (indj))
518
        [df._name{2}(indj, 1),  df._over{2}(1, indj)] ...
518
        [df._name{2}(indj, 1),  df._over{2}(1, indj)] ...
519
            = df_colnames (char (df._name{2}), indj);
519
            = df_colnames (char (df._name{2}), indj);
520
      elseif (length (df._name{2}) < indj(1) || isempty (df._name{2}(indj)))
520
      elseif (length (df._name{2}) < indj(1) || isempty (df._name{2}(indj)))
521
        [df._name{2}(indj, 1),  df._over{2}(1, indj)] ...
521
        [df._name{2}(indj, 1),  df._over{2}(1, indj)] ...