当我运行以下代码时,我看不到任何错误,闪亮的应用程序呈现并按预期执行。
library(shiny)
library(googleAuthR)
gar_set_client(scopes = c("htps://www.googleapis.com/auth/analytics.readonly"))
library(googleAnalyticsR)
ui <- fluidPage(
googleAuth_jsUI("auth")
)
server <- function(input, output, session) {
}
shinyApp(ui = ui, server = server)但是,当我使用auth模块运行稍后的迭代时,我得到了一个强制错误
library(shiny)
library(googleAuthR)
gar_set_client(scopes = c("htps://www.googleapis.com/auth/analytics.readonly"))
library(googleAnalyticsR)
ui <- fluidPage(
googleAuth_jsUI("auth")
)
server <- function(input, output, session) {
auth <- callModule(gar_auth_js, "auth")
}错误:
2020-02-16 21:41:43>
options(googleAuthR.scopes.selected=c('https://www.googleapis.com/auth/analytics.readonly'))
options(googleAuthR.client_id='xxx.apps.googleusercontent.com')
options(googleAuthR.client_secret='xxx')
options(googleAuthR.webapp.client_id='xxx.apps.googleusercontent.com')
options(googleAuthR.webapp.client_secret='xxx')
Listening on http://127.0.0.1:1221
Warning: Error in as.character: cannot coerce type 'closure' to vector of type 'character'
58: sprintf
57: gettextf
56: .Deprecated
55: module
50: callModule
49: server [/Users/xxx/xxx/xxx/app.R#60]
Error in as.character(function (input, output, session, message = "Authenticate with your Google account") :
cannot coerce type 'closure' to vector of type 'character'发布于 2020-02-24 18:01:17
错误是由于不推荐使用:auth <- callModule(gar_auth_js, "auth")
相反,必须使用以下内容。auth <- callModule(googleAuth_js, "auth")
https://stackoverflow.com/questions/60253599
复制相似问题