# NOT RUN {
coords <- data.frame(x = c(40, 70, 70, 50, 40),
y = c(40, 40, 60, 70, 40),
fid = 1)
window <- data.frame(x = c(0, 80),
y = c(0, 80))
aGeom <- gs_polygon(anchor = coords, window = window)
# change to relative scale and back to absolute
(relCoords <- gt_scale(geom = aGeom, to = "relative"))
gt_scale(geom = relCoords, to = "absolute")
# scale to another range
gt_scale(geom = aGeom, range = list(x = c(0, 100), y = c(10, 90)))
# }
Run the code above in your browser using DataLab