Using tmap, receiving an error that I have an unused argument regarding my basemaps.

Hi, am getting this error when I ever I put in my code. Could anyone help me? I don't understand how to fix the unused argument. Below is the full code.

Error in tm_view(alpha = 0.85, basemaps = "Stamen.TonerLite", view.legend.position = c("right", :
unused argument (basemaps = "Stamen.TonerLite")

tm_shape(single_state_bg_geo) +
col = "median_income",
palette = "Greens",
style = "jenks",
contrast = c(0.3, 1),
title = "Median NC Income",
textNA = "Not Available",
id = "NAME",
popup.vars = c(
"Median NC Income" = "median_income",
"Total Population" = "total_pop"
popup.format = list(
median_income = list(fun = make_dollar),
total_pop = list(format = "f", digits = 0)
legend.format = list(fun = make_dollar)
) +
tm_borders(col = "darkgray") +
alpha = 0.85, basemaps = "Stamen.TonerLite", view.legend.position = c("right", "bottom"))

Hi, and welcome to the forum.

You get the error because tm_view() does not accept the basemaps= argument. Use tm_tiles() for annotation or tm_basemap() for overlays. See the vignette and tmap documentation


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.