geo_line | R Documentation |
geom
Create a line geometry (of class geom
) either by specifying
crds values or by sketching it.
geo_line(crds = NULL, window = NULL, features = 1, vertices = 2)
as_line(geom)
crds |
data.frame(2) |
window |
data.frame(2) |
features |
integerish(1) |
vertices |
integerish(.) |
geom |
gridded(1) |
A line geom.
Other geometry shapes:
geo_point()
,
geo_polygon()
,
geo_random()
# 1. create a line programmatically
coords <- data.frame(x = c(40, 70, 70, 50),
y = c(40, 40, 60, 70))
# if no window is set, the bounding box will be set as window
(lineGeom <- geo_line(crds = coords))
# ... otherwise the vertices are plotted relative to the window
# the vertices are plottet relative to the window
window <- data.frame(x = c(0, 80),
y = c(0, 80))
lineGeom <- geo_line(crds = coords, window = window)
geo_vis(lineGeom, linecol = "green")
# 2. cast to point geom from another type
lineGeom <- as_line(geom = gtGeoms$point)
geo_vis(gtGeoms$point, linecol = "#FFB000", pointsymbol = 5)
geo_vis(lineGeom, linecol = "#33FF00", new = FALSE)
# 3. sketch a line
if(dev.interactive()){
line <- geo_line(vertices = 4)
geo_vis(line, linecol = "#B24223", linewidth = 5, new = FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.