function to stack data (going from three dimensional array to a two dimensional array including only "existing" animals
stack_data(Data, Obs.transect, n.transects, stacked.names, factor.ind)
three-d dataset
current number of observations of animals in each transect (vector)
number of transects
column names for new stacked dataset
a vector of indicator variables (1 = factor/categorical variable, 0 = continuous variable)
a stacked dataset