问题描述
我正在开发一个 Plumber Rest API,其中有两个函数 simplequery
和 GetData
。所以我想访问或重用变量 (studies) 在函数 GetData
中的函数 simplequery
中,我在函数 simplequery
中使用的是 with function
和 { {1}}
例如:-
函数 simplequery
parent.frame
函数 GetData
simplequery<- function{
with(parent.frame(),{
studies <- get_studies(study_id = query)
associations <- get_associations(study_id = query)
paste("Studies: ",n(studies),",Associations: ",n(associations))
})
}
运行 api 后,我从函数 GetData <- function(query=""){
simplequery()
# Get the data of Studies
study_table <- studies@studies
# Get the data of publication
publications_table <- studies@publications
# Get the data of genotyping_techs_table
genotyping_techs_table <- studies@genotyping_techs
# Get the data of platforms_table
platforms_table <- studies@platforms
list(study_table,publications_table,genotyping_techs_table,platforms_table)
}
得到结果,但无法从函数 GetData
得到结果,得到错误
“eval(substitute(expr),data,enclos = parent.frame()) 中的错误:找不到对象‘输入’\n”
我不知道问题出在哪里
请帮忙!
提前致谢
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)