View source: R/ggplot_geopos.r
| ggplot_geopos | R Documentation |
Geolocations provided via CSV or data frames are plotted as line or scatter plots. If netCDF (.nc) or KMZ files from the Wildlife Computers portal are selected, a SpatialPolygonsDataFrame is created and surface probability maps are illustrated. The netCDF transformation follows the R-code in the Location Processing User Guide. KMZ files already include contour lines of the 50, 95, and 99% likelihood areas, which are extracted and transformed to a SpatialPolygonsDataFrame.
ggplot_geopos(x, ggobj, xlim, ylim, zlim, standard_year=FALSE,
full_year=standard_year, date_format, lang_format="en", tz="UTC",
Breaks, cb.title, cb.date_format, cbpos, cb.height = 10, cb.xlab = "",
cb.reverse=FALSE, pal.reverse=cb.reverse, prob_lim=.75, color_by="date",
pal, alpha=70, type="p",
main ,lwd=1, size=2, shape=19, verbose= FALSE, ...)
get_geopos(x, xlim, ylim, date_format, lang_format="en", tz="UTC",
proj4string, prob_lim=.5, verbose=TRUE)
x |
data.frame containing horizontal position records, or a path/filename of |
ggobj |
A ggplot object (optional base plot). |
xlim, ylim |
Numeric vectors defining the limits of the x- and y-axes. |
zlim, Breaks, standard_year, full_year |
Date range and breaks of the colorbar. If |
date_format, lang_format, tz |
character strings indicating the date format, language format and the corresponding time zone, defined by the vectors Date and Time (by default: date_format="%d-%b-%Y %H:%M:%S", lang_format="en", tz='UTC')
If formatting fails, please check as well the input language format, defined by |
proj4string |
Coordinate reference system (CRS; projection). |
cb.title |
Title of the colorbar (default "Date"). |
cb.date_format |
Date format of the colorbar ticks (default "%Y-%m-%d"). |
cbpos, cb.xlab, cb.height |
Position, x-axis label, and height of the colorbar. |
prob_lim |
For kmz, kml, or netCDF (.nc) files, defines the probability surface limit in %. Default 50%. Valid KMZ/KML values: 50, 95, 99. |
color_by |
Column or vector used for coloring geolocations (default "date"). |
pal |
Color map used for polygon (.nc) or scatter plots. See cmap for pre-installed color maps. |
cb.reverse, pal.reverse |
Inverse order of ticks and colormap of colorscale. |
alpha |
Transparency of polygons or dots in percent (default 70). |
type |
Plot type: "p" for points (default), "l" for lines, "b" for both. |
size, shape |
Point size and type (default 2 and 19 for solid dots). |
lwd |
Line width. |
... |
Additional arguments passed to ggplotmap. |
main |
Overall plot title. |
verbose |
Whether file names should be printed when loading geolocation files (default TRUE for |
Robert K. Bauer
leaflet_geopos, ggplotly_geopos, ggplotmap, SpatialPolygonsDataFrame
# Example 1a: Line plot from CSV
# library(oceanmap)
# csv_file <- system.file("example_files/15P1019-104659-1-GPE3.csv", package="RchivalTag")
# pos <- get_geopos(csv_file)
# ggobj <- ggplot_geopos(pos)
# ggobj
# ggplotly_geopos(ggobj)
# Example 1b: Scatter plot on existing landmask
# ggobj <- oceanmap::ggplotmap("lion", grid.res=5)
# ggobj4 <- ggplot_geopos(csv_file, ggobj)
# ggplotly_geopos(ggobj4)
# Example 2: Probability surfaces from netCDF
# nc_file <- system.file("example_files/15P1019-104659-1-GPE3.nc", package="RchivalTag")
# ggobj6 <- ggplot_geopos(nc_file)
# ggplotly_geopos(ggobj6)
# Example 3: Probability surfaces from KMZ
# kmz_file <- system.file("example_files/15P1019-104659-1-GPE3.kmz", package="RchivalTag")
# ggobj7 <- ggplot_geopos(kmz_file)
# ggplotly_geopos(ggobj7)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.