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
,我會丟失連接數據幀中的空間屬性數據。有沒有解決的辦法?