Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

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

  Switch to unified view

a/inst/@dataframe/private/df_pad.m b/inst/@dataframe/private/df_pad.m
...
...
139
      endif
139
      endif
140
      for indi = (coltype)
140
      for indi = (coltype)
141
        switch df._type{indi}
141
        switch df._type{indi}
142
          case {'char'}
142
          case {'char'}
143
            if (isa (df._data{indi}, 'char')) %# pure char
143
            if (isa (df._data{indi}, 'char')) %# pure char
144
              dummy = horzcat (df._data{indi}(:, df._rep{indi}), \
144
              dummy = horzcat (df._data{indi}(:, df._rep{indi}), ...
145
                               repmat({NA}, df._cnt(1), 1));
145
                               repmat({NA}, df._cnt(1), 1));
146
          keyboard
146
          keyboard
147
            else
147
            else
148
              dummy =  horzcat (df._data{indi}(:, df._rep{indi}), \
148
              dummy =  horzcat (df._data{indi}(:, df._rep{indi}), ...
149
                repmat({NA}, df._cnt(1), 1));
149
                repmat({NA}, df._cnt(1), 1));
150
        endif
150
        endif
151
          case {'double'}
151
          case {'double'}
152
            dummy = horzcat (df._data{indi}(:, df._rep{indi}), \
152
            dummy = horzcat (df._data{indi}(:, df._rep{indi}), ...
153
                             repmat (NA, df._cnt(1), 1));
153
                             repmat (NA, df._cnt(1), 1));
154
          case {'logical'}
154
          case {'logical'}
155
            %# there is no logical 'NA' -- fill empty elems with false
155
            %# there is no logical 'NA' -- fill empty elems with false
156
            dummy = horzcat (df._data{indi}(:, df._rep{indi}), \
156
            dummy = horzcat (df._data{indi}(:, df._rep{indi}), ...
157
                             repmat (false, df._cnt(1), 1));
157
                             repmat (false, df._cnt(1), 1));
158
          otherwise
158
          otherwise
159
            dummy = cast (horzcat (df._data{indi}(:, df._rep{indi}), \
159
            dummy = cast (horzcat (df._data{indi}(:, df._rep{indi}), ...
160
                                   repmat (NA, df._cnt(1), 1)), \
160
                                   repmat (NA, df._cnt(1), 1)), ...
161
                          df._type{indi});
161
                          df._type{indi});
162
        endswitch
162
        endswitch
163
        df._data{indi} = dummy;
163
        df._data{indi} = dummy;
164
        df._rep{indi} = [df._rep{indi} length(df._rep{indi})+ones(1, n)];
164
        df._rep{indi} = [df._rep{indi} length(df._rep{indi})+ones(1, n)];
165
    try
165
    try