[R] Display numbers on map
David Winsemius
dwinsemius at comcast.net
Tue Jan 17 22:49:17 CET 2012
On Jan 17, 2012, at 2:21 PM, Ray Brownrigg wrote:
> David:
>
> That doesn't quite answer the question about Alaska and Hawaii.
Agreed. I misinterpreted the text of help(map) example to mean that HI
and AK boundaries could be found in "unemp". However, it was also
advice to Jeffrey that searching might suggest solutions.
I found several citations on Baron's search site, including this one:
http://finzi.psych.upenn.edu/R/Rhelp02/archive/44481.html
This is what that example lead me try (after a bit of digging for
the right names to use for Alaska_:
grep( "USA:Alas", map("world", plot=FALSE)$names, value=TRUE)
quartz(); # or whatever is appropriate in your OS to open a new
screen device
map("state", xlim=c(-170,-60), ylim=c(15,85))
map("world", "Hawaii", add=TRUE)
map("world", "USA:Alaska", add=TRUE)
--
David.
>
> Jeffrey:
>
> help(state, maps)
> states "This database produces a map of the states of the United
> States mainland ..."
>
> so you have to use:
> map("world", "USA")
> map("state", add=T)
> to get the whole lot (which I am willing to bet is not exactly what
> is wanted, even though
> it is what was stated).
>
> This is not the end of the story, but if you'll state exactly what
> you want for Alaska and
> Hawaii, then perhaps we can supply a solution.
>
> Ray Brownrigg
>
> On Wed, 18 Jan 2012, David Winsemius wrote:
>> On Jan 17, 2012, at 5:37 AM, Jeffrey Joh wrote:
>>> I have a text file with states and numbers. I would like to display
>>> each number that corresponds to a state on a map.
>>>
>>> I am trying to use the maps package, but it doesn't show Alaska or
>>> Hawaii. Do you have suggestions on how to do this?
>>
>> This question suggests you are not yet aware of the search facility
>> built into R:
>>
>> RSiteSearch("maps Hawaii Alaska" )
>> A search query has been submitted to http://search.r-project.org
>> The results page should open in your browser shortly
>>
>> The third hit was back to the "map" function help page. (The examples
>> should be read and executed.)
>>
>> ?example
>>
>>> [[alternative HTML version deleted]]
>>
>> And the above suggests you still need to read the following:
>>> PLEASE do read the posting guide
>>> http://www.R-project.org/posting-guide.html
>
David Winsemius, MD
West Hartford, CT
More information about the R-help
mailing list