R programming: Plot color-coded map of world leader's age

0 votes

I am currently working on R programming. I'm new to this field, I want to plot color-coded map of world leader's age.

I want to know how many countries are included in R program? I've looked into the documentation of rworldmap but unfortunately I cant get any list of countries. How can I find this out?

Jan 7 in Data Analytics by Sophie may
• 9,250 points
40 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

In the structure of the value returned by the getMap function, it appears that column "NAME" stores the name of an area in the map while "SOVEREIGNT" is the name of the corresponding sovereign state.

Follow this code to extract the unique values in both columns:

library(rworldmap)
world_map <- getMap()
areas <- levels(world_map[["NAME"]])
sovereign_states <- levels(world_map[["SOVEREIGNT"]])
answered Jan 7 by Tyrion anex
• 8,280 points

Related Questions In Data Analytics

0 votes
1 answer

Changing the order of bars in a bar-plot - ggplot2 - R

You can use the scale_x_discrete() function with ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
1,541 views
0 votes
1 answer

Showing percentage instead of counts in a bar plot - ggplot2 - R

Load the 'scales' package first, which gives ...READ MORE

answered May 28, 2018 in Data Analytics by Bharani
• 4,550 points
950 views
0 votes
1 answer

“subscript out of bounds” Error in r programming

This error is likely to occur when ...READ MORE

answered Oct 31, 2018 in Data Analytics by Kalgi
• 36,220 points
743 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How do I modify the background grid in ggplot?

You can use the function called background_grid().  This ...READ MORE

answered Dec 6, 2018 in Data Analytics by Maverick
• 10,020 points
34 views
0 votes
1 answer

I'm trying to start rattle on R Studio and end up with an error

You need the package RGtk2 for rattle to ...READ MORE

answered Nov 26, 2018 in Data Analytics by Maverick
• 10,020 points
177 views
0 votes
1 answer

Error saying "could not find function "shinyUI"" in shiny R

Its a small spelling mistake that you've ...READ MORE

answered Nov 28, 2018 in Data Analytics by Maverick
• 10,020 points
273 views
0 votes
1 answer

How to change the value of a variable using R programming in a data frame?

Try this: df$symbol <- as.character(df$symbol) df$symbol[df$symb ...READ MORE

answered Jan 11 in Data Analytics by Tyrion anex
• 8,280 points
55 views
0 votes
1 answer

R programming: How to subset data and plot graphs in R?

You can create a grouping variable depending ...READ MORE

answered Feb 18 in Data Analytics by Tyrion anex
• 8,280 points
43 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.