I run shiny in flex dashboard template in markdown.
I want to insert images in tab but it always shows me
Warning in normalizePath(path.expand(path), winslash, mustWork) :
path[1]="figure-html/unnamed-chunk-8-1.mb.png": The system cannot find the path specified
And the dashboard output shows nothing. Has anyone encounters the issue before?
If just want to insert the image no other coding for graphs etc, then it works
---
title: "Untitled"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
```
Column {data-width=350}
-----------------------------------------------------------------------
![alt](/Users/abc/Desktop/cluster.png)
if add other codes for other graphs , ex , the dashboard shows nothing .but if remove the insert image part , the dashboard is perfect
Column {data-width=500}
-----------------------------------------------------------------------
### Data
```{r}
DT::datatable(table_fm, options = list(pageLength = 10))
```
Column {data-width=350}
-----------------------------------------------------------------------
![alt](/Users/abc/Desktop/cluster.png)
Related
I am trying to output the flexdashboard template created by Rstudio.
it compiles the .md file and then fails on curl:
Error in curl::curl_download(url, dest, handle = handle, quiet = FALSE, :
schannel: failed to receive handshake, SSL/TLS connection failed
Calls: ... dep_func -> read_gfont_url -> download_file ->
this is inside a firewall and github is blocked. CRAN is allowed. if anybody knows what is it that flexdashboard tries to get I can get it and install it in other ways.
---
title: "mytitle"
output:
flexdashboard::flex_dashboard:
theme:
bg: "#101010"
fg: "#FDF7F7"
primary: "#ED79F9"
base_font:
google: Prompt
code_font:
google: JetBrains Mono
orientation: columns
vertical_layout: fill
---
```{r setup, include=FALSE}
library(flexdashboard)
# Install thematic and un-comment for themed static plots (i.e., ggplot2)
# thematic::thematic_rmd()
```
Column {data-width=650 .tabset}
-----------------------------------------------------------------------
### Chart A
```{r}
```
### Chart B
```{r}
```
Column {data-width=350}
-----------------------------------------------------------------------
### Chart C
```{r}
```
### Chart D
```{r}
```
it is the fonts. after removing the fonts from the title section it can produce output. strangely, it does not work with the fonts even after I downloaded and installed the fonts outside Rstudio.
I have a shiny flexdashboard that runs fine if I open the file directly and click Run Document in R Studio, however I am trying to set up an R script to run the dashboard. The script will find the markdown file and run partly through it but always throws an error once it gets to something like output$something <- renderUI(...). The error is
Error in output$select_file <- renderUI({ : object 'output' not found
A test markdown file for this issue is:
---
title: "example"
author: "hamburglar"
output:
flexdashboard::flex_dashboard:
theme: yeti
orientation: rows
vertical_layout: fill
runtime: shiny
---
#```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
#```
Home
=======================================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
> These are some notes
#```{r}
data(iris)
data(cars)
data(CO2)
files <- list(iris=iris, cars=cars, CO2=CO2)
output$select_file <- renderUI({
selectInput(inputId='file_choice',
label='Choose File',
choices=names(files)
)
})
uiOutput("select_file")
#```
Row
-----------------------------------------------------------------------
### Data
#```{r}
renderTable({
files[[input$file_choice]]
})
#```
And I've tried to use the following scripts with the same results:
library(flexdashboard)
library(shiny)
library(rmarkdown)
render("path/test_board.Rmd",
#output_file="Dashboard.html"
#flex_dashboard()
#"flex_dashboard"
)
For the path I've tried a shared drive path and my desktop and I've tried a number of different arguments that I've read will let the render function know to make a flaexdashboard (in comments in the render function). In all my attempts I get the Error saying that the output object cant be found. If anyone could offer any help I would greatly appreciate it.
In flexdashboard you don't need to use output. Just do:
---
title: "example"
author: "hamburglar"
output:
flexdashboard::flex_dashboard:
theme: yeti
orientation: rows
vertical_layout: fill
runtime: shiny
---
```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
```
Home
=======================================================================
Sidebar {.sidebar}
-----------------------------------------------------------------------
> These are some notes
```{r}
data(iris)
data(cars)
data(CO2)
files <- list(iris=iris, cars=cars, CO2=CO2)
selectInput(inputId='file_choice',
label='Choose File',
choices=names(files)
)
```
Row
-----------------------------------------------------------------------
### Data
```{r}
renderTable({
files[[input$file_choice]]
})
```
I have built a Shiny app through Flexdashboard and I'm having an isssue which I am incapable of solving. I embeded a local PDF file using this code (minimal reproducible example, remove the '##' but not the '###' to test it with any pdf you have):
---
title: "Random Title"
output:
flexdashboard::flex_dashboard:
orientation: columns
vertical_layout: fill
social: menu
runtime: shiny
---
## ```{r setup, include=FALSE}
library(flexdashboard)
library(shiny)
## ```
PDF
=====================================
### CV
## ```{r}
tags$iframe(style = "height:850px; width:100%; scrolling=yes", src = "randomPDF.pdf")
## ```
My problem is that when I run the App, it opens two tabs: one with the Shiny App (with the PDF well embeded, which is nice) but also a new tab only with the pdf. I want this to stop happening, and I'm struggling to achieve it.
I am working on a simple dashboard with using R, Shiny, Flexdashboard and Leaflet. The code itself seems to work fine. However I am facing some issues to deploy it.
When I run/Knit the document for the first time everytyhing seems ok, but if I try to publish it I receive this message when I hit the 'Publish' button above the rendered document:
'Only rendered R Markdown documents can be published to RPubs. To
publish this document, click Knit to render it, then click the Publish
button above the rendered document'
Then, if I reload the page or Knit the document again without make any change, the tables and the maps disappears.
Initially, I thought it was something with Leaflet, but I got the same behavior with this minimal and reproducible example both in R Studio and R Studio Cloud.
---
title: "Example"
output:
flexdashboard::flex_dashboard:
orientation: columns
runtime: shiny
---
```{r }
library(flexdashboard)
library(shiny)
library(DT)
# OPERAÇÃO POR BAIRROS
link = "https://docs.google.com/spreadsheets/d/e/2PACX-1vS3cj3PhVm-2F-CiEJOE8O1YIIU6t7os_wDDrACFne39ZRUvxLKdV_MKZNzD6xTG0hoI5ZroHpxyIzV/pub?output=csv"
df_op = read.csv(link)
```
Column {data-width=350}
-----------------------------------------------------------------------
### Table
```{r table}
df_table = reactive({
df_op
})
DT::renderDataTable(df_table())
```
To solve the blank element issue, the line
runtime:shiny
must be written from the first column, just as described bellow.
title: "Example"
output:
flexdashboard::flex_dashboard:
orientation: columns
runtime: shiny
I am exploring the use of DT:datatable in an interactive document using Rmarkdown and shiny (I have not used datatable before).
I am able to create a document that plots a data table:
---
title: "Test DT"
output: html_document
runtime: shiny
---
```{r echo=FALSE}
datatable(iris)
```
Clicking in a row in the datatable highlights a row. Is there any way to access the selected rows without implementing a shiny server? How?
You have to use an output$id for it to work. Just how you would do it in shiny itself
---
title: "Test DT"
output: html_document
runtime: shiny
---
```{r echo=FALSE}
library(DT)
DT::dataTableOutput('irisTable')
output$irisTable = DT::renderDataTable(iris, selection = 'multiple')
p("By default DT allows multiple row selection. Selected rows are...")
renderPrint(input$irisTable_rows_selected)
```
DT also allows column and cell selection as well as preselection. See documentation