Skip to content

Commit 7cead64

Browse files
committed
add mn_res data for novel/easy sf examples; update news
1 parent d52a931 commit 7cead64

5 files changed

Lines changed: 57 additions & 0 deletions

File tree

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
## CHANGES
1111

12+
* The `color` argument now supplies a sensible default (trace-level mean) to `fillcolor`. This makes it much easier to map data values to polygon fills (e.g., choropleth maps). For an example, `plot_mapbox(mn_res, split = ~INDRESNAME, color = ~AREA, showlegend = FALSE, line = list(color = "black"))`.
13+
* The `color` argument no longer automatically add `"markers"` to the `mode` attribute for scatter/scattergl trace types. Those who wish to have the old behavior back, should add `"markers"` to the `mode` explicity (e.g., change `plot_ly(economics, x = ~pce, y = ~pop, color = ~as.numeric(date), mode = "lines")` to `plot_ly(economics, x = ~pce, y = ~pop, color = ~as.numeric(date), mode = "lines+markers")`)
1214
* The `elementId` field is no longer populated, which fixes the "Ignoring explicitly provided widget ID" warning in shiny applications (see #985).
1315

1416
## BUG FIXES

R/data.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,12 @@
2121
#' @format A data frame with three variables: `r`, `t`,
2222
#' `nms`.
2323
"hobbs"
24+
25+
26+
#' Minnesotan Indian Reservation Lands
27+
#'
28+
#' @references \url{https://www.dot.state.mn.us/maps/gdma/gis-data.html}
29+
#'
30+
#' @format An sf data frame with 13 features and 5 fields
31+
#'
32+
"mn_res"

data-raw/mn.R

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
library(sf)
2+
3+
f <- tempfile(fileext = ".zip")
4+
download.file("https://www.dot.state.mn.us/maps/gdma/data/datafiles/statewide/indian_res.zip", f)
5+
unzip(f, exdir = dirname(f))
6+
res <- st_read(file.path(dirname(f), "reservtn.shp"))
7+
8+
# assuming this based on epsg provided from other shapefiles on
9+
# https://www.dot.state.mn.us/maps/gdma/gis-data.html
10+
st_crs(res) <- 26915
11+
12+
mn_res <- st_transform(res, 4326)
13+
14+
# plot_mapbox(mn_res, text = ~INDRESNAME, hoverinfo = "text")
15+
devtools::use_data(mn_res, overwrite = TRUE)
16+
17+
18+
# f <- tempfile(fileext = ".zip")
19+
# download.file("https://www.dot.state.mn.us/maps/gdma/data/datafiles/statewide/county.zip", f)
20+
# unzip(f, exdir = dirname(f))
21+
# mn <- st_read(file.path(dirname(f), "MNCounties_MNDOT.shp"))
22+
#
23+
# mn <- mn %>%
24+
# st_simplify(TRUE, 2000) %>%
25+
# st_transform(4326)
26+
#
27+
# # plot_mapbox(mn)
28+
#
29+
# devtools::use_data(mn, overwrite = TRUE)

data/mn_res.rda

528 KB
Binary file not shown.

man/mn_res.Rd

Lines changed: 17 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)