Доступ к значению переключателя HTML в RShiny - PullRequest
0 голосов
/ 16 октября 2018

У меня проблемы с доступом к значению с помощью моих HTML-кнопок в моем приложении Shiny, и я очень признателен за помощь.

Вот мой HTML-код:

<code><!DOCTYPE html>

<head>
  <script src="shared/jquery.js" type="text/javascript"></script>
  <script src="shared/shiny.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="shared/shiny.css"/>
  <link rel="stylesheet" href="nostylist.css"/>
</head>

<body>

  <h1>HTML UI</h1>

  <table>
    <tr>
      <th>Statement A</th>
      <th>Agree much more with statement A</th>
      <th>Agree somewhat more with statement A</th>
      <th>Agree somewhat more with statement B</th>
      <th>Agree much more with statement B</th>
      <th>Statement B</th>
    </tr>

    <form>
      <tr>
        <td>I am particular about the food that I eat</td>
        <td><input type="radio" name="row" value="1" checked></td>
        <td><input type="radio" name="row" value="2"></td>
        <td><input type="radio" name="row" value="3"></td>
        <td><input type="radio" name="row" value="4"></td>
        <td>I am not super-picky</td>
      </tr>
    </form>
  </table>

  <label>Number of observations:</label><br />
  <input type="number" name="n" value="500" min="1" max="1000" />

  <h3>Output:</h3>
  <pre id="summary" class="shiny-text-output">

и вот мой код RShiny:

library(shiny)

# Define server logic required to draw a histogram
server <- function(input, output) {

   output$summary <- renderPrint(input$row)
}

# Run the application 
shinyApp(ui = htmlTemplate("www/index.html"), server)

В данный момент выводится "NULL".Тем не менее, когда я меняю input $ row на input $ n, который ссылается на мой числовой ввод, значение из моего числового ввода выводится совершенно нормально.Любые идеи о том, как я могу вывести выбранное значение моих радиокнопок на мое приложение RShiny?

Вот изображение того, как в данный момент выглядит мое блестящее приложение: Блестящее приложение

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...