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).
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?
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.
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?
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.
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
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?
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
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!
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
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! 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!
What is the best way to get the map data 1? I've watched every video on RUclips from beginning to end, but I'm still unable to locate the vaccination percentage map. Is there a solution?
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)
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?
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
@@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".
Simple, clear, to the point and very easy to follow at the same time. Thank you for this nice work.
Thank you
Best explanation of mapping in R I have found till now and I have been researching a lot!
Thank you!
Your tutorial helped me a lot in plotting my data. Thanks.
Thanks. Although instead of a left join and then filtering you would probably get the same result with a right join
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).
Found the GIS guy! 😄
It's a clear and straigthforward explanation. Thanks.
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?
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"
Cool tutorial, thanks! I'm just getting into R and I found this to be very helpful.
Edit: Give my regards to Bill too.
Really good video, keep it up mate!
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.
Nice demo of ggplot plotting maps.
There is a short-cut for eliminating NAs - namely: drop_na(Perc_vaccinated).
Super helpful video! Would it be possible to add the NA value to a separate legend to say that NA = grey on your map? :)
Thanks for this simple and clear video. It was super helpul
Thank you for a wonderful presentation
Thank you. So concise and helpful.
Thanks for the tutorial and the codes.
This was so helpful. Saved me alot of time cheers.
Thanks!, Really helpful better than my textbook!!
Super easy to follow, thanks!
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?
Very instructive video. Thanks.
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.
Extremely helpful video
Hello, thanks for the video . I wonder where you found your map.shp because i actually need to find one of the France.
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?
Not yet, gganimate package will do it for you, I will get around to making an animation video soon!
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.
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
Thank you! the video was really helping to get me started4
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?
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
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!
Any reason "united States" is missing when creating mapdata?
Thank you soooo much!!! Blessings
Great video. Thank you.
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?
Great video! Any Idea how I can add country names to the map? Thanks
OHHHHH I get it!I made a mistake by excluding gorup=group in aes and got a messed up map, now corrected it
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
hi, how to solve the problem of incompatible types when i do left_join function? thanks
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.
plot1
It looks like map_data is no longer supported by ggplot2. Do you know what it was replaced with?
It's useful. Thank you so much.
Was it possible instead of using a left join and then filter, to just have done an inner join?
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?
can we modify the geometry part of a shapefile??
thanks~!
How did you add a percentage column to the world map table?
How can I get the map data for the entire world? I am trying to View but it displays an error
Great video! I followed it; however, the USA is not showing up on my map.
Try,
world_map$region[world_map$region == "USA"] = "United States"
that should fix it!
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!
Install the dplyr package
What is the best way to get the map data 1? I've watched every video on RUclips from beginning to end, but I'm still unable to locate the vaccination percentage map. Is there a solution?
www.statista.com/statistics/1196071/covid-19-vaccination-rate-in-europe-by-country/
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)
did you manage to get this sorted?
Wow. Thank you. I love you
Good video it is.
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?
tengl.net/blog/2020/1/7/drawing-canada-maps-in-r
Can we select the other regions examples china, taiwan, Frances?
yes, all countries can be done, I limited them to the ones I had vaccination data for.
@@DrPC_statistics_guides thanks Dr. I Just successful do it awesome.
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?
You can use something like this to do that ruclips.net/video/SdvGzbOZ-Qs/видео.html
Helpful
is it possible to label the countries on the map ?
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!
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
Thank you so much!
I'm completely new to it but the view part will not run, does not recognize object
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
@@DrPC_statistics_guides sorry I really didn't expect a reply 😅
@@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".
I have put in all the code and nothing is coming out at all
Can anybody help me with my data? I am struggling with errors. It is for my thesis.
How can I use my own shape file
thank you!!
Hey, how do you add labels on the countries?
Did you find a way to add the country names ?
Thanks.
Does it work for r4.1
D'angelo Glen
Halvorson Way
Howell Rue
how can i get the data maps ?
www.statista.com/statistics/1196071/covid-19-vaccination-rate-in-europe-by-country/
Macejkovic Curve
Norbert Plaza
Stanton Fields
McClure Gardens
Smitham Garden
Felicity Junctions
Levi Cliffs
Schaefer Knolls
McDermott Haven
Leilani Brooks
Johnathan Spring
Douglas Fields
McClure Trafficway
Giles Prairie
Bernadine Way
Jacques Crescent
Madelynn Crest
Rutherford Plains
Darrell Radial
Sanford Ridges
Queenie Prairie
Schiller Hollow
Bergstrom Run
Priscilla Springs
McClure Road
Mara Cliffs
Larue Ranch