I am relatively new to R, and very new to Shiny, but I have not been able to find info on this error.
I created two graphs, one using d3heatmap
and one using leaflet
. When I run the scripts individually, they both work. I followed instructions and used boostrapPage()
to have the two charts display together with shiny.
The code can be found here: https://github.com/jotasolano/dengueCR but I'll paste it below anyway. I get the error message
ERROR: path[1]="": No such file or directory
on the popup window that should display the chart (NOT on the console). Any Ideas as to why this is happening?
server.R:
library(dplyr)
library(d3heatmap)
library(RColorBrewer)
library(shiny)
library(leaflet)
library(rCharts)
function(input, output, session) {
output$heatmap <- renderD3heatmap({
#convert to df and drop total
cases <- read.csv("casos_2015.csv") %>%
select(-Total) %>%
select(-Semana)
d3heatmap(cases, scale = "row",
dendrogram = "none",
color = scales::col_quantile("Reds", NULL, 10),
xaxis_font_size = "10px",
show_grid = 0.2)
})
output$geomap <- renderPlot({
data <- read.csv("cantones.csv")
casos_popup <- paste0("<strong>Canton: </strong>", data$canton,
"<br><strong>Cases: </strong>", data$casos,
"<br><strong>Rate: </strong>", signif(data$tasa, 3))
m <- leaflet(data) %>%
addProviderTiles("CartoDB.Positron") %>%
addCircles(~lng,
~lat,
popup = casos_popup,
radius = ~sqrt(casos) * 300,
weight = 1,
color = "red")
})
}
ui.R:
library(shiny)
library(d3heatmap)
library(leaflet)
library(rCharts)
bootstrapPage(mainPanel(width = 12,
div(class = "row",
div(showOutput("heatmap", "d3heatmap"), class = "span6"),
div(showOutput("geomap", "leaflet"), class = "span6")
)
))
Also, if you see any terrible practice, please feel free to note, because like I said, I am relatively new and documentation is messy sometimes.
Thank you!