USALevelPlot              package:gmaps              R Documentation

_U_S_A _L_e_v_e_l _P_l_o_t

_D_e_s_c_r_i_p_t_i_o_n:

     USALevelPlot produces a mapGrob object for a map of the United
     States where the .

_U_s_a_g_e:

     USALevelPlot(
             states,
             levels,
             col.fun=grey,
             alaska='alaska'%in%tolower(states),
             hawaii='hawaii'%in%tolower(states),
             normalize=TRUE,
             name=NULL,
             vp=NULL,
             gp=NULL,
             asp=1.4,
             ...)
             grid.USALevelPlot(...)

_A_r_g_u_m_e_n_t_s:

  states: List of the full names of the states.

  levels: The response variable to use to color code the states

 col.fun: A color function that takes the response variable and returns
          a color code.

  alaska: include an inset of alaska?

  hawaii: include an inset of Hawaii?

normalize: Does the response variable need to be transformed to between
          0 and 1.  If False and levels is outside of [0,1]  may cause
          errors depending on the col.fun.

    name: the name of the object.

      vp: Viewport for the object.  used to embed within other objects.

      gp: grid graphics parameters, ie. a gpar object.

     asp: aspect ratio for the map.

     ...: other parameters passed on.

_S_e_e _A_l_s_o:

     Color Functions, 'mapGrob', 'map'

_E_x_a_m_p_l_e_s:

     #maps of Arrests by state for arrests per 100,000 for Murder
     data(USArrests)
     attach(USArrests)
     grid.newpage()
     grid.frame(name="map")
     grid.pack("map",USALevelPlot(states=rownames(USArrests),levels=Murder,col.fun=reds),height=unit(1,'null'))
     grid.pack("map",gradientLegendGrob(at=quantile(Murder),col.fun=reds),side="bottom",height=unit(.2,'npc'))
     detach(USArrests)

