Hello, great video, although when I try to add the points to my final plot they don't appear. It worked for plotting the points in the first stage, and the shape file plotted fine. Do you know what might be going wrong?
@@zuberali7542 I haven't worked with this exact data but I've ran into a similar problem in the past. The likely issue is that the points and the polygons are using different coordinate reference systems (CRS). I believing running "proj4string([df])" will tell you what CRS the df is using, and if they're different you'd have to do some transformation to get the CRSs to be the same. To be honest though, sp is pretty outdated at this point and I would just recommend using the sf package. It'll let you do this whole thing more intuitively and with fewer lines of code. Here's what it might look like (assuming you already have your points dataframe imported): chicago_shapefile
Thank you for uploading a wonderful tutorial. I have a query that how we can plot two variables data on single map. Like : ggplot() + geom_sf(data=shape, color='grey20', size=0.1, fill=NA) + geom_sf(data = subset(clus_dzc1, type=='high'),aes(fill=CL2),size=0.1,color='black') + scale_fill_discrete_sequential(palette='Burg',name="High-risk",rev=FALSE, guide = guide_legend(ncol=2)) + theme_void() ggplot() + geom_sf(data=shape, color='grey20', size=0.1, fill=NA) + geom_sf(data = subset(clus_dzc1, type=='low'),aes(fill=CL2), size=0.1, color='black') + scale_fill_discrete_sequential(palette='Blues',name="Low-risk",rev=FALSE, guide = guide_legend(ncol=2)) + theme_void() . There are two plots code. Can you please guide me, how i can convert into one gg plot. Can you please write the code for me. I shall be very thankful to you.
Hi there, how do I count the number of raster pixels that lie within each category of shapefiles in R ? For example, I have land cover type shape file and temperature raster layer. I want to find the number of temperature raster pixels that lie within each category of land cover shape file.
Thank you so much. This was really helpful in getting me started on spatial data plotting.
This is exactly what I want! The best video I have found so far! Thank you.
This must have been the fastest 6 mins spent on learning so much and and so well
Thank you for the clear and concise explanation
Thank you so much. You help me a lot!
:)
Really a good video... I am practically using it right now. Thank You.
Thanks, I think it must be work on my maps!! and this is a gorgeous explains.
Thank you so much!!!, you saved me!!!
eyy i needed this thanks a ton!!!!!!!!!!!
This is fantastic thank you
This is fantastic work, thank you!
Hello, great video, although when I try to add the points to my final plot they don't appear. It worked for plotting the points in the first stage, and the shape file plotted fine. Do you know what might be going wrong?
same here unfortunately, any update on that ? would be very helpful
Same here, anyone figure it out
@@zuberali7542 I haven't worked with this exact data but I've ran into a similar problem in the past. The likely issue is that the points and the polygons are using different coordinate reference systems (CRS). I believing running "proj4string([df])" will tell you what CRS the df is using, and if they're different you'd have to do some transformation to get the CRSs to be the same.
To be honest though, sp is pretty outdated at this point and I would just recommend using the sf package. It'll let you do this whole thing more intuitively and with fewer lines of code. Here's what it might look like (assuming you already have your points dataframe imported):
chicago_shapefile
Thats amazing
Thank you so much!
You’re amazing thank you so much 😭
you are an angel
Hi I managed to create both the plots and the shape file, but when I bring them together they don't seem to overlay. Any ideas
amazing !!
Thank you for uploading a wonderful tutorial.
I have a query that how we can plot two variables data on single map.
Like :
ggplot() +
geom_sf(data=shape, color='grey20', size=0.1, fill=NA) +
geom_sf(data = subset(clus_dzc1, type=='high'),aes(fill=CL2),size=0.1,color='black') +
scale_fill_discrete_sequential(palette='Burg',name="High-risk",rev=FALSE,
guide = guide_legend(ncol=2)) +
theme_void()
ggplot() +
geom_sf(data=shape, color='grey20', size=0.1, fill=NA) +
geom_sf(data = subset(clus_dzc1, type=='low'),aes(fill=CL2), size=0.1, color='black') +
scale_fill_discrete_sequential(palette='Blues',name="Low-risk",rev=FALSE,
guide = guide_legend(ncol=2)) +
theme_void()
. There are two plots code. Can you please guide me, how i can convert into one gg plot. Can you please write the code for me.
I shall be very thankful to you.
Hi there, how do I count the number of raster pixels that lie within each category of shapefiles in R ? For example, I have land cover type shape file and temperature raster layer. I want to find the number of temperature raster pixels that lie within each category of land cover shape file.
how did you obtain the communities for each coordinate
instead of dots, how I can you add circles of different sizes ? Thanks
Hi, how can i zoom the map and select just a region?? i need to select part of the map but i dont know how. thank you, and thank your for the help.
I am having trouble downloading rgdal it is saying there is no such package
Great video.
Horrendous gun crime stats. Pleased I don't live in Chicago