I have a problem with my R Markdown project.
I can not add a select input or even a sliderInput.
When I click Build Website I get this error message: Error: path for html_dependency not provided
Execution halted
I watch many topics but I can not solve my problem.
Can you help me ?
thank you in advance !
---
title: "Untitled"
author: "qc"
date: "May 30, 2017"
output: flexdashboard::flex_dashboard
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(flexdashboard)
library(ggplot2)
library(shiny)
library(datasets)
```
Inputs {.sidebar}
```{r, echo=FALSE}
inputPanel(
radioButtons("category",label= "Select Category",choices=c("diffPts","diffGF","diffGA","diffGD","diffpos"),inline = TRUE),
selectInput("dataset","Choose :",
choices = c("ezce","efzf","zef"))
```
First you were missing the runtime: shiny in the beginning of your Rmd file
Second you were missing closing ")" in the inputPanel
---
title: "Untitled"
author: "qc"
date: "May 30, 2017"
output: flexdashboard::flex_dashboard
runtime: shiny
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
library(flexdashboard)
library(ggplot2)
library(shiny)
library(datasets)
```
Column {.sidebar}
-------------------------------------
```{r, echo=FALSE}
inputPanel(radioButtons("category",label= "Select Category",choices=c("diffPts","diffGF","diffGA","diffGD","diffpos"),inline = TRUE))
selectInput("dataset","Choose :",
choices = c("ezce","efzf","zef"))
```
This issue comes up when you use rmarkdown::render instead of rmarkdown::run which is required to run the Shiny server.
Related
Somehow my RMarkdown document is not crossreferencing tables or figures. Here is a stripped down version of my document.
---
title: "Test"
author: "Me"
date: "01/04/2022"
output: bookdown::pdf_document2
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
var1<-sample(LETTERS)
tab1<-table(var1)
My table is in Table \#ref{tab:tab1}
library(knitr)
kable(tab1, caption="my table")
AS we see in Figure \#ref{fig:plot1}
plot(seq(1,10,1))
You should call your tab1 in the code chunk like this {r tab1}. And use () instead of {} for your #ref. In that case it reference to your figures and tables. You can use the following code:
---
title: "Test"
author: "Me"
date: "01/04/2022"
output: bookdown::pdf_document2
---
My table is in Table \#ref(tab:tab1)
```{r tab1, echo =FALSE}
var1<-sample(LETTERS)
tab1<-table(var1)
library(knitr)
kable(tab1, caption="my table")
```
\newpage
AS we see in Figure \#ref(fig:plot1)
```{r plot1, fig.cap ="plot", echo=FALSE}
par(mar = c(4, 4, .2, .1))
plot(seq(1,10,1))
```
Output:
As you can see on the image, when you click on 1 in will go to your table.
below is my reprex. Post clicking the upload button, the text appears. Upon clicking the clear button the text should go off. Wanted to check the way to do this. Can anyone help me here
---
title: "Untitled"
runtime : shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
code <- "This is code"
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
actionButton("upload","Upload",width = 150)
actionButton("clear_upload","Clear",width = 150)
verbatimTextOutput("code")
get_code <- eventReactive(input$upload,{
code
})
output$code <- renderPrint(
get_code()
)
```
If I've correctly understood your problem, you may use the the observeEvent statement:
---
title: "Untitled"
runtime : shiny
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
code <- "This is code"
```
Column {data-width=650}
-----------------------------------------------------------------------
### Chart A
```{r}
actionButton("upload","Upload",width = 150)
actionButton("clear_upload","Clear",width = 150)
verbatimTextOutput("code")
get_code <- eventReactive(input$upload,{
code
})
observeEvent(input$upload, {output$code <- renderPrint(get_code())})
observeEvent(input$clear_upload, {output$code <- renderPrint("")})
```
I have the basic flexdashboard below. What I want is to change line after "hello" in order to place "world" below it,inside the renderText(). I have found that I can use htmlOutput() and verbatimTextOutput() but these are not used in flexdashboard.
---
title: "[School Name] Enrollment Projections for Fall 2019"
output:
flexdashboard::flex_dashboard:
orientation: rows
runtime: shiny
---
```{r setup, include = FALSE}
library(flexdashboard)
library(shiny)
```
Column {.sidebar }
-------------------------------------
### Menu
```{r}
renderText({
paste("hello", "world", sep="\n")
})
```
Row {data-height=400}
-------------------------------------
### Enrollments
```{r}
```
The following code has satisfying results locally But when uploaded on shinyapps.io does not work.
---
title: "shiny slidy app"
author: "IMI"
date: "11/29/2018"
output:
slidy_presentation:
self_contained: yes
runtime: shiny
---
```{r data, echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(shiny)
data<- data.frame(Year= 1990:1999)
```
## First
```{r slideselect, echo=T, message=FALSE, warning=FALSE, paged.print=FALSE}
sliderInput("year", "Year",
min = min(data$Year), max = max(data$Year),
value = c(min(data$Year),max(data$Year)))
```
```{r print, echo=T}
year<-reactive(input$year)
output$rendtext<-renderText( year()[1]:year()[2])
textOutput("rendtext")
```
shinyapps.io:
local:
Any suggestion?
I just tried your code and it worked well:
I made the following steps in Rstudio:
1) Create a new Rmd file
---
title: "shiny slidy app"
author: "IMI"
date: "11/29/2018"
output:
html_document:
df_print: paged
slidy_presentation:
self_contained: yes
runtime: shiny
---
```{r data, echo=FALSE, message=FALSE, warning=FALSE, paged.print=FALSE}
library(shiny)
data<- data.frame(Year= 1990:1999)
```
## First
```{r slideselect, echo=T, message=FALSE, warning=FALSE, paged.print=FALSE}
sliderInput("year", "Year",
min = min(data$Year), max = max(data$Year),
value = c(min(data$Year),max(data$Year)))
```
```{r print, echo=T}
year<-reactive(input$year)
output$rendtext<-renderText( year()[1]:year()[2])
textOutput("rendtext")
```
2) Publish it on shinyapp.io via the dedicated button
Also I tried with a basic shiny deployment (looked at the shiny guidelines) and with this it's ok as well: it runs both local and on shinyapp.io.
# Global variables can go here
library(shiny)
data <- data.frame(Year= 1990:1999)
# Define the UI
ui <- bootstrapPage(
# Input: Simple integer interval ----
sliderInput("year", "Year", min = min(data$Year), max = max(data$Year), value = c(min(data$Year),max(data$Year))),
# Output: Text output summarizing the values ----
textOutput("rendtext")
)
# Define the server code
server <- function(input, output) {
# Reactive expression for the input values ---
year <- reactive(input$year)
# Show the values ----
output$rendtext<-renderText( year()[1]:year()[2])
}
# Return a Shiny app object
shinyApp(ui = ui, server = server)
I want to have table in 'one line' instead of dividing it. In the second picture is what I get and in the first picture is what I want to get. Thanks for your help.
1) https://i.stack.imgur.com/uwfZ5.png
2) https://i.stack.imgur.com/6nUJ2.png
my code
title: "Bundesliga - raport"
author: "aa aak"
date: "3 stycznia 2018"
output: html_document
---
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(fig.width=12, fig.height=8, fig.path='Figs/',
echo=FALSE, warning=FALSE, message=FALSE)
library(vcd)
```
## Bundesliga
a
```{r echo=FALSE}
head(Bundesliga)
```
Use the width option. This works on your example:
```{r echo=FALSE}
options(width = 100)
head(Bundesliga)
```