Select Language

AI社区

公开数据集

森林覆盖率数据,印度林业部

森林覆盖率数据,印度林业部

24K
393 浏览
0 喜欢
6 次下载
0 条讨论
Arts and Entertainment,Government,Forestry Classification

require(rgdal)require(sp)x-rgdalif (!require(x,character.only=TRUE)){ install.packages(pkgs=x,dependencies = TRUE) requi......

数据结构 ? 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


    ×

    帕依提提提温馨提示

    该数据集正在整理中,为您准备了其他渠道,请您使用

    注:部分数据正在处理中,未能直接提供下载,还请大家理解和支持。
    暂无相关内容。
    暂无相关内容。
    • 分享你的想法
    去分享你的想法~~

    全部内容

      欢迎交流分享
      开始分享您的观点和意见,和大家一起交流分享.
    所需积分:4 去赚积分?
    • 393浏览
    • 6下载
    • 0点赞
    • 收藏
    • 分享