0
我刚刚开始使用R-ArcGIS桥包arcgisbinding
,并且在尝试将要素类数据与dplyr
包结合时遇到问题。下面是一个例子,我试图从两个shape文件中将臭氧层列转换为单个数据帧,然后将其作为shapefile导出。上述R-ArcGIS:不可能用数据框执行dplyr连接?
library(dplyr)
library(arcgisbinding)
arc.check_product()
fc <- arc.open(system.file("extdata", "ca_ozone_pts.shp",
package="arcgisbinding"))
d <- arc.select(fc, fields=c('FID', 'ozone'))
p<-arc.select(fc,fields=c('FID', 'ozone'))
p$ozone<-p$ozone*2
p<-left_join(p,d,by="FID")
arc.write(tempfile("ca_new", fileext=".shp"), p)
# original dataframe has shape attributes
str(d)
# new dataframe does not
str(p)
从arcgisbinding
包,p
和d
与形状属性的数据帧的对象。问题是,一旦我使用left_join
,我会丢失连接数据帧中的空间属性数据。有没有解决的办法?