[R-sig-Geo] +AFs-R-sig-Geo+AF0- Represent data on map
Rolando Valdez
rvaldezr at gmail.com
Sat Jan 4 21:33:18 CET 2014
It didn't work.
+AD4- names(map)
+AFs-1+AF0- +ACI-CVE+AF8-EDO+ACI- +ACI-NOMBRE+AF8-EDO+ACI-
+AD4- names(unem)
+AFs-1+AF0- +ACI-num+AF8-est+ACI- +ACI-est+ACI- +ACI-X2000+ACI- +ACI-X2005+ACI- +ACI-X2010+ACI- +ACI-X2013+ACI-
+AD4- spplot(map, 'X2000')
Error en +AGAAWw-.data.frame+AGA-(obj+AEA-data, zcol) : undefined columns selected
Is it a problema having separate shapefile information of statistic?, because there are two files, the .shp and csv, although these have the same identificator. I mean, the +ACI-CVE+AF8-EDO+ACI- +AD0- +ACI-num+AF8-est+ACI- and +ACI-NOMBRE+AF8-EDO+ACI- +AD0- +ACI-est+ACI- are the same value. I'm thinking if I have to paste the csv columns to the map object.
Thanks,
Rol+AH4-
-----Mensaje original-----
De: MacQueen, Don +AFs-mailto:macqueen1+AEA-llnl.gov+AF0-
Enviado el: s+AOE-bado, 4 de enero de 2014 12:07 a. m.
Para: Rolando Valdez+ADs- r-sig-geo+AEA-r-project.org
Asunto: Re: +AFs-R-sig-Geo+AF0- Represent data on map
Cannot help much without more information, but try:
names(map)
Then pick one of the column names. Apparently, +ACI-2000+ACI- is not the name of a column of data in the map object.
If map is like unem, then perhaps
spplot(map, 'X2000')
is what you need.
Note, the c() in
c(+ACI-2000+ACI-)
is not necessary. Simply
+ACI-2000+ACI-
would be sufficient.
I am not familiar with the readShapeSpatial function+ADs- I always use
readOGR() from the sp package.
-Don
--
Don MacQueen
Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062
On 1/3/14 1:00 PM, +ACI-Rolando Valdez+ACI- +ADw-rvaldezr+AEA-gmail.com+AD4- wrote:
+AD4-Hi,
+AD4-
+AD4-I'm trying to represent data (unemployment rate) on a map.
+AD4-
+AD4-This is what I have:
+AD4-
+AD4APg- library(sp)
+AD4APg- library(maptools)
+AD4-Checking rgeos availability: TRUE
+AD4APg- map +ADw-- readShapeSpatial(+ACI-ESTADOS+ACI-)
+AD4APg- read.csv(+ACI-C:+AFwAXA-Users+AFwAXA-Rolando+AFwAXA-Documents+AFwAXA-Maestr+AO0-a en Econom+AO0-a+AFwAXA-3er
+AD4APg-Semestre+AFwAXA-AEMT+AFwAXA-desempleo+AF8-est.csv+ACI-)
+AD4APg- spplot(map, c(+ACI-2000+ACI-))
+AD4-Error en +AGAAWw-.data.frame+AGA-(obj+AEA-data, zcol) : undefined columns selected
+AD4-
+AD4APg- unem +ADw-- read.csv(+ACI-C:+AFwAXA-Users+AFwAXA-Rolando+AFwAXA-Documents+AFwAXA-Maestr+AO0-a en
+AD4APg-Econom+AO0-a+AFwAXA-3er Semestre+AFwAXA-AEMT+AFwAXA-desempleo+AF8-est.csv+ACI-)
+AD4APg- names(unem)
+AD4AWw-1+AF0- +ACI-num+AF8-est+ACI- +ACI-est+ACI- +ACI-X2000+ACI- +ACI-X2005+ACI- +ACI-X2010+ACI- +ACI-X2013+ACI-
+AD4-
+AD4-I hope you can help me, this is my first time in R.
+AD4-
+AD4-Regards,
+AD4-
+AD4-Rol+AH4-
+AD4-
+AD4AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBfAF8AXwBf-
+AD4-R-sig-Geo mailing list
+AD4-R-sig-Geo+AEA-r-project.org
+AD4-https://stat.ethz.ch/mailman/listinfo/r-sig-geo
More information about the R-sig-Geo
mailing list