R のプロジェクトで複数のシェープファイルを操作する必要があります。
したがって、これらのファイルをリストにロードするために readOGR 関数を繰り返したいと思います。後で、plyr を使用するか、ループを作成して、リスト内のすべてのシェープファイルに対して同じ操作を実行できます。
最小限の再現可能な例を次に示します。
library("rgdal")
setwd("your.path.here")
download.file("http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_admin_0_countries.zip","ne_10m_admin_0_countries.zip")
unzip("ne_10m_admin_0_countries.zip")
# works like this:
my.shapefile<-readOGR("your.path.here","ne_10m_admin_0_countries")
plot(my.shapefile)
# does not work like this
shapefile.list<-list(length=20)
shapefile.list[1]<-readOGR("your.path.here","ne_10m_admin_0_countries")
plot(shapefile.list[1])
エラーメッセージは
Error in xy.coords(x, y, xlabel, ylabel, log) : 'x' is a list, but does not have components 'x' and 'y'