data_preparation function

Utility functions for data type conversion between data.frame and list.