我的 PostgreSQL 数据库中有两个单独的表:
table_a <- tbl(con, "table_a")
table_b <- tbl(con, "table_b")
我想创建一个像这样的新变量:
table_c <- table_a %>%
mutate(variable_a = ifelse(a %in% table_b$a & table_b$b == 100, TRUE, FALSE)
但我收到一条与table_b$a
Error in result_create(conn@ptr, statement) :
Failed to prepare query: ERROR: syntax error at or near ")"
LINE 1: [...] CASE WHEN ("a" IN () AND = 2...
^