Lasitha Yapa Lasitha Yapa - 1 year ago 65
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",]