trajMapStatic | R Documentation |
ggplot2
This function plots back trajectories using ggplot2
. The function
requires that data are imported using openair::importTraj()
. It is a
ggplot2
implementation of openair::trajPlot()
with many of the same
arguments, which should be more flexible for post-hoc changes.
trajMapStatic(
data,
colour = "height",
type = NULL,
group = NULL,
longitude = "lon",
latitude = "lat",
npoints = 12,
xlim = NULL,
ylim = NULL,
crs = sf::st_crs(3812),
origin = TRUE,
map = TRUE,
map.fill = "grey85",
map.colour = "grey75",
map.alpha = 0.8,
map.lwd = 0.5,
map.lty = 1,
facet = NULL,
...
)
data |
A data frame containing a HYSPLIT trajectory, perhaps accessed
with required A data frame containing HYSPLIT model outputs. If this data were not
obtained using |
colour |
Column to be used for colouring each trajectory. default: This column may be numeric, character, factor or date(time). This will
commonly be a pollutant concentration which has been joined (e.g., by
|
type |
A method to condition the default: Used for splitting the trajectories into different groups which will appear
as different panels. Passed to |
group |
Column to use to distinguish different trajectory paths. default: By default, trajectory paths are distinguished using the arrival date.
|
latitude , longitude |
The decimal latitude/longitude. default: Column names representing the decimal latitude and longitude. |
npoints |
Interval at which points are placed along the trajectory paths. default: A dot is placed every |
xlim , ylim |
The x- and y-limits of the plot. default: A numeric vector of length two defining the x-/y-limits of the map, passed
to |
crs |
The coordinate reference system (CRS) into which all data should be projected before plotting. default: This argument defaults to the Lambert projection, but can take any
coordinate reference system to pass to the |
origin |
Draw the receptor point as a circle? default: When |
map |
Draw a base map? default: Draws the geometries of countries under the trajectory paths. |
map.fill |
Colour to use to fill the polygons of the base map. default: See |
map.colour |
Colour to use for the polygon borders of the base map. default: See |
map.alpha |
Transparency of the base map polygons. default: Must be between |
map.lwd |
Line width of the base map polygon borders. default: Any numeric value. |
map.lty |
Line type of the base map polygon borders. default: See |
facet |
Deprecated. Please use |
... |
Arguments passed on to
|
a ggplot2
plot
openair::trajPlot()
trajMap()
for the interactive leaflet
equivalent of
trajMapStatic()
Other static trajectory maps:
trajLevelMapStatic()
## Not run:
# colour by height
trajMapStatic(traj_data) +
ggplot2::scale_color_gradientn(colors = openair::openColours())
# colour by PM10, log transform scale
trajMapStatic(traj_data, colour = "pm10") +
ggplot2::scale_color_viridis_c(trans = "log10") +
ggplot2::labs(color = openair::quickText("PM10"))
# color by PM2.5, lat/lon projection
trajMapStatic(traj_data, colour = "pm2.5", crs = sf::st_crs(4326)) +
ggplot2::scale_color_viridis_c(option = "turbo") +
ggplot2::labs(color = openair::quickText("PM2.5"))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.