How to Import Shapefile in RStudio

Поделиться
HTML-код
  • Опубликовано: 11 окт 2024
  • In this video, i will present how to upload shapefile in RStudio.
    We will use the sf package to work with vector data in R. Notice that the rgdal package automatically loads when sf is loaded. We will also use the raster package, which we will work with in more detail in later episodes, so we can explore raster and vector spatial metadata using similar commands. Make sure you have the sf library loaded.
    Shapefiles are a common way to store geospatial data. This post explains how to read it with R and the rgdal package, and how to plot it in base R or with ggplot2.
    The rgdal package offers the readOGR() function that allows to read shapefile using the following syntax.
    As a result you get a geospatial object (my_spdf here) that contains all the information we need for further mapping. Please try th following command to understand how this object works:
    It is totally possible (and advised imo) to build the map with ggplot2. However, ggplot2 takes as input data frames, not geospatial data.
    my_spdf thus needs to be transformed using the tidy() function of the broom package. The region argument of this function expect one of the column name if the @data slot. It will be the region name in the new dataframe.
    #rstudio #remotesensing #shapefile #import #vector #vectordata #rstudiotutorial#How to Import Shapefile in RStudio
    how to download R,How to install R,How to install RStudio,How to download
    R,How to import shapefile to R,How to import shapefile to RStudion,How to use R as GIS tool,mapping with R,Mapping with RStudio,R for statistical analysis,data analysis with R,R and Graph,R and GIS,how to install R package
    how to download R,How to install R,How to install RStudio,How to import shapefile to R,Add multi vectors to RStudion,How to use R as GIS tool,mapping with R,Mapping with RStudio,data analysis with R,how to install R package,Download spatial data,symbology with R,downlaod vector data for free
    Creating a Map from a Shapefile with ggplot2 and rgdal,rgdal,making maps with R,GIS with R,GIS with Rstats,readOGR shapefiles,shapefile r,shapefiles in r,shapefile in r,shapefiles with r,ggplot2 map,ggplot shapefiles,ggplot maps in r,shapefiles making r,readogr,read shape file in r,ovrir shapefile avec r,ggplot2 maps,r shapefile

Комментарии • 2

  • @athila2942
    @athila2942 2 месяца назад

    Thank you so much, fella! It was very dificult to find good videos teaching how to do this

  • @CT-mc3sy
    @CT-mc3sy 4 месяца назад

    what if rgdal won't download?