Actually, the error message makes sense if your brain has been twisted into R-thinking. I am not an expert, so I may be a little off on this explanation. When a function gets an object to work on, it looks at the class of the object to determine just what to do. You can see this with print() which does very different things depending on the kind of object. Printing a graphical object is different than printing a vector. So, under the hood there may be different filter functions, one for data frames, another for, say, lists. UseMethod() picks from among these possible functions, depending on the class of the object. You passed a logical vector, the output of Data$year_built > 0
. The filter function does not know what to do with that and apparently does not have a default function to use on objects without a specialized function. Therefore it threw that error.
I hope that is more or less correct and clear.