library(ggplot2)
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
nc <- st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE)
ggplot() +
geom_sf(aes(fill = AREA), data=nc) +
scale_y_continuous(
labels = function(x) {
labels <- parse(text = paste0(format(x, nsmall = 1L), "*degree*N"))
print(labels)
labels
}) +
coord_sf()
#> expression(34.0*degree*N, 34.5*degree*N, 35.0*degree*N, 35.5*degree*N,
#> 36.0*degree*N, 36.5*degree*N)
Created on 2018-11-11 by the reprex package (v0.2.1)
library(ggplot2)
library(sf)
#> Linking to GEOS 3.6.1, GDAL 2.2.3, PROJ 4.9.3
nc <- st_read(system.file("gpkg/nc.gpkg", package="sf"), quiet = TRUE)
ggplot() +
geom_sf(aes(fill = AREA), data=nc) +
scale_y_continuous(
labels = function(x) {
paste0(format(x, nsmall = 1L), "\u00b0", "N")
}) +
coord_sf()
Created on 2018-11-11 by the reprex package (v0.2.1)