My goal is to prepare a thematic map of the US, with states shaded according to their values for a variable of interest. I would like to include an inset for Alaska in the upper left and an inset for Hawaii in the lower left. If possible, I'd like to use Albers conic projection, or something similar. Thus far I have tried using the maps package with its state database (which omits Alaska and Hawaii) and the gmaps package (which places an inset for Alaska in the lower left and uses a projection [Miller cylindrical?] that distorts states along the northern and southern fringe). I would be very grateful for suggestions about alternative approaches. John -- John P. Burkett Department of Environmental and Natural Resource Economics and Department of Economics University of Rhode Island Kingston, RI 02881-0808 USA phone (401) 874-9195
On 04/08/2008 1:14 PM, John P. Burkett wrote:> My goal is to prepare a thematic map of the US, with states shaded > according to their values for a variable of interest. I would like to > include an inset for Alaska in the upper left and an inset for Hawaii in > the lower left. If possible, I'd like to use Albers conic projection, or > something similar. Thus far I have tried using the maps package with > its state database (which omits Alaska and Hawaii) and the gmaps package > (which places an inset for Alaska in the lower left and uses a > projection [Miller cylindrical?] that distorts states along the northern > and southern fringe). I would be very grateful for suggestions about > alternative approaches.Alaska and Hawaii are in the world map, coded as regions USA:Alaska and Hawaii:Hawaii. I believe you can plot the states data, then add Alaska and Hawaii at locations of your choice afterwards. I don't know how to do multiple regions on the same plot, but here's how to do the components: map("state", projection="albers", parameters=c(25,40)) map("world2Hires", "USA:Alaska", projection="albers", parameters=c(55, 70)) map("world2Hires", "Hawaii", projection="albers", parameters=c(15, 25)) This needs the mapdata package for world2Hires, and (I think) the mapproj package for the Albers projections. Duncan Murdoch
R 2.6 Windows XP I have a 100x4 matirx data<-matrix(nrow=100,ncol=4) I would like to sort the entire matrix by column two, i.e. data[,2] I looked at the help page for sort() but can not determine how I can use it to sort a matrix on one of the matrix's columns. Thanks, John John David Sorkin M.D., Ph.D. Chief, Biostatistics and Informatics University of Maryland School of Medicine Division of Gerontology Baltimore VA Medical Center 10 North Greene Street GRECC (BT/18/GR) Baltimore, MD 21201-1524 (Phone) 410-605-7119 (Fax) 410-605-7913 (Please call phone number above prior to faxing) Confidentiality Statement: This email message, including any attachments, is for th...{{dropped:6}}