Skip to content

Commit 9d1a948

Browse files
committed
1 parent 0f248a6 commit 9d1a948

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

R/spatial_sf.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ tmapSubsetShp.sf = function(shp, vars) {
6565
shp$LENGTH = sf::st_length(shp)
6666
}
6767
if ("MAP_COLORS" %in% vars) {
68-
shp$MAP_COLORS = as.factor(tmaptools::map_coloring(shp))
68+
shp$MAP_COLORS = as.factor(tmaptools::map_coloring(shp, ncols = 7))
6969
}
7070

7171
if (!length(vars)) {
@@ -86,7 +86,7 @@ tmapSubsetShp.sfc = function(shp, vars) {
8686
s$LENGTH = sf::st_length(shp)
8787
}
8888
if ("MAP_COLORS" %in% vars) {
89-
s$MAP_COLORS = tmaptools::map_coloring(s)
89+
s$MAP_COLORS = as.factor(tmaptools::map_coloring(shp, ncols = 7))
9090
}
9191
s
9292
}

0 commit comments

Comments
 (0)