From e2aac0fa282dd89ce709c5ab872aa570084b52e9 Mon Sep 17 00:00:00 2001 From: Yiming Li Date: Thu, 31 Mar 2022 11:55:13 -0700 Subject: [PATCH] community contribution --- plotly_package_graph_tutorial.Rmd | 318 +++++++++++++++++++++++++ resources/dataset/worldometer_data.csv | 210 ++++++++++++++++ 2 files changed, 528 insertions(+) create mode 100644 plotly_package_graph_tutorial.Rmd create mode 100644 resources/dataset/worldometer_data.csv diff --git a/plotly_package_graph_tutorial.Rmd b/plotly_package_graph_tutorial.Rmd new file mode 100644 index 0000000..3c59573 --- /dev/null +++ b/plotly_package_graph_tutorial.Rmd @@ -0,0 +1,318 @@ +# Plotly package tutorial + +Fan Wu and Yiming Li + +```{r, include=FALSE} +knitr::opts_chunk$set(warning = FALSE, message = FALSE) +``` + +```{r} +library(plotly) +``` + +## Abstract: + +In this community contribution project, we are going to introduce the Plotly package. Plotly is a data visualization tool just like ggplot2 and base R graphics, which we are pretty familiar with.But it extends the functionality of ggplot2 package by creating more engaging and visually appealing data models, and it also has more advanced features that ggplot2 does not have.

+ + +#### Usage + +
Supported visual formats: + +**-Basic Charts:** Scatter and Line Plots,Bar Charts,Pie Charts etc. + +**-Statistical Charts:** Histograms,Box Plots etc. + +**-Scientific Charts:** Contour Plots,Heatmaps,Network Graphs etc. + +**-Financial Charts:** Time Series and Date Axes,Candlestick Charts,OHLC Charts etc. + +**-Maps:** Choropleth Maps,Mapbox Density,Lines on Maps etc. + +**-Animations** + +
+ +#### Pros and Cons of Plotly + +
**Pros:** + +1.Binding to popular languages like Python,R,Node etc. + +2.Powerful out-of-the-box featureset + +3.Integrated zoom and filter-out tools in charts and maps. + +4.Beautiful visualizations. + +**Cons:** + +1.The number of color palettes is limited. + +2.Everyone can view them because plotly is public. + +
+ +#### Examples of Usage + +
+ +In this section, we will show some graphic examples using plotly package. The main dataset used is mtcars in R. + +##### Scatter Plot + +Scatter plot is a basic plot to show dependency relationship between two continuous variables. If you find a particular pattern between the two variables, you can make further analysis by building models, etc. Besides, you can see outliers and distributional features in scatter plot. + +```{r} + +scatter1 <- plot_ly(data = mtcars, x = ~disp, y = ~mpg, type = "scatter", mode = 'markers') +scatter1 <-scatter1 %>% layout(xaxis = list(title = "\n Displacement"), + yaxis = list(title = "Miles/(US) gallon \n"), + title = "Scatterplot \n") + +scatter1 +``` + + +You can make more advanced scatter plot by changing the style and add qualitative colorscales. + +You can change the size and color of the points: + +```{r} +scatter2 <- plot_ly(data = mtcars, x = ~disp, y = ~mpg, type = "scatter", marker = list(size = 11, + color = "red" +)) %>% + layout(xaxis = list(title = "\n Displacement"), + yaxis = list(title = "Miles/(US) gallon \n"), + title = "Scatterplot (red larger point)\n") + +scatter2 +``` + +Also, you can show the distribution of different groups by using color to see if there is any difference. In this eample, you can see the green group(gear number equals 3) is distributed on the right side while the orange group(gear number equals 4) is distributed on the left side. + + +```{r} +scatter3 <- plot_ly(data = mtcars, x = ~disp, y = ~mpg, type = "scatter", color = ~factor(gear)) %>% + layout(xaxis = list(title = "\n Displacement"), + yaxis = list(title = "Miles/(US) gallon \n"), + title = "Scatterplot by gear number \n") + +scatter3 +``` + +##### Line PLot + +Line plot is like scatter plot but uses a line to display data. We can see the changes of data over time. + +We generate 200 standard normal random variables and plot the result. + +```{r} +line_x <- c(1:200) +line_y <- rnorm(200) +line_plot <- data.frame(line_x, line_y) + +line <- plot_ly(line_plot, x = ~line_x, y = ~line_y, type = 'scatter', mode = 'lines') + +line +``` + +##### Bar Chart + +A bar chart is used to show a distribution of a variable or display a comparison of different groups in the data. You can use it on categorical variables. + +```{r} +bar1 <- plot_ly(data = mtcars, x = ~factor(gear), y = ~disp, type = 'bar', color = I("black")) %>% + layout(title = "displacement by gear number", + xaxis = list(title = "gear number"), + yaxis = list(title = "displacement")) + +bar1 +``` + + +It can also displayed horizontally. You can use the horizontal version when there are a lot of data(bars) as it can present in a more clear way. + +```{r} +bar2 <- plot_ly(data = mtcars, x = ~disp, y = ~factor(gear), type = 'bar', orientation = "h", color = "red") %>% + layout(title = "displacement by gear number", + xaxis = list(title = "displacement"), + yaxis = list(title = "gear number")) + +bar2 +``` + + +##### Pie Chart + +Pie chart can be used to show percentage of a variable. The exact percentages are shown in the graph so you can distiguish the distribution. + + +```{r} +pie <- plot_ly(data = mtcars, labels = ~gear, values = ~disp, type = 'pie') %>% + layout(title = "displacement by gear number", + xaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE), + yaxis = list(showgrid = FALSE, zeroline = FALSE, showticklabels = FALSE)) + +pie +``` + +##### Histogram + +Histogram is used to summarize a variable by showing the frequency distribution. +You can use it on both continuous variables and categorical variables. + +```{r} +hist_x <- rnorm(1000) +hist1 <- plot_ly(x = hist_x, type = "histogram") + +hist1 +``` + +Adding the density line: In this example we find it is close to normal distribution. + +```{r} +hist_fit <- density(hist_x) + +hist2 <- plot_ly(x = ~hist_x, type = "histogram", name = "Histogram with density line") %>% + add_trace(x = hist_fit$x, y = hist_fit$y, mode = "lines", type = 'scatter', fill = "tozeroy", yaxis = "y2", name = "Density LIne") %>% + layout(yaxis2 = list(overlaying = "y", side = "right")) + +hist2 +``` + +We can also specify the bin in histogram. + +```{r} +hist3 <- plot_ly(data = mtcars, x = ~factor(gear), type = "histogram") %>% + layout(xaxis = list(title = "\n gear number", + yaxis=list(type='linear'))) + +hist3 +``` + +##### Boxplot + +Boxplot is a visual representation to show the statistical fvie numbers of a data including minimum, first quartile, median, third quartile, maximum.You can find the skewness and ourliers by using boxplot. + + +```{r} +box <- plot_ly(data = mtcars, y = ~mpg, color = ~factor(gear), type = "box")%>% + layout(xaxis = list(title = "\n gear number", + yaxis = list(title = "Miles/(US) gallon \n"), + title = "boxplot \n")) + +box +``` + + + + +##### Bubble Charts + +When we want to depict the relationship more than two variables, at least +three numerical variables, we can use bubble charts. One thing is different from scatter plot is that in a bubble chart, a third numeric field controls the size +of the data points. + +In this example, we are going to use the built-in dataset "mtcars". + +```{r} + +mtcars$cyl <-factor(mtcars$cyl, labels=c("4 cyl","6 cyl","8 cyl")) +#assign colors based on the factor variable cyl. + +bubbleplot<-plot_ly(mtcars, x=~wt, y=~mpg, size=~hp, color=~cyl, + type="scatter",mode="markers",marker=list(opacity=0.5, sizemode="diameter"), + text=~paste(row.names(mtcars),"
horsepower:",hp)) + + + +#size: column name to determine the size of the bubble +#opacity allows overlapping symbols to be visible, value=0~1, kind like alpha. +#"opacity" argument is better than "alpha" when everything is in a different color +#we prefer to use "alpha" when they are in the same color to adjust the transparency. +#text: sets the text on the hover labels. +#sizemode can be diameter or area. + +bubbleplot <-bubbleplot %>% layout(title ="Auto mileage by weight, horsepower, and number of cylinders", xaxis= list(title ="Weight"), yaxis =list(title ="Miles/gallon")) + +# use "%>%" to pipe from one section of plot attributes to another. +# code to generate the layout +#specifying the title,x-axis and y-axis + +bubbleplot +#show the plot + +``` + + +##### Map + +When we want to analyze and display the geographically related data and to see +the underlying patterns behind the data in the global range, we can create a map. + +In this example, we are going to use the COVID-19 dataset from Kaggle. + +https://www.kaggle.com/datasets/imdevskp/corona-virus-report?select=worldometer_data.csv + +```{r} + +cv.data <-read.csv("~/cc22spring/worldometer_data.csv") +cv.data <-read.csv("~/cc22spring/resources/dataset/worldometer_data.csv") +map<-plot_ly(data=cv.data, + type="choropleth", #change the graph type to get a map + locations =~Country.Region, + locationmode="country names", #specifies what labels to look for in our data + z=~TotalCases, #determine the color gradient based on how many cases of coronavirus have occured in each country + colors="Reds") + +map<-map %>% + layout(geo=list(scope="world"), #change the scope of map to the global level. + title="Total Coronavirus Cases across the globe ") +map #show the map + + +``` + +##### Heatmap + +Heatmap is a very good visualization tool when we got a very huge amount and +complex dataset, because in the heatmap, the color represents different values, +so it will be easier for us to make sense of the dataset. + +In this example, we are going to use a built-in dataset called volcano. + +```{r} +data("volcano") +plot_ly(z=~volcano, type='heatmap') +#create a heatmap by using the type='heatmap' argument + +``` + +##### 3D Scatter Plots + +If we want to build a 3d scatterplot, we will need a dataset with 3 numeric +variables, each of these three variables will be on each axis. + +In this example, we are going to use the built-in dataset iris. + +```{r} + +iris$Species <-factor(iris$Species) +plot_ly(data=iris,x=~Sepal.Length,y=~Sepal.Width, z=~Petal.Length, type="scatter3d", + mode="markers",size=~Petal.Length, color=~Species) + +#create a 3D scatter plots by using the type= "scatter3d" argument +``` + +##### References +1.https://plotly.com/r/bubble-charts/ + +2.https://plotly.com/r/ + +3.https://rpubs.com/RajveerMaharaul/631872 + +4.https://www.analyticsvidhya.com/blog/2017/01/beginners-guide-to-create-beautiful-interactive-data-visualizations-using-plotly-in-r-and-python/ + + + diff --git a/resources/dataset/worldometer_data.csv b/resources/dataset/worldometer_data.csv new file mode 100644 index 0000000..33eb825 --- /dev/null +++ b/resources/dataset/worldometer_data.csv @@ -0,0 +1,210 @@ +Country/Region,Continent,Population,TotalCases,NewCases,TotalDeaths,NewDeaths,TotalRecovered,NewRecovered,ActiveCases,"Serious,Critical",Tot Cases/1M pop,Deaths/1M pop,TotalTests,Tests/1M pop,WHO Region +USA,North America,331198130,5032179,,162804,,2576668,,2292707,18296,15194,492,63139605,190640,Americas +Brazil,South America,212710692,2917562,,98644,,2047660,,771258,8318,13716,464,13206188,62085,Americas +India,Asia,1381344997,2025409,,41638,,1377384,,606387,8944,1466,30,22149351,16035,South-EastAsia +Russia,Europe,145940924,871894,,14606,,676357,,180931,2300,5974,100,29716907,203623,Europe +South Africa,Africa,59381566,538184,,9604,,387316,,141264,539,9063,162,3149807,53044,Africa +Mexico,North America,129066160,462690,6590,50517,819,308848,4140,103325,3987,3585,391,1056915,8189,Americas +Peru,South America,33016319,455409,,20424,,310337,,124648,1426,13793,619,2493429,75521,Americas +Chile,South America,19132514,366671,,9889,,340168,,16614,1358,19165,517,1760615,92022,Americas +Colombia,South America,50936262,357710,,11939,,192355,,153416,1493,7023,234,1801835,35374,Americas +Spain,Europe,46756648,354530,,28500,,,,,617,7582,610,7064329,151087,Europe +Iran,Asia,84097623,320117,,17976,,277463,,24678,4156,3806,214,2612763,31068,EasternMediterranean +UK,Europe,67922029,308134,,46413,,,,,73,4537,683,17515234,257873,Europe +Saudi Arabia,Asia,34865919,284226,,3055,,247089,,34082,1915,8152,88,3635705,104277,EasternMediterranean +Pakistan,Asia,221295851,281863,,6035,,256058,,19770,809,1274,27,2058872,9304,EasternMediterranean +Bangladesh,Asia,164851401,249651,,3306,,143824,,102521,,1514,20,1225124,7432,South-EastAsia +Italy,Europe,60452568,249204,,35187,,201323,,12694,42,4122,582,7099713,117443,Europe +Turkey,Asia,84428331,237265,,5798,,220546,,10921,580,2810,69,5081802,60191,Europe +Argentina,South America,45236884,228195,,4251,,99852,,124092,1150,5044,94,794544,17564,Americas +Germany,Europe,83811260,215210,,9252,,196200,,9758,236,2568,110,8586648,102452,Europe +France,Europe,65288306,195633,,30312,,82460,,82861,384,2996,464,3992206,61147,Europe +Iraq,Asia,40306025,140603,,5161,,101025,,34417,517,3488,128,1092741,27111,EasternMediterranean +Philippines,Asia,109722719,119460,,2150,,66837,,50473,239,1089,20,1669996,15220,WesternPacific +Indonesia,Asia,273808365,118753,,5521,,75645,,37587,,434,20,1633156,5965,South-EastAsia +Canada,North America,37775022,118561,,8966,,103106,,6489,2263,3139,237,4319172,114339,Americas +Qatar,Asia,2807805,112092,,178,,108831,,3083,77,39922,63,511000,181993,EasternMediterranean +Kazakhstan,Asia,18798667,95942,,1058,,68871,,26013,221,5104,56,2163713,115099,Europe +Egypt,Africa,102516525,95006,,4951,,48898,,41157,41,927,48,135000,1317,EasternMediterranean +Ecuador,South America,17668824,90537,,5877,,71318,,13342,378,5124,333,258582,14635,Americas +Bolivia,South America,11688459,86423,1282,3465,80,27373,936,55585,71,7394,296,183583,15706,Americas +Sweden,Europe,10105596,81967,,5766,,,,,38,8111,571,863315,85429,Europe +Oman,Asia,5118446,80713,,492,,70910,,9311,177,15769,96,309212,60411,EasternMediterranean +Israel,Asia,9197590,79559,,576,,53427,,25556,358,8650,63,1872453,203581,Europe +Ukraine,Europe,43705858,76808,,1819,,42524,,32465,158,1757,42,1116641,25549,Europe +Dominican Republic,North America,10858648,76536,,1246,,40539,,34751,317,7048,115,281926,25963,Americas +Panama,North America,4321282,71418,,1574,,45658,,24186,161,16527,364,240995,55769,Americas +Belgium,Europe,11594739,71158,,9859,,17661,,43638,61,6137,850,1767120,152407,Europe +Kuwait,Asia,4276658,70045,,469,,61610,,7966,127,16378,110,522200,122105,EasternMediterranean +Belarus,Europe,9449001,68503,,580,,63756,,4167,,7250,61,1344303,142269,Europe +UAE,Asia,9902079,61845,,354,,55739,,5752,,6246,36,5262658,531470,EasternMediterranean +Romania,Europe,19224023,57895,,2566,,28992,,26337,458,3012,133,1319369,68631,Europe +Netherlands,Europe,17138756,56982,,6153,,,,,37,3325,359,1079860,63007,Europe +Singapore,Asia,5854932,54555,,27,,48031,,6497,,9318,5,1474372,251817,WesternPacific +Guatemala,North America,17946899,54339,,2119,,42070,,10150,5,3028,118,172712,9624,Americas +Portugal,Europe,10193593,52061,,1743,,37840,,12478,42,5107,171,1705474,167308,Europe +Poland,Europe,37842302,49515,,1774,,35642,,12099,72,1308,47,2374686,62752,Europe +Nigeria,Africa,206606300,45244,,930,,32430,,11884,7,219,5,306894,1485,Africa +Honduras,North America,9919704,45098,,1423,,6116,,37559,52,4546,143,109292,11018,Americas +Bahrain,Asia,1706669,42889,,156,,39945,,2788,41,25130,91,876700,513691,EasternMediterranean +Japan,Asia,126435859,42263,,1026,,28877,,12360,115,334,8,938739,7425,WesternPacific +Armenia,Asia,2963811,39819,,772,,31556,,7491,,13435,260,171600,57898,Europe +Ghana,Africa,31133483,39642,,199,,36384,,3059,7,1273,6,405817,13035,Africa +Kyrgyzstan,Asia,6534479,38659,,1447,,30099,,7113,24,5916,221,267718,40970,Europe +Afghanistan,Asia,39009447,36896,,1298,,25840,,9758,31,946,33,90396,2317,EasternMediterranean +Switzerland,Europe,8660952,36108,,1985,,31600,,2523,23,4169,229,822764,94997,Europe +Algeria,Africa,43926079,33626,,1273,,23238,,9115,57,766,29,,,Africa +Azerbaijan,Asia,10148243,33247,,479,,29275,,3493,66,3276,47,766179,75499,Europe +Morocco,Africa,36953359,29644,,449,,20553,,8642,31,802,12,1383816,37448,EasternMediterranean +Uzbekistan,Asia,33516027,28315,,175,,19291,,8849,228,845,5,1377915,41112,Europe +Serbia,Europe,8733665,27332,,621,,14047,,12664,120,3129,71,723137,82799,Europe +Moldova,Europe,4032983,26628,,828,,18676,,7124,362,6603,205,128076,31757,Europe +Ireland,Europe,4943200,26372,,1768,,23364,,1240,5,5335,358,652917,132084,Europe +Kenya,Africa,53881160,24411,,399,,10444,,13568,44,453,7,335318,6223,Africa +Venezuela,South America,28427499,22299,,195,,12146,,9958,42,784,7,1567431,55138,Americas +Nepal,Asia,29186486,21750,,65,,15389,,6296,,745,2,731977,25079,South-EastAsia +Austria,Europe,9011577,21696,,719,,19596,,1381,25,2408,80,937275,104008,Europe +Costa Rica,North America,5098730,21070,,200,,7038,,13832,103,4132,39,96110,18850,Americas +Ethiopia,Africa,115223736,20900,,365,,9027,,11508,185,181,3,468814,4069,Africa +Australia,Australia/Oceania,25528864,19890,,255,,10941,,8694,52,779,10,4631419,181419,WesternPacific +El Salvador,North America,6489514,19126,,513,,9236,,9377,509,2947,79,251271,38720,Americas +Czechia,Europe,10711019,17731,,390,,12320,,5021,17,1655,36,728670,68030,Europe +Cameroon,Africa,26606188,17718,,391,,15320,,2007,30,666,15,149000,5600,Africa +Ivory Coast,Africa,26437950,16447,,103,,12484,,3860,,622,4,104584,3956,Africa +S. Korea,Asia,51273732,14519,20,303,1,13543,42,673,18,283,6,1613652,31471,WesternPacific +Denmark,Europe,5794279,14306,,617,,12787,,902,2,2469,106,1654512,285542,Europe +Palestine,Asia,5112340,13398,,92,,6907,,6399,,2621,18,200280,39176,EasternMediterranean +Bosnia and Herzegovina,Europe,3278650,13396,,384,,7042,,5970,,4086,117,147021,44842,Europe +Bulgaria,Europe,6942854,13014,,435,,7374,,5205,47,1874,63,294087,42358,Europe +Madagascar,Africa,27755708,12526,,134,,10148,,2244,88,451,5,46301,1668,Africa +Sudan,Africa,43943536,11780,,763,,6194,,4823,,268,17,401,9,EasternMediterranean +North Macedonia,Europe,2083365,11399,,517,,7480,,3402,3,5471,248,109946,52773,Europe +Senegal,Africa,16783877,10715,,223,,7101,,3391,33,638,13,114761,6838,Africa +Norway,Europe,5425471,9468,,256,,8857,,355,3,1745,47,472841,87152,Europe +DRC,Africa,89802183,9309,,215,,8048,,1046,,104,2,,,Africa +Malaysia,Asia,32406372,9038,,125,,8713,,200,2,279,4,991333,30591,WesternPacific +French Guiana,South America,299385,8127,,47,,7240,,840,23,27146,157,41412,138324, +Gabon,Africa,2230563,7787,,51,,5609,,2127,11,3491,23,85369,38272,Africa +Tajikistan,Asia,9557468,7665,,62,,6443,,1160,,802,6,,,Europe +Guinea,Africa,13164905,7664,,49,,6757,,858,24,582,4,14407,1094,Africa +Haiti,North America,11416103,7544,,171,,4832,,2541,,661,15,18443,1616,Americas +Finland,Europe,5541604,7532,,331,,6980,,221,,1359,60,389500,70287,Europe +Zambia,Africa,18430129,7164,,199,,5786,,1179,,389,11,90307,4900,Africa +Luxembourg,Europe,626952,7073,,119,,5750,,1204,9,11282,190,623994,995282,Europe +Mauritania,Africa,4660728,6444,,157,,5291,,996,3,1383,34,57387,12313,Africa +Paraguay,South America,7141091,6375,,66,,4974,,1335,23,893,9,135277,18943,Americas +Albania,Europe,2877470,6016,,188,,3155,,2673,23,2091,65,38997,13553,Europe +Lebanon,Asia,6822220,5672,,70,,1974,,3628,46,831,10,345268,50609,EasternMediterranean +Croatia,Europe,4102577,5404,,155,,4688,,561,7,1317,38,125317,30546,Europe +Djibouti,Africa,989387,5330,,59,,5057,,214,,5387,60,59909,60552,EasternMediterranean +Greece,Europe,10417673,5123,,210,,1374,,3539,14,492,20,619393,59456,Europe +Libya,Africa,6880353,4879,,107,,652,,4120,,709,16,59699,8677,EasternMediterranean +Equatorial Guinea,Africa,1407001,4821,,83,,2182,,2556,,3426,59,44356,31525,Africa +Maldives,Asia,541448,4680,,19,,2725,,1936,12,8643,35,85587,158071,South-EastAsia +CAR,Africa,4837752,4620,,59,,1641,,2920,2,955,12,29589,6116, +Hungary,Europe,9657785,4597,,600,,3463,,534,8,476,62,352546,36504,Europe +Malawi,Africa,19174839,4491,,137,,2137,,2217,4,234,7,33466,1745,Africa +Zimbabwe,Africa,14883803,4339,,84,,1264,,2991,,292,6,140421,9434,Africa +Nicaragua,North America,6632263,3902,,123,,2913,,866,,588,19,,,Americas +Hong Kong,Asia,7503041,3850,,46,,2458,,1346,39,513,6,692430,92287,WesternPacific +Congo,Africa,5530506,3546,,58,,1589,,1899,,641,10,,,Africa +Montenegro,Europe,628074,3480,,60,,2178,,1242,,5541,96,38427,61182,Europe +Thailand,Asia,69817894,3330,,58,,3148,,124,1,48,0.8,749213,10731,South-EastAsia +Somalia,Africa,15933012,3227,,93,,1728,,1406,2,203,6,,,EasternMediterranean +Mayotte,Africa,273419,3042,,39,,2738,,265,2,11126,143,13000,47546, +Eswatini,Africa,1161348,2968,,55,,1476,,1437,5,2556,47,20784,17896,Africa +Sri Lanka,Asia,21422362,2839,,11,,2541,,287,1,133,0.5,166737,7783,South-EastAsia +Cuba,North America,11325899,2775,,88,,2409,,278,4,245,8,285471,25205,Americas +Cabo Verde,Africa,556581,2734,,27,,2010,,697,,4912,49,61633,110735,Africa +Namibia,Africa,2545264,2652,,15,,563,,2074,24,1042,6,29233,11485,Africa +Mali,Africa,20302901,2552,,124,,1954,,474,,126,6,25152,1239,Africa +Slovakia,Europe,5459915,2480,,29,,1824,,627,2,454,5,272322,49877,Europe +South Sudan,Africa,11206572,2450,,47,,1175,,1228,,219,4,12044,1075,Africa +Slovenia,Europe,2078968,2223,,125,,1909,,189,2,1069,60,135702,65274,Europe +Lithuania,Europe,2718121,2171,,81,,1656,,434,6,799,30,540784,198955,Europe +Estonia,Europe,1326627,2124,,63,,1954,,107,,1601,47,122880,92626,Europe +Mozambique,Africa,31333962,2120,,15,,795,,1310,,68,0.5,65151,2079,Africa +Rwanda,Africa,12981546,2111,,5,,1258,,848,,163,0.4,286251,22051,Africa +Suriname,South America,587154,2096,,29,,1446,,621,9,3570,49,2785,4743,Americas +Guinea-Bissau,Africa,1972277,2032,,27,,944,,1061,5,1030,14,1500,761,Africa +Benin,Africa,12151976,1936,,38,,1600,,298,1,159,3,93677,7709,Africa +Iceland,Europe,341465,1930,,10,,1825,,95,,5652,29,149693,438385,Europe +Sierra Leone,Africa,7992169,1877,,67,,1427,,383,,235,8,,,Africa +Yemen,Asia,29886897,1768,,508,,898,,362,,59,17,120,4,EasternMediterranean +Tunisia,Africa,11830801,1642,,51,,1241,,350,9,139,4,100298,8478,EasternMediterranean +New Zealand,Australia/Oceania,5002100,1569,,22,,1524,,23,,314,4,486943,97348,WesternPacific +Angola,Africa,32956300,1483,,64,,520,,899,20,45,2,64747,1965,Africa +Uruguay,South America,3474956,1318,,37,,1079,,202,2,379,11,126956,36535,Americas +Latvia,Europe,1883936,1275,,32,,1070,,173,,677,17,207909,110359,Europe +Jordan,Asia,10213138,1232,,11,,1171,,50,3,121,1,628745,61562,EasternMediterranean +Liberia,Africa,5068618,1224,,78,,705,,441,,241,15,,,Africa +Uganda,Africa,45867852,1223,,5,,1102,,116,,27,0.1,288367,6287,Africa +Cyprus,Asia,1208238,1208,,19,,856,,333,,1000,16,216597,179267,Europe +Georgia,Asia,3988368,1206,,17,,987,,202,,302,4,240473,60294,Europe +Burkina Faso,Africa,20954852,1158,,54,,961,,143,,55,3,,,Africa +Niger,Africa,24281433,1153,,69,,1057,,27,,47,3,9052,373,Africa +Togo,Africa,8296582,1012,,22,,697,,293,2,122,3,45767,5516,Africa +Syria,Asia,17539600,999,,48,,311,,640,,57,3,,,EasternMediterranean +Jamaica,North America,2962478,958,30,12,,745,,201,,323,4,41840,14123,Americas +Malta,Europe,441663,946,,9,,670,,267,,2142,20,136713,309541,Europe +Andorra,Europe,77278,944,,52,,828,,64,1,12216,673,3750,48526,Europe +Chad,Africa,16467965,942,,76,,838,,28,,57,5,,,Africa +Gambia,Africa,2422754,935,,16,,136,,783,,386,7,5183,2139,Africa +Sao Tome and Principe,Africa,219544,878,,15,,797,,66,,3999,68,3079,14025,Africa +Botswana,Africa,2356075,804,,2,,63,,739,1,341,0.8,68423,29041,Africa +Bahamas,North America,393616,761,,14,,91,,656,1,1933,36,4814,12230,Americas +Vietnam,Asia,97425470,747,,10,,392,,345,,8,0.1,482456,4952,WesternPacific +Lesotho,Africa,2143943,742,,23,,175,,544,,346,11,8771,4091,Africa +Diamond Princess,,,712,,13,,651,,48,4,,,,, +San Marino,Europe,33938,699,,42,,657,,0,,20596,1238,6068,178797,Europe +Réunion,Africa,895952,671,,5,,592,,74,3,749,6,35419,39532, +Channel Islands,Europe,174022,597,,47,,533,,17,,3431,270,30721,176535, +Guyana,South America,786936,538,,22,,189,,327,2,684,28,5165,6563,Americas +Tanzania,Africa,59886383,509,,21,,183,,305,7,8,0.4,,,Africa +Taiwan,Asia,23821199,477,,7,,443,,27,,20,0.3,82737,3473,WesternPacific +Comoros,Africa,871326,396,,7,,340,,49,,454,8,,,Africa +Burundi,Africa,11922216,395,,1,,304,,90,,33,0.08,15614,1310,Africa +Myanmar,Asia,54446389,357,,6,,308,,43,,7,0.1,122290,2246,South-EastAsia +Mauritius,Africa,1271985,344,,10,,334,,0,,270,8,205285,161389,Africa +Isle of Man,Europe,85078,336,,24,,312,,0,,3949,282,8627,101401, +Mongolia,Asia,3283344,293,,,,260,,33,1,89,,38334,11675,WesternPacific +Eritrea,Africa,3551175,282,,,,225,,57,,79,,,,Africa +Guadeloupe,North America,400131,279,,14,,179,,86,,697,35,18476,46175, +Martinique,North America,375235,276,,15,,98,,163,1,736,40,12227,32585, +Faeroe Islands,Europe,48882,266,,,,192,,74,1,5442,,43045,880590, +Aruba,North America,106812,263,,3,,114,,146,,2462,28,14047,131511, +Cambodia,Asia,16741375,243,,,,210,,33,1,15,,67807,4050,WesternPacific +Trinidad and Tobago,North America,1399950,210,,8,,135,,67,,150,6,9559,6828,Americas +Cayman Islands,North America,65798,203,,1,,202,,0,,3085,15,31108,472780, +Gibraltar,Europe,33690,190,,,,184,,6,,5640,,23063,684565, +Papua New Guinea,Australia/Oceania,8963009,163,,3,,53,,107,,18,0.3,10808,1206,WesternPacific +Sint Maarten,North America,42924,160,,16,,64,,80,3,3728,373,1115,25976, +Bermuda,North America,62254,157,,9,,144,,4,,2522,145,26352,423298,Americas +Brunei ,Asia,437893,141,,3,,138,,0,,322,7,41148,93968, +Barbados,North America,287411,133,,7,,100,,26,,463,24,12233,42563,Americas +Turks and Caicos,North America,38768,129,,2,,39,,88,3,3327,52,1252,32295, +Seychelles,Africa,98408,126,,,,124,,2,,1280,,,,Africa +Monaco,Europe,39270,125,,4,,105,,16,2,3183,102,38209,972982,Europe +Bhutan,Asia,772443,105,,,,93,,12,,136,,54589,70671,South-EastAsia +Antigua and Barbuda,North America,98010,92,,3,,76,,13,1,939,31,1500,15305,Americas +Liechtenstein,Europe,38139,89,,1,,85,,3,,2334,26,900,23598,Europe +Belize,North America,398312,86,,2,,31,,53,2,216,5,3679,9236,Americas +French Polynesia,Australia/Oceania,281072,64,,,,62,,2,,228,,5849,20810, +St. Vincent Grenadines,North America,110976,56,,,,46,,10,,505,,2447,22050, +Saint Martin,North America,38729,53,,3,,41,,9,1,1368,77,1183,30546, +Macao,Asia,650193,46,,,,46,,0,,71,,4071,6261, +Curaçao,North America,164161,31,,1,,28,,2,,189,6,1080,6579, +Fiji,Australia/Oceania,897095,27,,1,,18,,8,,30,1,6693,7461,WesternPacific +Saint Lucia,North America,183712,25,,,,24,,1,,136,,3895,21202,Americas +Timor-Leste,Asia,1320812,25,,,,24,,1,,19,,4238,3209,South-EastAsia +Grenada,North America,112576,24,,,,23,,1,,213,,6252,55536,Americas +New Caledonia,Australia/Oceania,285769,22,,,,22,,0,,77,,11099,38839, +Laos,Asia,7285750,20,,,,19,,1,,3,,29374,4032,WesternPacific +Dominica,North America,72004,18,,,,18,,0,,250,,1005,13958,Americas +Saint Kitts and Nevis,North America,53237,17,,,,16,,1,,319,,1146,21526,Americas +Greenland,North America,56780,14,,,,14,,0,,247,,5977,105266,Europe +Montserrat,North America,4992,13,,1,,10,,2,,2604,200,61,12220, +Caribbean Netherlands,North America,26247,13,,,,7,,6,,495,,424,16154, +Falkland Islands,South America,3489,13,,,,13,,0,,3726,,1816,520493, +Vatican City,Europe,801,12,,,,12,,0,,14981,,,,Europe +Western Sahara,Africa,598682,10,,1,,8,,1,,17,2,,,Africa