公开数据集
数据结构 ? 24K
Data Structure ?
* 以上分析是由系统提取分析形成的结果,具体实际数据为准。
README.md
require(rgdal)
require(sp)
x<-"rgdal"
if (!require(x,character.only=TRUE))
{
install.packages(pkgs=x,dependencies = TRUE)
require(x,character.only=TRUE)
}
location
location="C:/Users/acer/documents/R/data/India Map"
india1<- readOGR(dsn = location,"IND_adm1")
Plot india
plot(india1)
slotNames(india1)
names(india1)
head(india1@data)
name are available in dataset
head(india1$NAME_1,10)
Sample plot ane state
plot(india1[india1$NAME_1=="Delhi",],col="red")
title("Delhi")
Read file that contain forest information
forestdata<-read.csv(file="C:/Users/acer/documents/R/data/RecordedForestArea.csv", stringsAsFactors = FALSE)
head(forestdata)
names(forestdata)
name are too long lets change it
colnames(forestdata)<-c("state","statearea","forestarea2005","reserved","protected","unclassed","totalforestarea","forestareapercent")
names(forestdata)
head(forestdata)
now change factpr to character
india1$NAME1 = as.character(india1$NAME1)
forestdata$state=as.character(forestdata$state)
now check all data in map and csv file are matched or not
india1$NAME_1 %in% forestdata$state
return row which is having missmatch
india1$NAME1[which(!india1$NAME1 %in% forestdata$state)]
So the issue is with and in place of & and also a name of the state Uttaranchal that was changed later to Uttrakhand
#
Let us make the relevant changes
india1$NAME1[grepl("Andaman and Nicobar",india1$NAME1)]="Andaman & Nicobar"
india1$NAME1[grepl("Dadra and Nagar Haveli",india1$NAME1)]="Dadra & Nagar Haveli"
india1$NAME1[grepl("Jammu and Kashmir",india1$NAME1)]="Jammu & Kashmir"
india1$NAME1[grepl("Daman and Diu",india1$NAME1)]="Daman & Diu"
india1$NAME1[grepl("Uttaranchal",india1$NAME1)]="Uttarakhand"
now check again the matching or nor
india1$NAME_1%in%forestdata$state
帕依提提提温馨提示
该数据集正在整理中,为您准备了其他渠道,请您使用
- 分享你的想法
全部内容
数据使用声明:
- 1、该数据来自于互联网数据采集或服务商的提供,本平台为用户提供数据集的展示与浏览。
- 2、本平台仅作为数据集的基本信息展示、包括但不限于图像、文本、视频、音频等文件类型。
- 3、数据集基本信息来自数据原地址或数据提供方提供的信息,如数据集描述中有描述差异,请以数据原地址或服务商原地址为准。
- 1、本站中的所有数据集的版权都归属于原数据发布者或数据提供方所有。
- 1、如您需要转载本站数据,请保留原数据地址及相关版权声明。
- 1、如本站中的部分数据涉及侵权展示,请及时联系本站,我们会安排进行数据下线。