replace summary with dcast

attempt replacing summary with dcast