[R-sig-Geo] Load point shape file
Danlin Yu
yud at mail.montclair.edu
Fri Oct 16 21:42:33 CEST 2009
Sunny:
For the first case, you probably shall set the path to where you store
your shapefiles in the R main menu. In addition, as the warning message
indicates, the readShapeSpatial function probably is better for spatial
data management than read.shape. For the second case, other than setting
the path, you also need to load the package (after installing it) by
using library(rgdal).
Hope this helps,
Cheers,
Dr. Danlin Yu
Sunny ??:
> I am trying to load my point shape file to R. I searched for hours and found
> there are two ways, one is read.shape and the other one is readOGR. I tried
> both but but can't do it successfully. Any help is appreciate.
>
>
>> x <- read.shape(system.file("test.shp", package="maptools")[1])
>>
> Error in getinfo.shape(filen) : Error opening SHP file
> In addition: Warning message:
> use readShapeSpatial:
> objects other than Spatial objects defined in the sp package are deprecated
>
>
>
>> install.packages('rgdal')
>> self<-readOGR(".","test")
>>
> Error: could not find function "readOGR"
>
> [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
___________________________________________
Danlin Yu, Ph.D.
Assistant Professor of GIS and Urban Geography
Department of Earth & Environmental Studies
Montclair State University
Montclair, NJ, 07043
Tel: 973-655-4313
Fax: 973-655-4072
email: yud at mail.montclair.edu
webpage: csam.montclair.edu/~yu
More information about the R-sig-Geo
mailing list