Bevan
October 4, 2021, 6:12pm
1
I have an app thta includes an interactive mapping window using renderMapview. The app used to function jsut fine, but within the last week I have started receiving the following error:
"Warning: Error in exprToQuo: Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
55: stop
54: exprToQuo
53: exprToFunction
52: shiny::installExprFunction
51: htmlwidgets::shinyRenderWidget
50: renderMapview
49: server [#63 ]
Error in exprToQuo(expr, env, quoted = TRUE) :
Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected"
It seems as though it is on the shiny side as I can still run the mapview component in an r session and they render just fine.
Hi, welcome!
To help us help you, could you please prepare a repr oducible ex ample (reprex) illustrating your issue? Please have a look at these resources, to see how to create one for a shiny app
Shiny issues can be challenging to resolve relative to other problems with your code or statistical methods. Shiny apps are often large, complex projects with interacting files.
When seeking help from others it is considered polite to:
First, do your best to work through RStudio's debugging tools to diagnose your issue on your own. Often those shiny logs and tracebacks are useful to others trying to help out.
Second, strive to minimize the effort required to replicate your issue. You can do this with a reproducible example ("reprex").
Shiny Debugging
Errors in Shiny code can be difficult to track down. If you don't know where your problem is coming from, you can track it down with some o…
I came across your error as well. Not sure how to fix it, though I would just use leaflet instead.
library(shiny)
library(shinydashboard)
library(mapview)
ui <- dashboardPage(
dashboardHeader(title = "test"),
dashboardSidebar(),
dashboardBody(
mapviewOutput("map")
)
)
server <- function(input, output) {
output$map <- renderMapview({
mapview(breweries)
})
}
shinyApp(ui, server)
Warning: Error in exprToQuo: Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
55: stop
54: exprToQuo
53: exprToFunction
52: shiny::installExprFunction
51: htmlwidgets::shinyRenderWidget
50: renderMapview
49: server [#2 ]
Error in exprToQuo(expr, env, quoted = TRUE) :
Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
The reprex worked for me to show a map, I'm using R version 4.0.5, shiny 1.6 and mapview 2.10
It doesn't work for me on:
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapview_2.10.0 shinydashboard_0.7.2 shiny_1.7.0
I am facing the same issue.
I have update all the package and now i am getting the same error.
I've raised a github issue:
opened 06:59AM - 12 Oct 21 UTC
closed 08:04AM - 12 Oct 21 UTC
For example:
```
library(shiny)
library(shinydashboard)
library(mapview)
… ui <- dashboardPage(
dashboardHeader(title = "test"),
dashboardSidebar(),
dashboardBody(
mapviewOutput("map")
)
)
server <- function(input, output) {
output$map <- renderMapview({
mapview(breweries)
})
}
shinyApp(ui, server)
```
Produces:
>Error in exprToQuo(expr, env, quoted = TRUE) :
Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
See issue here: https://community.rstudio.com/t/mapview-no-longer-renders-in-shiny/117110
```
> sessionInfo()
R version 4.1.1 (2021-08-10)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=English_Australia.1252 LC_CTYPE=English_Australia.1252 LC_MONETARY=English_Australia.1252 LC_NUMERIC=C
[5] LC_TIME=English_Australia.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapview_2.10.0 shinydashboard_0.7.2 shiny_1.7.0
```
Here is the response:
Yes, please use leafletOutput() and renderLeaflet() directly on the @map slot of the mapview map, i.e.
output$map<-renderLeaflet({
mapview(franconia)@map
# or
mapview::mapview2leaflet(mapview(franconia))
})
opened 07:05AM - 12 Oct 21 UTC
closed 11:01AM - 12 Oct 21 UTC
Hi,
I have update all the package and so also shiny (version 1.7).
this is m… y sessioninfo
> R version 4.0.5 (2021-03-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 19043)
Matrix products: default
locale:
[1] LC_COLLATE=Italian_Italy.1252 LC_CTYPE=Italian_Italy.1252 LC_MONETARY=Italian_Italy.1252 LC_NUMERIC=C
[5] LC_TIME=Italian_Italy.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] mapview_2.10.0 shiny_1.7.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.7 lattice_0.20-41 leaflet.providers_1.9.0 png_0.1-7 class_7.3-18
[6] assertthat_0.2.1 digest_0.6.28 utf8_1.2.2 mime_0.12 R6_2.5.1
[11] stats4_4.0.5 evaluate_0.14 e1071_1.7-9 pillar_1.6.3 rlang_0.4.11.9000
[16] rstudioapi_0.13 raster_3.5-2 jquerylib_0.1.4 DT_0.19 rmarkdown_2.11
[21] webshot_0.5.2 htmlwidgets_1.5.4 munsell_0.5.0 proxy_0.4-26 compiler_4.0.5
[26] httpuv_1.6.3 xfun_0.26 pkgconfig_2.0.3 base64enc_0.1-3 htmltools_0.5.2
[31] sourcetools_0.1.7 tidyselect_1.1.1 tibble_3.1.5 codetools_0.2-18 fansi_0.5.0
[36] crayon_1.4.1 dplyr_1.0.7 withr_2.4.2 later_1.3.0 sf_1.0-3
[41] grid_4.0.5 jsonlite_1.7.2 satellite_1.0.3 xtable_1.8-4 lifecycle_1.0.1
[46] DBI_1.1.1 magrittr_2.0.1 units_0.7-2 scales_1.1.1 KernSmooth_2.23-18
[51] cachem_1.0.6 cli_3.0.1 promises_1.2.0.1 leaflet_2.0.4.1 sp_1.4-5
[56] bslib_0.3.1 ellipsis_0.3.2 generics_0.1.0 vctrs_0.3.8 RColorBrewer_1.1-2
[61] tools_4.0.5 leafem_0.1.6 glue_1.4.2 purrr_0.3.4 crosstalk_1.1.1
[66] fastmap_1.1.0 yaml_2.2.1 colorspace_2.0-2 terra_1.4-11 classInt_0.4-3
[71] knitr_1.36 sass_0.4.0
When i lunch the follow simple app i am getting the follow error
> Warning: Error in exprToQuo: Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
53: stop
52: exprToQuo
51: exprToFunction
50: shiny::installExprFunction
49: htmlwidgets::shinyRenderWidget
48: renderMapview
47: server [C:/Users/Fiorentini/Desktop/mapview_issue.R#57]
Error in exprToQuo(expr, env, quoted = TRUE) :
Don't know how to convert 'leaflet' to a function; a quosure or quoted expression was expected
This is the webapp code
```
library(shiny)
library(mapview)
ui <- fluidPage(
titlePanel("Hello Shiny!"),
sidebarLayout(
sidebarPanel(
sliderInput(inputId = "bins",
label = "Number of bins:",
min = 1,
max = 50,
value = 30)
),
mainPanel(
plotOutput(outputId = "distPlot"),
mapviewOutput("map")
)
)
)
server <- function(input, output) {
output$distPlot <- renderPlot({
x <- faithful$waiting
bins <- seq(min(x), max(x), length.out = input$bins + 1)
hist(x, breaks = bins, col = "#75AADB", border = "white",
xlab = "Waiting time to next eruption (in mins)",
main = "Histogram of waiting times")
})
output$map<-renderMapview({
mapview(franconia)
})
}
shinyApp(ui, server)
```
Could you help me to solve this?
Thanks
Bevan
October 12, 2021, 11:00pm
9
Thanks for the info, glad to see it was not me missing something simple.
1 Like
system
Closed
October 19, 2021, 11:00pm
10
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed. If you have a query related to it or one of the replies, start a new topic and refer back with a link.