function for converting dataframes to interactionData objects