revised version with Arnold fixing the OGR save shape file error (replacing with saving Rdata file) and also the gpclib error which we're avoiding by installing the rgeos package.