-----Original Message-----
From: Lorenzo Isella [mailto:lorenzo.ise...@gmail.com]
Sent: Saturday, August 11, 2012 3:20 AM
To: dcarl...@tamu.edu
Subject: Re: [R] Trouble with Spatial Data Example Script
Thanks for your reply.
I am running R 2.15.1 on debian testing, amd64 architecture.
~$ R
R version 2.15.1 (2012-06-22) -- "Roasted Marshmallows"
Copyright (C) 2012 The R Foundation for Statistical Computing
ISBN 3-900051-07-0
Platform: x86_64-pc-linux-gnu (64-bit)
and when I run the script, this is what I see
source('map-switzerland.R')
[1] "gadm"
gadm contains the data, but I do not see any map.
Any hint about what is going on?
Cheers
Lorenzo
On Fri, 10 Aug 2012 23:43:34 +0200, David L Carlson <dcarl...@tamu.edu>
wrote:
> The script is working for me. Did you get any error or warning
messages?
> What version of R are you using? What operating system does your
> computer use? When the command, print(load(con)), runs, what message
do
> you see?
>
> ----------------------------------------------
> David L Carlson
> Associate Professor of Anthropology
> Texas A&M University
> College Station, TX 77843-4352
>
>
>> -----Original Message-----
>> From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
>> project.org] On Behalf Of Lorenzo Isella
>> Sent: Friday, August 10, 2012 3:21 PM
>> To: r-h...@stat.math.ethz.ch
>> Subject: [R] Trouble with Spatial Data Example Script
>>
>> Dear All,
>> I need to do something relatively simple: generate a map of Europe
and
>> paint the various states with different colors (only 3-4 are needed)
>> according to a rule.
>> I would like to keep it as simple as possible and the script
resorting
>> to
>> the sp package that I found at
>>
>> http://bit.ly/Oc71ub
>>
>> is exactly what I am looking for (I need to repeat the exercise with
>> Europe instead of Switzerland and to have a legend).
>> However, when I try to run the script (which I also paste at the end
of
>> the email), well, nothing happens and I certainly do not see a map
of
>> Switzerland.
>> I am not familiar with the sp package, but am I missing the obvious?
>> Any help is appreciated.
>> Best Regards
>>
>> Lorenzo
>>
>> ########################################à
>>
>> library(sp)
>> con <- url("http://gadm.org/data/rda/CHE_adm1.RData")
>> print(load(con))
>> close(con)
>>
>>
>>
>> language <- c("german", "german", "german","german",
>> "german","german","french", "french",
>> "german","german","french", "french",
>> "german", "french","german","german",
>> "german","german","german", "german",
>> "german","italian","german","french",
>> "french","german","german")
>> gadm$language <- as.factor(language)
>> col = rainbow(length(levels(gadm$language)))
>> spplot(gadm, "language", col.regions=col, main="Swiss Language
>> Regions")
>>
>> ###########################################
>>
>> ______________________________________________
>> R-help@r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide http://www.R-project.org/posting-
>> guide.html
>> and provide commented, minimal, self-contained, reproducible code.