ggtern的三元图无法正常工作 [英] ternary plot of ggtern not working in shiny

查看:195
本文介绍了ggtern的三元图无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在闪亮的应用程序中使用ggtern()的输出.但是,由于某些限制,它似乎失败了.

I want to use the output of ggtern() in a shiny app. However it seems to fail due to some constraints.

它应该是这样的:

This is what it should look like:

这是实际的闪亮输出:

This is the actual shiny output:

有关可重现的示例,请参见此处:

See here for a reproducible example:

library(shiny)
library(ggtern)

ui <- fluidPage(
        mainPanel(
           plotOutput("ggtern")
        )
)
server <- function(input, output) {
    output$ggtern <- renderPlot({
        ggtern(data.frame(x=10, y=30, z=60), aes(x, y, z)) + geom_point()
    })
}
shinyApp(ui = ui, server = server)

我忽略了什么吗?

推荐答案

将绘图函数放在print命令中:

place the plot function within a print command:

 output$ggtern <- renderPlot({
        print(ggtern(data.frame(x=10, y=30, z=60), aes(x, y, z)) + geom_point())
    })

这篇关于ggtern的三元图无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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