【发布时间】:2013-05-31 18:39:39
【问题描述】:
我在 R 中是全新的。 我正在尝试将空间数据框和普通数据框保存在同一个对象中。当我应用下面的代码时,它将对象保存为 R 工作区,这正常吗?我的意思是我想获得一个 .rda 数据。我特别想做的是使用这两个对象获取 R 数据。我希望空间数据框保持其空间特性。有人可以帮我吗?
##import a text table
mcvfinal<-read.csv("dataCPWithAge.csv",header=TRUE,sep=",",dec=".")
##reading the shapefile
library(rgdal) polypc1 <- readOGR(".", "CP3poly_Matchingshp")
##saving the two frames into the same object
save(mcvfinal,polypc1,file="polypc.Rdata")
【问题讨论】:
-
答案对你有用吗?
-
效果很好,我只是无法查看 polypc.rds 文件的内容。当我在做他 str(polypc) 时,它会导致系统出错。它开始打开,但神经结束。 – 很好,