Fix error: use subset function rather than filter from dplyr (which is not a dependency); Style fixes