Closed AramburuMerlos closed 1 month ago
The underlying problem is that you use the variable name x
. That leads to a mix up because the first argument of subset
is also x
. With NSE you then effectively get
subset(x, x$NAME_1 == x$NAME_1)
While it works as expected with another variable name, like this
y <- data.frame(NAME_1 = "Diekirch")
subset(v, NAME_1 == y$NAME_1, NSE=TRUE) |> nrow()
[1] 5
This now works for your examples; so I am hopeful it does now newly break other cases. Thank you for reporting this.
Maybe I should just avoid using the same column names or the NSE in these cases, but: