在RShiny中调用Python代码来构建简单程序

2024-07-03 05:48:19 发布

您现在位置:Python中文网/ 问答频道 /正文

我有一个特定的python代码(下面共享)来显示用户输入的与历史信息类似的描述(验证数据)。由于某些原因,我想使用Rshiny创建一个简单的接口,它将包含两个字段,例如:

Enter the description:

Enter the region:

And gives me the similar text 

使用的代码是:

^{pr2}$

这里我明确输入的新的_描述需要从接口获取。在

我对R/Rshiny很在行。如有任何帮助/出发点,我们将不胜感激


Tags: andthe数据代码用户信息原因description
1条回答
网友
1楼 · 发布于 2024-07-03 05:48:19

这是你的应用程序的框架。在

library(shiny)
ui <- basicPage(
  textInput("description", label = "Enter the Description:"),
  textInput("region", label = "Enter the Region:"),
  verbatimTextOutput("txtoutput")
)

server <- function(input, output) {
  output$txtoutput <- renderPrint({
    print(paste("description: ", input$description, "and region: ", input$region))
  })
}
shinyApp(ui, server)

我不知道如何将R/shinn与python结合起来,以及python代码中使用“description”和“region”的输入。 无论如何,您可能需要看看这个包-rPython。 或者你进一步解释,你到底想达到什么目的。在

相关问题 更多 >