有没有一种变通的方法来使用像这样的东西
filter(df, grepl("A|B|C",location))对于dplyr SQL表?在SQL中,它是由LIKE探测的。当然,我可以将SQL表转换为R数据表,但它非常大。(http://cran.r-project.org/web/packages/dplyr/vignettes/databases.html)目前我得到了
Error in sqliteSendQuery(conn, statement) :
error in statement: no such function: GREPLthx Christof
发布于 2017-11-14 22:29:01
使用sql将表达式直接转换成sql是一种选择。
sql_table %>% filter( sql("location LIKE 'A%'
OR location LIKE 'B%'
OR location LIKE 'C%'")这将在查询的WHERE语句中注入以下内容:
<SQL> location LIKE 'A%' OR location LIKE 'B%' OR location LIKE 'C%'https://stackoverflow.com/questions/27468166
复制相似问题