Draw existing wind trails or paths
geom_wind_path.RdDraws trails or paths you already have as data, such as the output of wind_trails() or
least_cost_paths(), as lines with an arrowhead at the downwind end. To compute and draw
trails from a wind field in one step, use geom_wind_trail() instead.
Arguments
- mapping
Aesthetic mappings created by
ggplot2::aes().xandy(coordinates, in degrees longitude and latitude) must be mapped, usually in the plot's main call.groupandtare mapped automatically to the columnstrailandstep, as inwind_trails()andleast_cost_paths()output:groupidentifies each trail, andtorders the points along it, from upwind to downwind. Map them in this layer if your columns are named differently.- data
A data frame of trail points. Default is to inherit the plot's data.
- stat
The statistical transformation; the default,
"identity", draws the data as is.- position
Position adjustment; see
ggplot2::layer().- ...
Other arguments passed to
ggplot2::layer(), such as fixed aesthetics likecolor = "white"orlinewidth = 0.8.- arrow
Arrowhead drawn at the downwind end of each trail, created by
grid::arrow(), orNULLfor none.- na.rm, show.legend, inherit.aes
See
ggplot2::layer().
See also
geom_wind_trail() to compute trails from a wind field.
Examples
library(ggplot2)
katrina <- windscape_example("wind_field")
sites <- cbind(c(-92, -86), c(24, 30))
trails <- wind_trails(katrina, sites, hours = 12)
ggplot(trails, aes(x, y)) +
geom_wind_path(aes(color = speed)) +
coord_quickmap()