R Help Anyone know if I can add a zoom In/Out function to the maps available via the "maps" library? Or do I need to use a different mapping library? world.map <- map_data("world") ggplot(data = world.map) + geom_polygon(mapping = aes(x=long, y=lat, group=group)) Jeff
world.map <- maps::map("world", plot = FALSE, fill = TRUE) p <- sf:: st_as_sf(world.map, coords = c('x', 'y')) map view::map view(p) HTH, -Roy> On Mar 6, 2019, at 1:44 PM, reichmanj at sbcglobal.net wrote: > > R Help > > Anyone know if I can add a zoom In/Out function to the maps available via the "maps" library? Or do I need to use a different mapping library? > > world.map <- map_data("world") > > ggplot(data = world.map) + > geom_polygon(mapping = aes(x=long, y=lat, group=group)) > > Jeff > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.
world.map <- maps::map("world", plot = FALSE, fill = TRUE) p <- sf:: st_as_sf(world.map, coords = c('x', 'y')) map view::map view(p) HTH, -Roy> On Mar 6, 2019, at 2:10 PM, rmendelss gmail <rmendelss at gmail.com> wrote: > > world.map <- maps::map("world", plot = FALSE, fill = TRUE) > p <- sf:: st_as_sf(world.map, coords = c('x', 'y')) > map view::map view(p) > > HTH, > > -Roy > >> On Mar 6, 2019, at 1:44 PM, reichmanj at sbcglobal.net wrote: >> >> R Help >> >> Anyone know if I can add a zoom In/Out function to the maps available via the "maps" library? Or do I need to use a different mapping library? >> >> world.map <- map_data("world") >> >> ggplot(data = world.map) + >> geom_polygon(mapping = aes(x=long, y=lat, group=group)) >> >> Jeff >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> https://stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >********************** "The contents of this message do not reflect any position of the U.S. Government or NOAA." ********************** Roy Mendelssohn Supervisory Operations Research Analyst NOAA/NMFS Environmental Research Division Southwest Fisheries Science Center ***Note new street address*** 110 McAllister Way Santa Cruz, CA 95060 Phone: (831)-420-3666 Fax: (831) 420-3980 e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/ "Old age and treachery will overcome youth and skill." "From those who have been given much, much will be expected" "the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
Roy Thank you - that's helpful. Going to have to read up on sf and mapview library. Those are new ones. Then to add a point feature layer (lat/long) where would I insert that? Library(maps) Library(sf) # simple features Library(mapview) world.map <- maps::map("world", plot = FALSE, fill = TRUE) p <- sf::st_as_sf(world.map, coords = c('x', 'y')) mapview::mapview(p, legend=FALSE) -----Original Message----- From: rmendelss gmail <rmendelss at gmail.com> Sent: Wednesday, March 6, 2019 4:11 PM To: reichmanj at sbcglobal.net Cc: R help Mailing list <r-help at r-project.org> Subject: Re: [R] Zoom In/Out maps library world.map <- maps::map("world", plot = FALSE, fill = TRUE) p <- sf:: st_as_sf(world.map, coords = c('x', 'y')) map view::map view(p) HTH, -Roy> On Mar 6, 2019, at 1:44 PM, reichmanj at sbcglobal.net wrote: > > R Help > > Anyone know if I can add a zoom In/Out function to the maps available viathe "maps" library? Or do I need to use a different mapping library?> > world.map <- map_data("world") > > ggplot(data = world.map) + > geom_polygon(mapping = aes(x=long, y=lat, group=group)) > > Jeff > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide > http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.