pointmap: Read a series of dbf files and join compile them as a single...

View source: R/pointmap.R

pointmapR Documentation

Read a series of dbf files and join compile them as a single data.frame

Description

Can help with a series of downloaded Census data files, such as one file per State. Reads each using read.dbf and combines them all as a data.frame. They must all have the same columns, and each file just provides additional rows of data.

Usage

pointmap(
  bin,
  lat,
  lon,
  vartext = "x",
  areatext = "area",
  coloring = rainbow(length(unique(bin))),
  asp = c(1, 1),
  pch = ".",
  ...
)

Arguments

bin

Indicates color of each point. A vector of integers used to index the coloring vector. That would ideally include just 1:n where n is the n number of unique values and the index to the coloring vector, so each unique value 1:5, for example, is assigned a map color that is coloring[bin]

lat

vector of latitudes just interpreted as y values to plot

lon

vector of longitudes just interpreted as x values to plot

vartext

default is 'x', text to use in describing the field mapped

areatext

default is 'area', text to use in describing the area mapped

coloring

default is some basic colors from rainbow(). A vector specifying color for each bin (should be same length as number of unique bin values)

asp

default is c(1,1), aspect ratio of graphic (not right for AK, e.g.)

pch

default is '.', see par – defines type of marker for each point

...

other params to send to plot

Value

Draws a map

See Also

countypointmap

Examples

 
  myfips <- bg.pts$FIPS[substr(bg.pts$FIPS,1,2)=='06'] # CA
  pointmap(bin = floor(runif(n = length(myfips),1,5.99)), lat = bg.pts$lat[match(myfips, bg.pts$FIPS)], lon = bg.pts$lon[match(myfips, bg.pts$FIPS)], vartext = 'Example', areatext = 'all of CA',coloring = c('gray', 'light blue', 'dark blue', 'orange', 'red') , pch=1, cex=0.3)

ejanalysis/proxistat documentation built on April 2, 2024, 10:13 a.m.