I am filtering a dataset and this chunk works fine:
dwell <- rail %>%
filter_(Measure == "Average Terminal Dwell Time (Excluding Cars on Run Through Trains) (Hours)",
Variable == "System") %>%
gather(Date, Hrs, -("railroad":"Sub-Variable"))
But I want to run the following code, adding a second option under variable:
dwell <- rail %>%
filter_(Measure == "Average Terminal Dwell Time (Excluding Cars on Run Through Trains) (Hours)",
Variable == "System"& "System (U.S.)") %>%
gather(Date, Hrs, -("railroad":"Sub-Variable"))
But when I do this I get the folloing error: "operations are possible only for numeric, logical or complex types." I have tried swapping the & for | and that didn't work either. I feel like this is going to be a simple switch once someone tells me. Thanks!