Please help me my filter function on tidyverse does not recognize the variable I tried to use for filtering please advise. I keep on getting the message You can override using the .groups argument and theError in View : object 'Imports' not found. However, I do have the Imports variable after spreading the tradetype to a numeric variable cv.
If the value of tradeType is not exactly "Imports", but , for example "imports", I'd expect to see
! object 'Imports' not found
Another problem you have is that spread will never produce a columns where the value of imports is '', but either a value or NA, so you need to use ilter(is.na(Imports)).
Here's an example that prints out the dataframe after spread().