Commit feca1812d497a13238bfa25f93ffa43647003270

Add the convenience function "subset" to perform similar tasks as in R, when you create new objects that contain subsets of the columns in the original data frame. This new function is roughly equivalent to new_frame = old_frame[,c(col1, col2...)].
  
632632
633633 return destination
634634
635def subset(matrix, column_list):
636
637 """Creates a new matrix with only a subset of the columns present, as
638 specified by the columns_list parameter."""
639
640 destination = EmptyMatrix(rownames=matrix.rownames,
641 identifier=matrix.identifier)
642 for column in column_list:
643 if column in matrix:
644 destination.append(matrix[column], column)
645
646 return destination
647
635648def _test():
636649 import doctest
637650 doctest.testfile('../tutorial.txt')