Replaced transform_data with transform_datamatrix. More flexible, can work with dataframes and matrices in addition to vectors