Can you get other plotting commands to work? E.g.
plot(1:5, 1:5)
-----Original Message-----
From: Lorenzo Isella [mailto:lorenzo.isella at gmail.com]
Sent: Saturday, August 11, 2012 3:20 AM
To: dcarlson at 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 <dcarlson at tamu.edu>
wrote:
The script is working for me. Did you get any error or warning
What version of R are you using? What operating system does your
computer use? When the command, print(load(con)), runs, what message
you see?
----------------------------------------------
David L Carlson
Associate Professor of Anthropology
Texas A&M University
College Station, TX 77843-4352
-----Original Message-----
From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
project.org] On Behalf Of Lorenzo Isella
Sent: Friday, August 10, 2012 3:21 PM
To: r-help at 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
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
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
the email), well, nothing happens and I certainly do not see a map
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")
###########################################