How to import and visualize shapefiles in RStudio

preview_player
Показать описание
This tutorial explains how to load shapefile in RStudio using rgdal library and visualize using ggplot2 library.

code:
library(rgdal)
library(ggplot2)
shp = readOGR(dsn=".", layer="shapefilename")
plot(shp)
df = fortify(shp)
ggplot()+
geom_polygon(data = df, aes(x = long, y =lat, group=group))
Рекомендации по теме
Комментарии
Автор

Good morning sir, I have collected 800 soil samples from different districts of Manipur State in India. The soil samples were analysed for different forms of soil acidity. Sir I wish to prepare a soil acidity map of Manipur state using my data. Sir Could you share some of your knowledge to prepare.

ldsharma
Автор

Thanks a lot. Your explanation is really clear

myworld
Автор

Are u currently doing msc geoinformatics?

chandanap
Автор

can u please share the shape fle and code also.

puneetsharma