As suggested by David: add the option to pass a data frame and the names of the relevant columns to assign_data.