Make a data frame
From The World Factbook construct a data frame in which units (rows) are world countries with names from the “book” and variables (columns):
For visual inspection the additional variable region (North America, Central America, South America, Europe, Africa, Middle East, Central Asia, South Asia, East & Southeast Asia, Australia & Oceania, Antarctica) would be very useful - it can be constructed from the map on the entry page and region's countries lists on the next level.
n | student | V2 | V3 | V4 |
---|---|---|---|---|
1 | Софья Кошовец | Total area | Railways total | Roadways total |
2 | Чавушлу Мехмет Атакан | Population | Annual air passengers | # of airports |
3 | Хексаас Тор Андерс Гонзалес | Per_capita_purchasing_power_parity - global_rank | Industrial_production_growth_rate - annual_percentage_increase | Military expenditure – global Rank |
4 | Alexandra Eremenko | Population | Telephones - mobile cellular | Internet users |
5 | Leo Reichardt | Per capita purchasing power parity | Real growth rate | Percentage of the population having access to the internet |
6 | Sofia Tkachenko | GDP per capita | Population growth rate | Net migration rate |
7 | Rakib Hassan Pran | total of population | physicians_per_1000_population | beds_per_1000_population |
8 | Динара Хайруллина | Population | Military expenses | GDP |
9 | ||||
10 | ||||
11 | ||||
12 | ||||
13 |
Save the created data frame as a CSV file.
Explore the collected data. For visualization on a map see Maps or rworldmap.
Write a report in Word or PDF. Put the report and CSV file into a ZIP file and send it to me.
> library(jsonlite) > J <- fromJSON(readLines("factbook.json")) > str(J,max.level=2) > J$countries[[4]]$data$name [1] "Albania" > J$countries$albania$data$name [1] "Albania" > names(J$countries) > names(J$countries$albania$data)