Fixed call to transform so that R is always a list.