gravatar

technocrat

Richard Careaga

Recently Published

Mean divisors of integers in a series
Exercise to determine how the mean of divisors of integers in a series do or do not converge
FAQ: 3-d plot from x,y,z
Extract from the docs
Using built-in function mostattributes to associate metadata with data frame
The mostattributes() built-in with a minimal example of adding metadata to a data frame, now preferred over using an S4 class to create a "slot" for metadata to travel with an associated data frame slot.
Thematic Mapping in R Without the Tears, Part 7: Breakouts
The layering provided by ggplot allows breaking out subsets to highlight differences more easily than by looking only at aggregate data. In this example, police death data is further broken out by states voting Republican and Democrat in the 2012 presidential election.
Thematic Mapping in R without the Tears, Part 6: Counts
The importance of transforming raw counts to some other measure, such as ratios, is illustrated with an example showing police caused deaths
Thematic Mapping in R without the Tears, Part 5: Colors
Link to large file
Thematic Mapping in R without the Tears, State Names
Extracting postal codes of state names and their geographic coordinates is straightforward, as is plotting. A few states require manual adjustments.
Thematic Mapping in R without the Tears, Part 4: "Outsetting" RI, DE, DC
This code sample moves the states of Rhode Island and Delaware and the District of Columbia offshore to leave room for their labelling and, in the case of DC, to allow for its enlargement (future).
Thematic Mapping in R without the Tears, Part 3: Insetting Alaska and Hawaii
Procedure to produce compact outline map of the United States with scaled and relocated outlines of Alaska and Hawaii
Thematic Mapping in R without the Tears, Walkthrough
A step-by-step tutorial for preparing thematic maps using ggplot2 and other packages, including importing shapefile base maps, extracting geographic coordinates, adding user data by geographic unit, plotting, adding a projection, controlling breaks and colors.