knitr: get textInput to r chunk

Viewed 25

How to pass interactive input from a textfield to R chunk?

I can't overwrite params on runtime even with unlockBinding.

---
title: "A Shiny Document"
output: html_document
runtime: shiny
params:
  data1: 
    label: "username"
    value: ""
    input: text
    placeholder: "username"
  
---

```{r eruptions, echo=FALSE}
# not working: Error in unlockBinding
unlockBinding("params", env = .GlobalEnv)

params$data1 <- textInput(
  inputId = 'input1', label = 'username',
  value = ""
)

print(params$data1)

```
0 Answers
Related