0
我已经定义了以下功能:功能不起作用
where_condition_SQL<-
function(table,selected_columns,where_conditions) {
new_table<-sqldf(sprintf("select %s from %s where %s",
as.character((selected_columns)),
deparse(substitute(table)),
as.character((where_conditions))))
return(new_table) }
select_category_amounts <- function(
input_table,selected_columns,category,category_column){
new_table<-where_condition_SQL(input_table,
selected_columns=as.character(selected_columns),
where_conditions=sprintf("%s='%s'",
as.character(category_column),
as.character(category))) return(new_table) }
当我尝试运行第二个功能:
select_category_amounts(second_table,"*","Reservas","categoria2")
那么它不承认second_table和给我以下错误:
Error in rsqlite_send_query([email protected], statement) :
no such table: input_table
我想这是关于环境的一些问题,但我没有得到重点。提前非常感谢您的帮助。
请仔细阅读[MCVE ]。 –