R - 使用 read_excel 存储 tryCatch Shiny 警告 [英] R - Storing tryCatch Shiny warnings with read_excel

查看:37
本文介绍了R - 使用 read_excel 存储 tryCatch Shiny 警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是我的代码(在 Shiny 服务器模块中):

Here is my code (in the Shiny server module):

data <- reactive({(
    req(input$file1)
    inFile <- input$file1
    browser()
    data <- tryCatch(read_excel(inFile$datapath, 1), 
                 warning <- function(war){
                   message(war)
                 })    
})

非常感谢!

推荐答案

我做了以下事情:创建了一个新对象警告并将警告存储在对象中,然后我正在使用该对象

I did the following: created a new object warn and stored the warnings in the object and I am working with this object then

warn <- tryCatch(read_excel(inFile$datapath, 1), 
                 warning = function(war){
                  war
                 })

这篇关于R - 使用 read_excel 存储 tryCatch Shiny 警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆