我收到以下“无效的第一个参数”错误。但是,con是实际连接并且设置正确。那么这个错误实际上指的是什么?
library(dplyr)
con <- RSQLServer::src_sqlserver("***", database = "***")
myData <- con %>%
tbl("table") %>%
group_by( work_dt, campaign, ad_group, matchtype, keyword ) %>%
select( work_dt, campaign, ad_group, matchtype, keyword, impressions, clicks, cost ) %>%
filter(site_id %in% c(6932,6946,6948,6949,6951,6952,6953,6954,
6955,6964,6978,6979,7061,7260,7272,7329,
7791,7794,7850,7858,7983)) %>%
filter(work_dt >= as.Date("2014-10-01 00:00:00") & work_dt < as.Date("2014-10-02 00:00:00")) %>%
summarise(
sum_impressions = sum(impressions),
sum_clicks = sum(clicks),
sum_cost = sum(cost),
) %>%
collect()
此代码生成:
Error in exists(name, env) : invalid first argument
exists("con")
> exists(con)
Error in exists(con) : invalid first argument
> exists("con")
[1] TRUE