R tutorial: Creating Maps and mapping data with ggplot2

  Рет қаралды 117,968

Statistics Guides with Prof Paul Christiansen

Statistics Guides with Prof Paul Christiansen

Күн бұрын

Пікірлер: 135
@dejamate
@dejamate 3 жыл бұрын
Simple, clear, to the point and very easy to follow at the same time. Thank you for this nice work.
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
Thank you
@digh4407
@digh4407 3 жыл бұрын
Best explanation of mapping in R I have found till now and I have been researching a lot!
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
Thank you!
@barbaraedler3628
@barbaraedler3628 2 жыл бұрын
Your tutorial helped me a lot in plotting my data. Thanks.
@denizgoktas1535
@denizgoktas1535 3 жыл бұрын
It's a clear and straigthforward explanation. Thanks.
@raulfabioriva9652
@raulfabioriva9652 3 жыл бұрын
Really good video, keep it up mate!
@saherakhan8019
@saherakhan8019 Жыл бұрын
Thanks for the tutorial and the codes.
@JD-rw5vm
@JD-rw5vm 3 жыл бұрын
Thanks. Although instead of a left join and then filtering you would probably get the same result with a right join
@antonyphilipemenyu4845
@antonyphilipemenyu4845 2 жыл бұрын
Thanks for this simple and clear video. It was super helpul
@wasafisafi612
@wasafisafi612 Жыл бұрын
Thank you for a wonderful presentation
@lucyhancock103
@lucyhancock103 2 жыл бұрын
Thank you. So concise and helpful.
@lazarus8011
@lazarus8011 3 жыл бұрын
This was so helpful. Saved me alot of time cheers.
@pranavlimaye
@pranavlimaye 3 жыл бұрын
Cool tutorial, thanks! I'm just getting into R and I found this to be very helpful. Edit: Give my regards to Bill too.
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Some of the countries look a bit distorted such as Spain and Iceland. You might play with the projection type by changing the "crs" (coordinate reference system).
@juanpablobigordag.1537
@juanpablobigordag.1537 2 жыл бұрын
Found the GIS guy! 😄
@gridsanawadeepantasri7382
@gridsanawadeepantasri7382 3 жыл бұрын
Thanks!, Really helpful better than my textbook!!
@andrewjolly319
@andrewjolly319 Жыл бұрын
Super easy to follow, thanks!
@muborizmirzoshoev4127
@muborizmirzoshoev4127 3 жыл бұрын
Very instructive video. Thanks.
@rodolphantonios1595
@rodolphantonios1595 3 жыл бұрын
Extremely helpful video
@drnikford
@drnikford Жыл бұрын
fabulous! what do you do if you do not have and equivalent value in your dataset for region (or any other)? instead, one might have "area" or "code"
@lucgardygermain8362
@lucgardygermain8362 2 жыл бұрын
Thank you! the video was really helping to get me started4
@dianepavat1710
@dianepavat1710 3 жыл бұрын
Thank you for this video! How would you go about keeping the records of NA values to still have the country showing on the map but blank on the inside so it does not influence the color scale of the legend?
@haraldurkarlsson1147
@haraldurkarlsson1147 2 жыл бұрын
Nice demo of ggplot plotting maps. There is a short-cut for eliminating NAs - namely: drop_na(Perc_vaccinated).
@pnm3225
@pnm3225 2 жыл бұрын
Thank you soooo much!!! Blessings
@mohammadbelalalzoubi8102
@mohammadbelalalzoubi8102 3 жыл бұрын
Great video. Thank you.
@santijaumes
@santijaumes 3 жыл бұрын
I love your tutorial, it was quite helpful when I was trying to do a map. Is it possible to add countries to the map with a value of 0?, maybe not in the gradient, but afterward just add a country? That would be very helpful to me.
@yonder5279
@yonder5279 10 ай бұрын
OHHHHH I get it!I made a mistake by excluding gorup=group in aes and got a messed up map, now corrected it
@guningogoi3733
@guningogoi3733 3 жыл бұрын
Nice video and I was looking for this type of material to plot my data. I will try and soon and hopeful that I can replicate the same.
@zaraemsley8095
@zaraemsley8095 2 жыл бұрын
Super helpful video! Would it be possible to add the NA value to a separate legend to say that NA = grey on your map? :)
@HangPham-nf6ug
@HangPham-nf6ug 3 жыл бұрын
It's useful. Thank you so much.
@emip9862
@emip9862 3 жыл бұрын
Amazing video, super helpful! Do you have a video yet on how to animate it? I have data from 2005 to 2020 and would love to animate this map?
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
Not yet, gganimate package will do it for you, I will get around to making an animation video soon!
@briantendaijuniormbanje7534
@briantendaijuniormbanje7534 3 жыл бұрын
Good video it is.
@stefaniaalexandra9878
@stefaniaalexandra9878 Жыл бұрын
Hi! Very informative tutorial - if we want to rather have a different colour for each country (not based on any number data), R will automatically assign some colours - how do we change them?
@remycorpfinance
@remycorpfinance 3 жыл бұрын
Hello, thanks for the video . I wonder where you found your map.shp because i actually need to find one of the France.
@nabeelnisar3077
@nabeelnisar3077 9 ай бұрын
Hi, this tutorial is really good and easy to follow, I have created the same map, But I'm having difficulty adding scale_bar or annotation_scale, Could you please show this to viewer how they can add these scales.
@bestpotato5464
@bestpotato5464 3 жыл бұрын
Wow. Thank you. I love you
@alvaro.sacris1930
@alvaro.sacris1930 2 жыл бұрын
Any reason "united States" is missing when creating mapdata?
@louiseclarkson3585
@louiseclarkson3585 2 жыл бұрын
For filtering the map down to EU countries only when i use the code - mapdata1% filter(!is.na(mapdata$`All antibiotics`)) View(mapdata1) ``` i get an error message: Error in UseMethod("filter") : no applicable method for 'filter' applied to an object of class "c('gg', 'ggplot')" -- any help with this?? thank you
@khanmarjanhossen2245
@khanmarjanhossen2245 7 ай бұрын
Hello, Im just trying to put data lebel on the region. But i cant do it. Tried a lot. Can you tell me how to do it?
@weareboootifulpeople7943
@weareboootifulpeople7943 7 ай бұрын
hi, how to solve the problem of incompatible types when i do left_join function? thanks
@annaly6341
@annaly6341 2 жыл бұрын
Thanks for this video! I had created my first map of the world. For some reason I have a missing gap of South Africa missing while the rest of the countries are present. Is there something wrong with my dataset?
@duaaadnan5884
@duaaadnan5884 Жыл бұрын
hello! i couldn't make some of the countries lighter and other darker depending on their value. is there something i can do to fix that?
@omarabdulle7985
@omarabdulle7985 8 ай бұрын
Helpful
@josieslaathaug8162
@josieslaathaug8162 2 жыл бұрын
Amazing video, super helpful! Question, on line 17 of the code where you go to filter the mapdata, what does %>% do ? My R does not recognize it as a function and won't let me filter it with that
@DrPC_statistics_guides
@DrPC_statistics_guides 2 жыл бұрын
It's from tidyverse and is called a pipe style.tidyverse.org/pipes.html it just executes operations taking an input and giving an output. Install tidyverse and it should work!
@maurxx1222
@maurxx1222 3 жыл бұрын
Thank you so much!
@AbdullahSallam
@AbdullahSallam Жыл бұрын
It looks like map_data is no longer supported by ggplot2. Do you know what it was replaced with?
@omartaani6776
@omartaani6776 2 жыл бұрын
Great video! Any Idea how I can add country names to the map? Thanks
@bankolefalade
@bankolefalade Жыл бұрын
its not showing Democratic Republic of Congo and Congo Kinshasa, any reason, maybe input names are different. United States will only load when wriiten as USA. thanks for a great workshop
@briantendaijuniormbanje7534
@briantendaijuniormbanje7534 3 жыл бұрын
Was it possible instead of using a left join and then filter, to just have done an inner join?
@balonciega
@balonciega 3 жыл бұрын
thank you!!
@WhiteGaming5883
@WhiteGaming5883 2 жыл бұрын
can we modify the geometry part of a shapefile?? thanks~!
@coolgamer720
@coolgamer720 3 жыл бұрын
Great video! I followed it; however, the USA is not showing up on my map.
@allietexter6949
@allietexter6949 3 жыл бұрын
Try, world_map$region[world_map$region == "USA"] = "United States" that should fix it!
@meshackkibitok3654
@meshackkibitok3654 3 жыл бұрын
How can I get the map data for the entire world? I am trying to View but it displays an error
@parwana-e-aatish9641
@parwana-e-aatish9641 3 жыл бұрын
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.
@李安琪-e8e
@李安琪-e8e 3 жыл бұрын
plot1
@ayaabdelghany4404
@ayaabdelghany4404 2 жыл бұрын
How did you add a percentage column to the world map table?
@rjthemoneymantoo
@rjthemoneymantoo 2 жыл бұрын
So I have a dataset with volcano names as well as their own longitudes and latitudes. Is there any way I can plot that data into a map that shows their locations as points using this method?
@DrPC_statistics_guides
@DrPC_statistics_guides 2 жыл бұрын
You can use something like this to do that kzbin.info/www/bejne/iZXZeK2YhL9gh9U
@norhajaratunfatinmohamadno7710
@norhajaratunfatinmohamadno7710 3 жыл бұрын
What is the best way to get the map data 1? I've watched every video on KZbin from beginning to end, but I'm still unable to locate the vaccination percentage map. Is there a solution?
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
www.statista.com/statistics/1196071/covid-19-vaccination-rate-in-europe-by-country/
@finkthegirl
@finkthegirl 3 жыл бұрын
Hi! Great video! But I always get the notification "Error in left_join(mapdata, fieldworkplaces, by = "region") : could not find function "left_join"". Any ideas on how to solve this? Thanks!
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
Install the dplyr package
@psllive6821
@psllive6821 2 ай бұрын
It shows error In map1
@DrPC_statistics_guides
@DrPC_statistics_guides 2 ай бұрын
What's the error? I imagine the problem is spelling color as clor
@rashawnhoward564
@rashawnhoward564 3 жыл бұрын
Thank you for this video! them_void in base ggplot2 removes all the axis stuff for you so you don't have to write it out
@daemondias3782
@daemondias3782 3 жыл бұрын
Looking to get the provinces of Canada for a map but the world data does not provide this, do you know of any datasets that do?
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
tengl.net/blog/2020/1/7/drawing-canada-maps-in-r
@poppypayne4053
@poppypayne4053 3 жыл бұрын
What can you do when their is not a mutual variable between the map data and my own dataset ('region' was the example given here). My countries are also coded indifferently to map data, will these cause some issues? Any help would be very much appreciated for my dissertation! (I'm very new to R)
@P_DOGG_ALI
@P_DOGG_ALI 2 жыл бұрын
did you manage to get this sorted?
@eugenebronstein6296
@eugenebronstein6296 3 жыл бұрын
Thanks.
@hinawaritv7575
@hinawaritv7575 3 жыл бұрын
Can we select the other regions examples china, taiwan, Frances?
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
yes, all countries can be done, I limited them to the ones I had vaccination data for.
@hinawaritv7575
@hinawaritv7575 3 жыл бұрын
@@DrPC_statistics_guides thanks Dr. I Just successful do it awesome.
@simrankhalid-islam2793
@simrankhalid-islam2793 2 жыл бұрын
is it possible to label the countries on the map ?
@fireywhitecelt
@fireywhitecelt 3 жыл бұрын
I'm completely new to it but the view part will not run, does not recognize object
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
I have just ran all the code and it all works fine, I imagine that you have a slight mismatch between what you have called the object and what you are asking to View() Here are all the cases were there is an object defined + a view in the script that's linked below the video EUvax
@fireywhitecelt
@fireywhitecelt 3 жыл бұрын
@@DrPC_statistics_guides sorry I really didn't expect a reply 😅
@tanushreehalder1629
@tanushreehalder1629 2 жыл бұрын
@@DrPC_statistics_guides, It's a great video. I am trying to plot it, but from where I may get the mapdata? I am finding "Error: object 'map1' not found".
@shwetahegde475
@shwetahegde475 2 жыл бұрын
Can anybody help me with my data? I am struggling with errors. It is for my thesis.
@TheMinstrel55
@TheMinstrel55 3 жыл бұрын
I have put in all the code and nothing is coming out at all
@verygoodlad
@verygoodlad 2 жыл бұрын
Hey, how do you add labels on the countries?
@aymericmouttapa8313
@aymericmouttapa8313 Жыл бұрын
Did you find a way to add the country names ?
@ChristalCecil-z5q
@ChristalCecil-z5q 4 ай бұрын
Macejkovic Curve
@HUrsulaEdmund-q4s
@HUrsulaEdmund-q4s 4 ай бұрын
Halvorson Way
@danielmihai3098
@danielmihai3098 3 жыл бұрын
Is there any way to add to this map another variable that is illustrated for example by bubbles/dots, in addition to the existing one? Thanks!
@innanavenus5213
@innanavenus5213 3 жыл бұрын
How can I use my own shape file
@MaymeJurgensmeier-e6w
@MaymeJurgensmeier-e6w 3 ай бұрын
Smitham Garden
@BobOvit-s5c
@BobOvit-s5c 4 ай бұрын
Norbert Plaza
@goodluckzmtae
@goodluckzmtae Жыл бұрын
Does it work for r4.1
@ChrisDennington-b3e
@ChrisDennington-b3e 4 ай бұрын
McDermott Haven
@RicardoAvallone-n2u
@RicardoAvallone-n2u 5 ай бұрын
Jacques Crescent
@PamelaFender-j4y
@PamelaFender-j4y 4 ай бұрын
Larue Ranch
@CarterArcher-c8t
@CarterArcher-c8t 4 ай бұрын
Gretchen Brook
@PeterSeaton-i8z
@PeterSeaton-i8z 4 ай бұрын
McClure Road
@AbdullahGerigelen
@AbdullahGerigelen 4 ай бұрын
Eloise Radial
@LaurettaBrandel-t3c
@LaurettaBrandel-t3c 5 ай бұрын
Morar Causeway
@MelissaMartinez-o5b
@MelissaMartinez-o5b 4 ай бұрын
Sanford Ridges
@AntoinetteDixon-n3x
@AntoinetteDixon-n3x 5 ай бұрын
Cartwright Club
@ConradFrishkorn-c5s
@ConradFrishkorn-c5s 4 ай бұрын
Elna Grove
@AbigailMcmann-z9k
@AbigailMcmann-z9k 4 ай бұрын
Diamond Field
@SallyBolinger-f2m
@SallyBolinger-f2m 5 ай бұрын
Williamson Valleys
@MaijaKarppinen-u2s
@MaijaKarppinen-u2s 4 ай бұрын
O'Hara Parkways
@sharifahnurfatihahbtsyedza5517
@sharifahnurfatihahbtsyedza5517 3 жыл бұрын
how can i get the data maps ?
@DrPC_statistics_guides
@DrPC_statistics_guides 3 жыл бұрын
www.statista.com/statistics/1196071/covid-19-vaccination-rate-in-europe-by-country/
@NancyThomas-r8e
@NancyThomas-r8e 4 ай бұрын
Barton Isle
@MayQuitter-c1f
@MayQuitter-c1f 5 ай бұрын
Omari Ranch
@SimonAdolph-d6b
@SimonAdolph-d6b 4 ай бұрын
Juana Courts
@JacklynWasurick-l3u
@JacklynWasurick-l3u 5 ай бұрын
Frida Tunnel
@AnnaBrown-h1u
@AnnaBrown-h1u 4 ай бұрын
Bartell Union
@HopeNicholas-d8p
@HopeNicholas-d8p 4 ай бұрын
Burley Squares
@CorinneThompson-h2b
@CorinneThompson-h2b 5 ай бұрын
Braun Squares
@Vuqargharbaghis-c3n
@Vuqargharbaghis-c3n 4 ай бұрын
Era Estate
@BorsaAktar-m8j
@BorsaAktar-m8j 4 ай бұрын
Carroll Stream
@MozellaDenaro-u3w
@MozellaDenaro-u3w 5 ай бұрын
Anderson Place
@RoscoeSpieker-e9z
@RoscoeSpieker-e9z 4 ай бұрын
Jonathan Course
@HarmsWayMerch
@HarmsWayMerch 4 ай бұрын
Jay Lodge
R Tutorial: Creating Street maps (part 1)
11:55
Statistics Guides with Prof Paul Christiansen
Рет қаралды 2,5 М.
Create maps using the sf package in R programming
9:29
R Programming 101
Рет қаралды 8 М.
How To Create Interactive Maps with R | Step-By-Step Tutorial
21:26
GIS 101: Mapping data points in R
18:46
Milos Makes Maps
Рет қаралды 4,8 М.
I Spent 100 Hours Inside The Pyramids!
21:43
MrBeast
Рет қаралды 72 МЛН
Introduction to ggplot in R
1:17:25
Hefin Rhys
Рет қаралды 153 М.
Intro to Data Visualization with R & ggplot2
1:11:15
Data Science Dojo
Рет қаралды 276 М.
Advanced ggplot    (episode #1)
13:44
R Programming 101
Рет қаралды 17 М.
Plot Spatial Data / Shapefiles in R | Gun Violence in Chicago
6:39