Lasitha Yapa Lasitha Yapa - 4 months ago 6x
SQL Question

Similar function to SQL where clause in R

I have a data set assigned to a variable named 'temps', which have columns 'date', 'temperature', 'country'.

I want to do something like this, which I can do in SQL

SELECT * FROM temps WHERE country != 'mycountry'

How can I do similar selection in R?


We can use similar syntax in base R

temps[temps$country != "mycountry",]