r - 使用 RenderPlot 在 R 中显示图形
问题描述
我之前在地块上工作过。这次我面临plot
功能问题。
UI.r
页:
shinyUI(fluidPage(
# Application title
titlePanel("test"),
sidebarLayout(
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
服务器.r 页面:
browser()
output$distPlot <- renderPlot({
plot(cars)
})
如果我在该行代码处设置断点,它会跳转上面的脚本并转到下一行代码。我不明白为什么这段代码不起作用。最初我认为这可能是因为我用于显示的数据但它也没有打印默认数据集数据。
谁能说出这个脚本中可能的原因或错误。
即使尝试使用dev.off()
它也会引发以下错误:
警告:dev.off 中的错误:无法关闭设备 1(空设备)
使用browse()
上面的代码行后:
Browse[1]> n
debug at /server.R#8: output$distPlot <- renderPlot(plot(cars))
Browse[2]> n
debug at server.R#52: return(df2)
谢谢你的帮助!
解决方案
推荐阅读
- javascript - 使用php加密,使用js解密
- flutter - Flutter:如何检查 Widget 是否为滚动小部件
- c# - 在运行时从类的实例创建 xsd 架构
- c# - 降低质量后原始位图的低质量位图副本变大
- node.js - Mongodb nodejs驱动程序forEach遍历所有应该过滤的文档事件
- java - JTextFieldUI 以我个人的外观和感觉绘制在 JTabbedPane 的另一个选项卡中
- c# - 我想知道如何在单击 asp.net mvc 中的更新按钮时将值传递给另一个视图并更新我的详细信息
- vba - 如何摆脱使用“Transferdatabase”创建的 ms-access “幽灵模块”
- php - Youtube API 绑定直播广播不起作用
- android - 任务':app:mergeProdKernelReleaseResources'的独立构建失败Expo Execution失败