micromapSTDefaults data.frame structure
The micromapSTDefaults data.frame provides all of the detailed structure, colors, sizing, font sizes, separation distances, line weights and types, spacing, etc. required to physically construct the requested micromapST graphic for an 8.5 inches by 11 inches page in portrait format with 1/2 inch margines. The data.frame is mainly used internal to micromapST, but a copy can be obtained by a user when a large number of changes are required. This is not recommended. The primary purpose of this section is to provide a list and description of many of the variables in the details list that can be used to enable or disable functions of micromapST and it's glyphics. This variable are identified by a "*" after the variable name. These are the only variables that generally safe to be modified by the user.
The data.frame contains two lists: colors and details.
The colors vector is the name of a color palette or a vector of 7 or 14 color names or values ("#xxxxxx"). The vector defines the colors used for:
The 5 colors in each group for the states and symbols in the glyphcs. One color per row (state).
1 color for the median state and glyphics,
1 foreground color for highlighted states in the map. This is used to highlight states already referenced previously or have meaning depend on the type of map requested. The usage is as follows:
"map" - not used. "mapcum" - highlight states previously referenced above. "maptail" - highlight states previously referenced above the median row and highlight remaining states below the median row. "mapmedian" - highlight all states above the median in maps above the median row and highlight all states below the median in maps below the median row.
When 7 additional colors are specified, they are used as the translucent colors in the time series glyphics bands. If only 7 colors are provided, the additional 7 translucent colors are generated from the original colors as a 20% transparent version of the original color e.g., adjustcolors(colors,0.2)
If colors = "greys" or "grays" or "bw", the entire plot will be done using the packages standard black/white/gray shades. Additional color palettes may be supported in future releases.
If a colors vector is not provided, the package default colors will be used:
5 state colors: "red", "orange", "green", "greenish blue", "lavender"
1 median state color: "black"
1 highlighed states: "light yellow" and
7 translucent colors using the above colors at 20%.
The colors parameter is optional and should only be used when the colors are to be overridden for a set of linked micromaps.
is a list structure that contains the variables and values for the detailed layout and operation of micromapST. The list of variables is:
= 5, items (rows) per group.
= 11, groups of states. The one state median row counts as 1.
= c(1,6,11,16,21,26,27,32,37,42,47), index for first items in each of the 11 groups
= c(5,10,15,20,25,26,31,36,41,46,51), index for last items in each of the 11 groups
The ib and ie variables are used to index into the sorted list of states to pull out the states for a particular group/row.
= 0.95, top margin in inches
= 0.5, bottom margin in inches
= 0.5, bottom margin for legend
= 0.2, bottom margin difference
= 0.2, left margin when Y axis labels and title are required
= c(0,0,0,0,0,0.1,0.1,0.0.0.0.0), location of row separations in each column of panels (0.1 around the median row, 0 for others). (inches)
= c(7,7,7,7,7,1.6,7,7,7,7,7), size of rows in each panel (1.6 row units for median row, 7 row units for the 5 item groups)
= c(35, 1.65, 35), size of panels (1.65 row units for median panel, 35 row units for the 5 item groups.)
= c(0,0.1,0.1,0), separation between panels (0.1 inches for median panel, 0 for others)
= 1.4 inches, width of each map
= c(0.9, 0.3), width of id columns (full name (0.9) and abbreviated (0.2)) inches
= 1.08, x axis scale expansion factor. Applied to the data range to calculate the graph's range.
= 0.67, y axis padding for integer plotting locations
= 0.34 inches, total panel padding (i.e., 0.17 at top and bottom of panel)
= 0.63 inches, spacing to keep reference line off panel edge
= 1.75 inches, top panel 1st line placement above the first panel, used with lab1
= 1.05 inches, top panel 2nd line placement above the first panel, used with lab2
= 0.65 inches, bottom panel line placement below the last panel, used with lab3
= -0.7 inches, reference line legend below last panel, used with reftext
= .40 inches, Y axis label placement (to the left of panel), used with lab4
= 1.0, text size of title, used with title
= 0.2 inches, lowest line for map legend text, used with map glyph for footer label
= "white" * Grid line color
= 1, Grid line width
= c(2,0.1,0), Top margin line for "X" axis labels and axis line.
= c(2,0,0), Bottom margin line for "X" axis labels and axis line.
= -0.7, Axis tick label placement adjustment
= c(0.75, 0.05, 0), Left "Y" axis margin line for axis labels and axis line.
= "#EBEBEB", * defaults to light gray
= "black", * color of panel outlines
= 0.7, general text size
The following variable relate to the reference text and line features:
= "dashed", * set reference value line to dashed
= 1.5, * line width of reference line
= "midgreen", * color of reference line when color is used.
= "black", * color of reference line when grays are used.
= 0.7, * size of reference line text
= "black", * color of reference line text when color is used.
= "black", * color of reference line text when grays are used.
The following variables are used by the arrow glyph:
= 2.5, line width of arrow.
= 0.08, * size of arrow (*** not implemented ***)
= 0.08, length of arrow.
= 4.0, * line width of arrow shadow to create outline (*** not implemented ***)
= "black", * arrow shadow color (*** not implemented ***)
The following variables are used by the bar glyph:
= 2/3, * fraction of line height for. Should never be > .90. Usable range is 0.333 to 0.90
= "black", * color of bar outline.
= 0.5, * line width for bar outline
= "solid", * line type for bar outline
The following variables are used by the boxplot glyph:
= 0.2, line width of box.
= 0.6, thick line width.
= FALSE, * whether to outline the outlier points.
= 0.80, * line width of median line.
= "white", * color of median dot.
= 19, * solid circle symbol.
= 0.95, * size of circles.
= 2, * line width for median.
= "black", * color of median box
= "#262626FF", * boxplot outline color
= 0.4, * line width of outlier outlines.
= 0.7, * size of outlier dots.
= "#4c4c4cFF" * color of outliner lines when greys used.
The following variables are used by the dot, dotconf, and dotse glyphs:
= 21, * solid circle (S compatible).
= 0.9, * size of dot.
=FALSE, * whether to outline the dots.
= "black", * color of dot outline.
= 0.5, * line width of dot outline.
The following variables are used by the dotconf glyph:
= 95, percent confidence interval
= 2, * line width of confidence interval lines.
= 0.55, * size of confidence interval
The following variables are used by the id glyph:
= 0.9, text side of ID column
= .1/3, offset to align state names
= 21, * pch symbol value to plot next to state name/abbrev.
= 0.6, * size of dot symbol for state ID
= "dark gray", * outlines of ID
The following variables are used by all of the "map" type glyphs:
= "#262626FF", * color of state fill in maps
= "white", * background of maps
= 1, * line weight for map background boundaries
= "black", * foreground color of maps
= 1, * line weight for map foreground boundaries
= "black", * color of national outline in maps
= 1. * line weight for national boundaries
= 0.32, * font size for state labels
The following variables are used by the ctrbar glyph:
= "white", * centered bar zero vertical line color
= 1, * line width for centered bar zero vertical line
= "dotted", * type of centered bar zero line
= FALSE, * enables variable height bars.
= FALSE, * request two ended variable height bars be used (small to large to small). (*** Not implemented ***)
The following variables are used by all of the horizontal stacked bar glyphs (ctrbar, segbar and normbar):
= "#262626FF", * very dark gray, color of bar segment outline in segmented bar plots.
= 0.75, * line weight for bar segment outline in segmented bar plots.
= "solid", * line type for bar segment outline in segmented bar plots.
= 0.3333, * height of first bar when variable height bars are used. Must be less than SBar.Last.barht and in the range of 0.333 to 0.6667, SNBar.varht or CBar.varht must be TRUE for this option of function.
= 0.80, * height of last bar when variable height bars are used. Must be greater than CSNBar.First.barht and in the range of 0.6667 to 0.90. CSNBar.varht or CBar.varht must be TRUE for this option of function.
The following variables are used by the segbar and normbar glyphs:
= 0.66667, * fixed height of bar when variable height bars are is not used. Should never be greater than 0.90. Usable range is 0.333 to 0.90.
= FALSE, * enables variable height bars from SBar.First.barht to SBar.Last.barht.
= FALSE, * request two ended variable height bars be used (small to large to small).(*** Not implemented ***)
=FALSE, * request a dot be draw in at the mid point in the segmented bars.
=21, * type of point/symbol used as the mid point dot. SNBar.Middle.Dot must be TRUE for this parameter to function.
="white", * color of the point/symbol used as the mid point dot. SNBar.Middle.Dot must be TRUE for this parameter to function.
=0.3, * size of point/symbol used as the mid point dot. SNBar.Middle.Dot must be TRUE for this parameter to function.
=NA, * line width of outline of point/symbol used as the mid point dot. SNBar.Middle.Dot must be TRUE for this parameter to function.
=NA, * color of outline of point/symbol used as the mid point dot. SNBar.Middle.Dot must be TRUE for this parameter to function.
The following variables are used by the scatter dot glyph (scatdot):
= 21, * type of point/symbol to be used for background data points (not active) - state's dots.
= 0.6, * line width of outline of point/symbol used as non-active data points.
= 0.75, * size of point/symbol used as non-active data points.
= "transparent", * fill color for not selected state's dots.
= 21, * type of point/symbol for active data points
= 0.6, * Scatter dot symbol outline line weight for active data points
= 1, * size of point/symbol for active data points in scatter dot
= 21, * shape of filled symbol for median value - scatter dots
= 0.6, * line width used on the median symbol - scatter dots
= 1, * symbol size median value - scatter dots
= "black", * color of filled symbol for median value - scatter dots
= 0.49, font size for Y axis labels for scatter dots
= 1.1, x range multiplier to keep dots from being clipped
= 1.08, y range multiplier to keep dots from being clipped
= FALSE, * whether or not to include horizontal grid lines in panel
= TRUE, * whether or not to include x=y sloped line
= colGrid, * color of sloped line, default, grid line color. SCD.DiagLine must be TRUE.
= 1, * line weight of sloped line, default, grid line color. SCD.DiagLine must be TRUE.
= "solid", * line type of sloped line, default, grid line color. SCD.DiagLine must be TRUE.
The following variables are used by the time series glyphs (ts and tsconf):
= 1.1, * time series line weight
=0.49, * font size for Y axis labels
= FALSE, * whether or not to include horizontal grid lines in panel
When changing the colors list, then the entire list must be specified. To change the values of items in the details list, only the variable(s) requiring change need to be specified as a list for the details= parmater in the call. In general, the beginning of the variable names indicates the glyph the variable is associated, in most cases.
Arrow. -> arrow glyph Bar. -> bar glyph BoxP -> boxplot glyph CBar -> ctrbar glyph CSNBar -> ctrbar, segbar and normbar glyphs. Dot. -> dot, dotconf, and dotse glyphs Dot.conf. -> dotconf glyph Grid -> grid elements of all glyphs Id. -> id glyph Map. -> map glyphs Panel -> general glyph panel Ref -> Reference text and line SCD. -> scatter dot glyph SNBar -> segbar and normbar glyphs Title -> page and column labels and titles TS -> ts and tsconf glyph TSconf -> tsconf glyph
The remaining variables deal with page and glyph layout and spacing and should not be adjusted.
For example: to turn off the midpoint dot in the segmented bar glyphics, all that is required is:
details = list(SNBar.Middle.Dot=FALSE)
The micromapSTDefaults data.frame is built by the micromapSTSetDefaults function when the micromapST package is called. Once built it cannot be changed. To change one or two (a few) variables, construct a list of these variables and pass it to micromapST via the details parameter in the call. To do large scale customization, call the micromapSTSetDefaults function to get a copy of the entire data.frame and modify this copy. This is not recommended.
Daniel B. Carr, George Mason University, Fairfax VA, with contributions from James B Pearson and Linda Pickle of StatNet Consulting, LLC, Gaithersburg, MD
Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.