Dr. Amy Bacharach
1 min readAug 22, 2018

--

Thanks for this! Question: I have a df with a couple hundred variables. I want to keep all of the variables, but filter out the cases the don’t fall between two specific dates. Do I need to list every variable in the code? In your example, it looks like you’re selecting every variable (FL_DATE, CARRIER, ORIGIN, ORIGIN_CITY_NAME, ORIGIN_STATE_ABR, DEP_DELAY, DEP_TIME, ARR_DELAY, ARR_TIME).

flight %>%
select(FL_DATE, CARRIER, ORIGIN, ORIGIN_CITY_NAME, ORIGIN_STATE_ABR, DEP_DELAY, DEP_TIME, ARR_DELAY, ARR_TIME) %>%
filter(between(FL_DATE, as.Date("2014-01-05"), as.Date("2014-01-10")))

Is there something like a “select all variable” for the date filter for cases?

Thanks!

--

--

Dr. Amy Bacharach

Policy Researcher / Emerge CA Alum / World Traveler / Mom / Founder parentinginpolitics.com / HuffPo Guest Writer / Let’s get more progressive women elected!