darken, Google, ggmap.
ggmap , , . ( , ( EPSG: 4326) ggmap, .)
adjustcolor() R, ( , - , col2rgb()), , , -. - , 1 0 .
...
meuse, sp.
data(meuse)
dataframe sp, ( ), /.
coordinates(meuse) = ~x+y
proj4string(meuse) <- "+init=epsg:28992 +proj=sterea +lat_0=52.15616055555555 +lon_0=5.38763888888889 +k=0.9999079 +x_0=155000 +y_0=463000 +ellps=bessel +towgs84=565.4171,50.3319,465.5524,-0.398957388243134,0.343987817378283,-1.87740163998045,4.0725 +units=m +no_defs"
meuse <- spTransform(meuse, CRS("+init=epsg:4326"))
Google, . , , , .
meuse_basemap <- get_map(location = colMeans(coordinates(meuse)),
maptype = "terrain",
source = "google",
zoom = 13,
language = "de-DE",
color = "bw")
, ggmap, . , ggmap. ggmap ggmap ( , ggmap ggmap()).
meuse_basemap_attributes <- attributes(meuse_basemap)
, Google, , .
meuse_basemap_transparent <- matrix(adjustcolor(meuse_basemap,
alpha.f = 0.5),
nrow = nrow(meuse_basemap))
Assign the saved attributes to the modified matrix in order to return it to the useful one ggmap.
attributes(meuse_basemap_transparent) <- meuse_basemap_attributes
Here's the original plot:
ggmap(meuse_basemap) +
geom_point(data = as.data.frame(meuse),
aes(x = x, y = y, color = dist),
cex = 2)

But more transparent!
ggmap(meuse_basemap_transparent) +
geom_point(data = as.data.frame(meuse),
aes(x = x, y = y, color = dist),
cex = 2)
