ToDataframe function

Transforms patterns into a data frame