Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renderText not working in headers #245

Closed
jy-r opened this issue Dec 10, 2019 · 3 comments · Fixed by #250
Closed

renderText not working in headers #245

jy-r opened this issue Dec 10, 2019 · 3 comments · Fixed by #250
Assignees

Comments

@jy-r
Copy link

jy-r commented Dec 10, 2019

Expected behavior

  • changing input will change the result in header

Actual behavior

  • following code worked in previous versions of R and flexdashboard, but in current stopped working
  • not working in
    • R version 3.6.1 (2019-07-05) -- "Action of the Toes"
    • Flexdashboard 0.5.1.1
    • shiny 1.4.0

Example

--
title: "test"
output: flexdashboard::flex_dashboard
runtime: shiny
---

```{r}
library(flexdashboard)
library(shiny)
```

Inputs {.sidebar}
-------------------------------------

```{r}
selectInput(
  "month", 
  label = "Pick a Month",
  choices = month.abb, 
  selected = month.abb[2]
)

getmonth <- reactive({
  sprintf('Box 2 (%s)', input$month)
})

renderText({getmonth()})
```  

Column  
-------------------------------------

### `r renderText(getmonth())`
@cderv
Copy link
Collaborator

cderv commented Dec 10, 2019

FWIW, I can reproduce with last version of rmarkdown, flexdashboard and shiny 1.4.0. It works with shiny 1.3.2. The issue seems to come from there.

@schloerke schloerke self-assigned this Dec 13, 2019
@wch
Copy link
Collaborator

wch commented Dec 18, 2019

@gorodnichy
Copy link

Unfortunately , I had the same problem.

I wanted to do this (input taken from shiny menu)

Country: r renderText(input$country)

It does not work - prints empty space

My sessionInfo below

R version 3.6.1 (2019-07-05)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Fedora 29 (Twenty Nine)

Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so

locale:
[1] LC_CTYPE=en_CA.UTF-8 LC_NUMERIC=C LC_TIME=en_CA.UTF-8 LC_COLLATE=en_CA.UTF-8 LC_MONETARY=en_CA.UTF-8 LC_MESSAGES=en_CA.UTF-8
[7] LC_PAPER=en_CA.UTF-8 LC_NAME=C LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_CA.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] dplyr_0.8.5 leaflet_2.0.3 DT_0.13 flexdashboard_0.5.1.1 stringr_1.4.0 lubridate_1.7.4 magrittr_1.5
[8] dtplyr_1.0.1 data.table_1.12.8 shiny_1.4.0.2 plotly_4.9.2 ggplot2_3.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants