3
votes

I would like to create a shiny map using leaflet which I can publish online do that others without R can view and interact with it. I can create a shiny app using leaflet, but when I use the 'publish' button in the popup window I get an error saying 'The directory to be deployed (~) exceeds the maximum deployment size, which is 100MB. Consider creating a new directory containing only the content you wish to deploy.

I can't work out what this is telling me. Does anyone have any ideas? I have posted my code below.

Thanks, Hugh

    library(shiny)
    library(leaflet)

    shinyApp(
ui = fluidPage(leafletOutput('myMap')),
server = function(input, output) {

# download and load data
map = leaflet() %>% addTiles('http://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',
                             attribution = paste(
                               '&copy; <a href="http://openstreetmap.org">OpenStreetMap</a> contributors',
                               '&copy; <a href="http://cartodb.com/attributions">CartoDB</a>'
                             )
) %>% setView(-122.36, 47.67, zoom = 10)
output$myMap = renderLeaflet(map)
}
)    
2
are you planning on adding any (other) shiny user input functionality to your application? If not, you might not need shiny do deploy a leaflet map via R after all. By the way... I just uploaded the map to my shinyapps.io account and it works (using rmarkdown): eo4water.shinyapps.io/RtmpKkcylR/Preview-341a561265e2.Rmd - maRtin
Thanks, that's great to know. I'll have to look into rmarkdown. That said, I would like to be able to deploy this as a shiny app as I would like the user to be able to change variables/features to map. Any ideas? Do I have to set anything up in my shinyapps account? I've previously published apps but they didn't require any additional packages beyond the base functions. Thanks! - Hugh Sturrock
no you dont need to set anything up. I am hosting multiple leaflet maps on my accounts and a simple "publish" via RStudio did always the job for me. Did you have success with your upload in the end? - maRtin
No I still get the same error message..if anyone else has any ideas I'd be grateful for thoughts. Cheers - Hugh Sturrock

2 Answers

1
votes

I received this email from RStudio yesterday (5/14/2015):

New in shinyapps.io May 2015 - Analyze bigger datasets! Larger R packages – shinyapps.io has increased the size of R packages that can be installed from 100MB to 1GB.

Basically RStudio increased the storage limit from 100 MB to 1GB. Perhaps that solves your problem?

0
votes

It's a workaround but it worked for me today, when I was deploying an app myself:

When I tried to deploy a shinyApp from inside a standard .R File from Rstudio, I got the same error message as you when I clicked on the "Publish" button. However when I embedded my code into a Rmarkdown document inside a chunk, it suddenly started working.

So simply copy your code and open a new Rmarkdown file, click on "Shiny Document" and paste your code into one chunk and delete everything else but the header of the Rmarkdown file. Now when you run the code and click on "Publish", it should work.