Shiny support for ggmap

1,364 views
Skip to first unread message

Eric Colson

unread,
Mar 15, 2013, 2:34:09 AM3/15/13
to shiny-...@googlegroups.com
does shiny support the functions within the ggmap package?

Joe Cheng

unread,
Mar 15, 2013, 3:13:02 AM3/15/13
to shiny-...@googlegroups.com
I can't say I've personally tried it but it seems like it should work if you just use it in a normal renderPlot.


On Thursday, March 14, 2013, Eric Colson wrote:
does shiny support the functions within the ggmap package?

--
You received this message because you are subscribed to the Google Groups "Shiny - Web Framework for R" group.
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discus...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 


--
Sent from my phone

Winston Chang

unread,
Mar 15, 2013, 11:49:30 AM3/15/13
to shiny-...@googlegroups.com
It should just work if you install the ggmap package and then load it in your app.

On Fri, Mar 15, 2013 at 1:34 AM, Eric Colson <eco...@gmail.com> wrote:
does shiny support the functions within the ggmap package?

--

Andrew Clark

unread,
Mar 15, 2013, 1:33:16 PM3/15/13
to shiny-...@googlegroups.com
I can confirm it works fine. I did use it in an app but subsequently replaced it with
gvismap which served my purposes better

Eric Colson

unread,
Mar 15, 2013, 2:02:49 PM3/15/13
to shiny-...@googlegroups.com
It doesn't give me an error, yet it also does not render the image.  Below is the code from the server.R file.  The second line is a function that ultimately renders as map.  Within that function is the call to ggmap and get_map.

Am i using renderPlot appropriately?

     output$myPlot <- renderPlot(

          {test$PlotConditions(cityLat=37.78, cityLon=-122.42, zoom=10, interpolate=TRUE)}

          , width = 800

          , height = 600

      )

Joe Cheng

unread,
Mar 15, 2013, 2:12:22 PM3/15/13
to shiny-...@googlegroups.com
Make sure you print() the plot object.

Eric Colson

unread,
Mar 15, 2013, 3:32:16 PM3/15/13
to shiny-...@googlegroups.com
yes, that helped.   However, rather than rending the image it is returning this:

data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAJ [... snipped...]

Any ideas?

Joe Cheng

unread,
Mar 15, 2013, 3:51:29 PM3/15/13
to shiny-...@googlegroups.com
In ui.R, are you using plotOutput? That's what you want. 
Sent from my phone

Eric Colson

unread,
Mar 15, 2013, 3:57:39 PM3/15/13
to shiny-...@googlegroups.com
Thank you!  That is what i was doing wrong: i was using htmlOutput.  I switched to plotOutput as you suggested and now it works!
To unsubscribe from this group and stop receiving emails from it, send an email to shiny-discuss+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply all
Reply to author
Forward
0 new messages