show distribution of intereted haplotypes on maps
hapDistribution(
hap,
AccINFO,
LON.col,
LAT.col,
hapNames,
database = "world",
regions = ".",
hap.color = hap.color,
zColours = zColours,
legend = TRUE,
symbolSize = 1,
symbol.lim = c(1, 10),
ratio = 1,
cex.legend = 0.8,
lwd.pie = 1,
borderCol.pie = NA,
lty.pie = 1,
showlabel = TRUE,
label.col = "black",
label.cex = 0.8,
label.font = 1,
label.adj = c(0.5, 0.5),
map.fill.color = 1,
...
)
No return value
an object of hapResult class
a data.frame contains accession information
column names of
longitude(LON.col
) and latitude(LAT.col
)
haplotype names used for display
character string naming a geographical database, a list of
x
, y
, and names
obtained from a previous call to
map
or a spatial object of class SpatialPolygons
or SpatialLines
.
The string choices include a world
map,
three USA databases (usa
, state
,
county
), and more (type help(package='maps')
to see the package index). If the requied database is in a different package that has not been attached, the string may be started with "packagename::". The
location of the map databases may be overridden by setting the
R_MAP_DATA_DIR
environment variable.
character vector that names the polygons to draw.
Each database is composed of a collection of polygons, and each polygon has
a unique name.
When a region is composed of more than one polygon, the individual polygons
have the name of the region, followed by a colon and a qualifier,
as in michigan:north
and michigan:south
.
Each element of regions
is matched
against the polygon names in the database and, according to
exact
, a subset is selected for drawing. The regions may also be
defined using (perl) regular expressions. This makes it possible to use
'negative' expressions like "Norway(?!:Svalbard)"
, which means Norway
and all islands except Svalbard. All entries are case insensitive.
The default selects all polygons in the database.
colors to apply to the pie section for each attribute column, "zColours" will be detached in future.
a keyword specified the position of legend, one of "bottomright", "bottom", "bottomleft", "left", "topleft", "top", "topright", "right" and "center"; or a numeric vector of length two contains x,y coordinate of the legend
a numeric specified the symbol size. It will be detached in future. Please use "symbol.lim" instead.
a numeric vector give the maximum and minimum size of each symbol
the ratio of Y to N in the output map, set to 1 as default
character expansion factor for legend relative to current par("cex")
line width of the pies
The color of pie's border, default is NA, which means no border will be plotted
the line type of pie border
a bool vector indicates whether show the labels which represens number of individuals. Default as TRUE.
color of the labels, default as "black"
a number indicates the text size in label, default as 0.8
Font of label, 1 for normal, 2 for bold, 3 for italica, 4 for bold-italica
the position of label, default as c(0.5, 0.5)
vector of colors. If fill is FALSE, the first color is used for plotting all lines, and any other colors are ignored. Otherwise, the colors are matched one-one with the polygons that get selected by the region argument (and are reused cyclically, if necessary). If fill = TRUE, the default boundary line colour is given by par("fg"). To change this, you can use the border argument (see '...'). A color of NA causes the corresponding region to be deleted from the list of polygons to be drawn. Polygon colors are assigned after polygons are deleted due to values of the xlim and ylim arguments
Extra arguments passed to polygon
or lines
. Of particular interest may be the options border
andlty
that control the color and line type of the polygon borders when fill = TRUE
.
# \donttest{
data("geneHapR_test")
hapDistribution(hapResult,
AccINFO = AccINFO,
LON.col = "longitude",
LAT.col = "latitude",
hapNames = c("H001", "H002", "H003"))
# }
Run the code above in your browser using DataLab