Creates an interactive map (based on latlon) from a genlight object
gl.map.interactive(
x,
matrix = NULL,
standard = TRUE,
symmetric = TRUE,
pop.labels = TRUE,
pop.labels.cex = 12,
ind.circles = TRUE,
ind.circle.cols = rainbow,
ind.circle.cex = 10,
ind.circle.transparency = 0.8,
palette.links = NULL,
legend.title = NULL,
provider = "Esri.NatGeoWorldMap",
raster.image = NULL,
raster.opacity = 0.5,
raster.colors = (scales::viridis_pal(option = "D"))(255),
verbose = NULL
)
plots a map
A genlight object (including coordinates within the latlon slot) [required].
A distance matrix between populations or individuals. The matrix is visualised as lines between individuals/populations. If matrix is asymmetric two lines with arrows are plotted [default NULL].
If a matrix is provided line width will be standardised to be between 1 to 10, if set to true, otherwise taken as given [default TRUE].
If a symmetric matrix is provided only one line is drawn based on the lower triangle of the matrix. If set to false arrows indicating the direction are used instead [default TRUE].
Population labels at the center of the individuals of populations [default TRUE].
Size of population labels [default 12].
Should individuals plotted as circles [default TRUE].
Colors of circles. A color palette or a vectot with as many colors as there are populations in the dataset [default rainbow].
Size or circles in pixels [default 10].
Transparency of circles between 0=invisible and 1=no transparency. Defaults to 0.8.
Color palette for the links in case a matrix is provided [default NULL].
Legend's title for the links in case a matrix is provided [default NULL].
Passed to leaflet [default "Esri.NatGeoWorldMap"].
Path to a georeferenced raster image to plot [default NULL].
The opacity of the raster, expressed from 0 to 1 [default 0.5].
The color palette to use to color the raster values [default scales::viridis_pal(option = "D")(255)].
Verbosity: 0, silent or fatal errors; 1, begin and end; 2, progress log; 3, progress and results summary; 5, full report [default 2, unless specified using gl.set.verbosity].
Bernd Gruber -- Post to https://groups.google.com/d/forum/dartr
A wrapper around the leaflet package. For possible background maps check as specified via the provider: http://leaflet-extras.github.io/leaflet-providers/preview/index.html
The palette.links argument can be any of the following: A character vector of RGB or named colors. Examples: palette(), c("#000000", "#0000FF", "#FFFFFF"), topo.colors(10)
The name of an RColorBrewer palette, e.g. "BuPu" or "Greens".
The full name of a viridis palette: "viridis", "magma", "inferno", or "plasma".
A function that receives a single value between 0 and 1 and returns a color. Examples: colorRamp(c("#000000", "#FFFFFF"), interpolate = "spline").
Other graphics:
gl.colors()
,
gl.plot.heatmap()
,
gl.report.ld.map()
,
gl.select.colors()
,
gl.select.shapes()
,
gl.smearplot()
,
gl.tree.nj()
require("dartR.data")
gl.map.interactive(bandicoot.gl)
cols <- c("red","blue","yellow")
gl.map.interactive(platypus.gl, ind.circle.cols=cols, ind.circle.cex=10,
ind.circle.transparency=0.5)
Run the code above in your browser using DataLab