Allow from_formula to specify time and group by variable name