1 function resu = subsindex(df, base)
2 %# function resu = subsindex(df)
3 %# This function convert a dataframe to an index. Do not expect a
4 %# meaningfull result when mixing numeric and logical columns.
6 %% Copyright (C) 2009-2012 Pascal Dupuis <Pascal.Dupuis@uclouvain.be>
8 %% This file is part of Octave.
10 %% Octave is free software; you can redistribute it and/or
11 %% modify it under the terms of the GNU General Public
12 %% License as published by the Free Software Foundation;
13 %% either version 2, or (at your option) any later version.
15 %% Octave is distributed in the hope that it will be useful,
16 %% but WITHOUT ANY WARRANTY; without even the implied
17 %% warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
18 %% PURPOSE. See the GNU General Public License for more
21 %% You should have received a copy of the GNU General Public
22 %% License along with Octave; see the file COPYING. If not,
23 %% write to the Free Software Foundation, 51 Franklin Street -
24 %% Fifth Floor, Boston, MA 02110-1301, USA.
27 %# $Id: subsindex.m 9585 2012-02-05 15:32:46Z cdemills $
36 %# extract all values at once
38 if isa(dummy, 'logical'),
39 resu = sort(find(dummy)-base);
40 %# resu = dummy - base;