File: plot_mapbox.Rd

package info (click to toggle)
r-cran-plotly 4.10.4%2Bdfsg-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 30,636 kB
  • sloc: javascript: 195,272; sh: 24; makefile: 6
file content (45 lines) | stat: -rw-r--r-- 1,227 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotly.R
\name{plot_mapbox}
\alias{plot_mapbox}
\title{Initiate a plotly-mapbox object}
\usage{
plot_mapbox(data = data.frame(), ...)
}
\arguments{
\item{data}{A data frame (optional).}

\item{...}{arguments passed along to \code{\link[=plot_ly]{plot_ly()}}. They should be
valid scattermapbox attributes - \url{https://plotly.com/r/reference/#scattermapbox}.
Note that x/y can also be used in place of lat/lon.}
}
\description{
Use this function instead of \code{\link[=plot_ly]{plot_ly()}} to initialize
a plotly-mapbox object. This enforces the entire plot so use
the scattermapbox trace type, and enables higher level geometries
like \code{\link[=add_polygons]{add_polygons()}} to work
}
\examples{
\dontrun{

plot_mapbox(res_mn)
plot_mapbox(res_mn, color = ~INDRESNAME)

map_data("world", "canada") \%>\%
  group_by(group) \%>\%
  plot_mapbox(x = ~long, y = ~lat) \%>\%
  add_polygons() \%>\%
  layout(
    mapbox = list(
      center = list(lat = ~median(lat), lon = ~median(long))
    )
  )
}

}
\seealso{
\code{\link[=plot_ly]{plot_ly()}}, \code{\link[=plot_geo]{plot_geo()}}, \code{\link[=ggplotly]{ggplotly()}}
}
\author{
Carson Sievert
}