samedi 5 septembre 2015

Filter tbl_sqlite column by string comparing with another column - dplyr

This maybe a novice question.How do I filter with matching string values with values from another column using dplyr when working with a database? e.g. I want to do something like this.

install.packages("nycflights13")
library(nycflights13)
head(nycflights13)

Lets say I want to filter for rows with origin values contained in destination values, I tried

filter(flights_sqlite, origin %in% (unique(select(flights_sqlite,dest))))

However that operation is not allowed. I do not want to convert this to dataframe as the database that I am working with is large and will eat up any available ram.

Aucun commentaire:

Enregistrer un commentaire