opendatascience.com
Open in
urlscan Pro
35.212.36.151
Public Scan
URL:
https://opendatascience.com/unhcr-refugee-data-visualized/
Submission: On November 29 via api from US — Scanned from DE
Submission: On November 29 via api from US — Scanned from DE
Form analysis
4 forms found in the DOMGET https://opendatascience.com/
<form method="get" action="https://opendatascience.com/">
<input type="text" name="s" class="form-control" placeholder="search here">
</form>
GET https://opendatascience.com/
<form role="search" method="get" id="searchform" action="https://opendatascience.com/"><input style="width:70px;" type="text" value="Search" name="s" id="s"><input type="submit" id="searchsubmit" value="Search"></form>
GET /
<form role="search" method="get" id="searchformmobile" action="/"><input style="width:70px;" type="text" value="" name="s" id="s" placeholder="keywords"><input type="submit" id="searchsubmit" value="Search"></form>
POST https://forms.hsforms.com/submissions/v3/public/submit/formsnext/multipart/1865444/2db28ac9-d988-42c8-bf91-29f8f7fcfac1
<form id="hsForm_2db28ac9-d988-42c8-bf91-29f8f7fcfac1" method="POST" accept-charset="UTF-8" enctype="multipart/form-data" novalidate=""
action="https://forms.hsforms.com/submissions/v3/public/submit/formsnext/multipart/1865444/2db28ac9-d988-42c8-bf91-29f8f7fcfac1"
class="hs-form-private hsForm_2db28ac9-d988-42c8-bf91-29f8f7fcfac1 hs-form-2db28ac9-d988-42c8-bf91-29f8f7fcfac1 hs-form-2db28ac9-d988-42c8-bf91-29f8f7fcfac1_53b061f9-c9eb-44f2-80a1-019d1e133103 hs-form stacked hs-custom-style"
target="target_iframe_2db28ac9-d988-42c8-bf91-29f8f7fcfac1" data-instance-id="53b061f9-c9eb-44f2-80a1-019d1e133103" data-form-id="2db28ac9-d988-42c8-bf91-29f8f7fcfac1" data-portal-id="1865444"
data-test-id="hsForm_2db28ac9-d988-42c8-bf91-29f8f7fcfac1">
<div>
<div class="hs-richtext hs-main-font-element">
<h5><span style="color: #000000;">Stay connected! Get curated newsletters every week</span></h5>
</div>
<div class="hs_firstname hs-firstname hs-fieldtype-text field hs-form-field"><label id="label-firstname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="" placeholder="Enter your First Name*"
for="firstname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1"><span>First Name*</span><span class="hs-form-required">*</span></label>
<legend class="hs-field-desc" style="display: none;"></legend>
<div class="input"><input id="firstname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" name="firstname" required="" placeholder="Name" type="text" class="hs-input" inputmode="text" autocomplete="given-name" value=""></div>
</div>
</div>
<div class="hs_lastname hs-lastname hs-fieldtype-text field hs-form-field"><label id="label-lastname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="" placeholder="Enter your Last name*" for="lastname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1"><span>Last
name*</span></label>
<legend class="hs-field-desc" style="display: none;"></legend>
<div class="input"><input id="lastname-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" name="lastname" placeholder="" type="text" class="hs-input" inputmode="text" autocomplete="family-name" value=""></div>
</div>
<div class="hs_email hs-email hs-fieldtype-text field hs-form-field"><label id="label-email-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="" placeholder="Enter your Email*" for="email-2db28ac9-d988-42c8-bf91-29f8f7fcfac1"><span>Email*</span></label>
<legend class="hs-field-desc" style="display: none;"></legend>
<div class="input"><input id="email-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" name="email" placeholder="Email Address" type="email" class="hs-input" inputmode="email" autocomplete="email" value=""></div>
</div>
<div class="hs_country hs-country hs-fieldtype-select field hs-form-field"><label id="label-country-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="" placeholder="Enter your Country/Region"
for="country-2db28ac9-d988-42c8-bf91-29f8f7fcfac1"><span>Country/Region</span></label>
<legend class="hs-field-desc" style="display: none;"></legend>
<div class="input"><select id="country-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="hs-input is-placeholder" name="country">
<option disabled="" value="">Please Select</option>
<option value="Afghanistan">Afghanistan</option>
<option value="Åland Islands">Åland Islands</option>
<option value="Albania">Albania</option>
<option value="Algeria">Algeria</option>
<option value="American Samoa">American Samoa</option>
<option value="Andorra">Andorra</option>
<option value="Angola">Angola</option>
<option value="Anguilla">Anguilla</option>
<option value="Antarctica">Antarctica</option>
<option value="Antigua and Barbuda">Antigua and Barbuda</option>
<option value="Argentina">Argentina</option>
<option value="Armenia">Armenia</option>
<option value="Aruba">Aruba</option>
<option value="Asia/Pacific Region">Asia/Pacific Region</option>
<option value="Australia">Australia</option>
<option value="Austria">Austria</option>
<option value="Azerbaijan">Azerbaijan</option>
<option value="Bahamas">Bahamas</option>
<option value="Bahrain">Bahrain</option>
<option value="Bangladesh">Bangladesh</option>
<option value="Barbados">Barbados</option>
<option value="Belarus">Belarus</option>
<option value="Belgium">Belgium</option>
<option value="Belize">Belize</option>
<option value="Benin">Benin</option>
<option value="Bermuda">Bermuda</option>
<option value="Bhutan">Bhutan</option>
<option value="Bolivia">Bolivia</option>
<option value="Bosnia and Herzegovina">Bosnia and Herzegovina</option>
<option value="Botswana">Botswana</option>
<option value="Bouvet Island">Bouvet Island</option>
<option value="Brazil">Brazil</option>
<option value="British Indian Ocean Territory">British Indian Ocean Territory</option>
<option value="British Virgin Islands">British Virgin Islands</option>
<option value="Brunei">Brunei</option>
<option value="Bulgaria">Bulgaria</option>
<option value="Burkina Faso">Burkina Faso</option>
<option value="Burundi">Burundi</option>
<option value="Cambodia">Cambodia</option>
<option value="Cameroon">Cameroon</option>
<option value="Canada">Canada</option>
<option value="Cape Verde">Cape Verde</option>
<option value="Caribbean Netherlands">Caribbean Netherlands</option>
<option value="Cayman Islands">Cayman Islands</option>
<option value="Central African Republic">Central African Republic</option>
<option value="Chad">Chad</option>
<option value="Chile">Chile</option>
<option value="China">China</option>
<option value="Christmas Island">Christmas Island</option>
<option value="Cocos (Keeling) Islands">Cocos (Keeling) Islands</option>
<option value="Colombia">Colombia</option>
<option value="Comoros">Comoros</option>
<option value="Congo">Congo</option>
<option value="Cook Islands">Cook Islands</option>
<option value="Costa Rica">Costa Rica</option>
<option value="Cote d'Ivoire">Cote d'Ivoire</option>
<option value="Croatia">Croatia</option>
<option value="Cuba">Cuba</option>
<option value="Curaçao">Curaçao</option>
<option value="Cyprus">Cyprus</option>
<option value="Czech Republic">Czech Republic</option>
<option value="Democratic Republic of the Congo">Democratic Republic of the Congo</option>
<option value="Denmark">Denmark</option>
<option value="Djibouti">Djibouti</option>
<option value="Dominica">Dominica</option>
<option value="Dominican Republic">Dominican Republic</option>
<option value="East Timor">East Timor</option>
<option value="Ecuador">Ecuador</option>
<option value="Egypt">Egypt</option>
<option value="El Salvador">El Salvador</option>
<option value="Equatorial Guinea">Equatorial Guinea</option>
<option value="Eritrea">Eritrea</option>
<option value="Estonia">Estonia</option>
<option value="Ethiopia">Ethiopia</option>
<option value="Europe">Europe</option>
<option value="Falkland Islands">Falkland Islands</option>
<option value="Faroe Islands">Faroe Islands</option>
<option value="Fiji">Fiji</option>
<option value="Finland">Finland</option>
<option value="France">France</option>
<option value="French Guiana">French Guiana</option>
<option value="French Polynesia">French Polynesia</option>
<option value="French Southern and Antarctic Lands">French Southern and Antarctic Lands</option>
<option value="Gabon">Gabon</option>
<option value="Gambia">Gambia</option>
<option value="Georgia">Georgia</option>
<option value="Germany">Germany</option>
<option value="Ghana">Ghana</option>
<option value="Gibraltar">Gibraltar</option>
<option value="Greece">Greece</option>
<option value="Greenland">Greenland</option>
<option value="Grenada">Grenada</option>
<option value="Guadeloupe">Guadeloupe</option>
<option value="Guam">Guam</option>
<option value="Guatemala">Guatemala</option>
<option value="Guernsey">Guernsey</option>
<option value="Guinea">Guinea</option>
<option value="Guinea-Bissau">Guinea-Bissau</option>
<option value="Guyana">Guyana</option>
<option value="Haiti">Haiti</option>
<option value="Heard Island and McDonald Islands">Heard Island and McDonald Islands</option>
<option value="Honduras">Honduras</option>
<option value="Hong Kong">Hong Kong</option>
<option value="Hungary">Hungary</option>
<option value="Iceland">Iceland</option>
<option value="India">India</option>
<option value="Indonesia">Indonesia</option>
<option value="Iran">Iran</option>
<option value="Iraq">Iraq</option>
<option value="Ireland">Ireland</option>
<option value="Isle of Man">Isle of Man</option>
<option value="Israel">Israel</option>
<option value="Italy">Italy</option>
<option value="Jamaica">Jamaica</option>
<option value="Japan">Japan</option>
<option value="Jersey">Jersey</option>
<option value="Jordan">Jordan</option>
<option value="Kazakhstan">Kazakhstan</option>
<option value="Kenya">Kenya</option>
<option value="Kiribati">Kiribati</option>
<option value="Kuwait">Kuwait</option>
<option value="Kyrgyzstan">Kyrgyzstan</option>
<option value="Laos">Laos</option>
<option value="Latvia">Latvia</option>
<option value="Lebanon">Lebanon</option>
<option value="Lesotho">Lesotho</option>
<option value="Liberia">Liberia</option>
<option value="Libya">Libya</option>
<option value="Liechtenstein">Liechtenstein</option>
<option value="Lithuania">Lithuania</option>
<option value="Luxembourg">Luxembourg</option>
<option value="Macau">Macau</option>
<option value="Macedonia (FYROM)">Macedonia (FYROM)</option>
<option value="Madagascar">Madagascar</option>
<option value="Malawi">Malawi</option>
<option value="Malaysia">Malaysia</option>
<option value="Maldives">Maldives</option>
<option value="Mali">Mali</option>
<option value="Malta">Malta</option>
<option value="Marshall Islands">Marshall Islands</option>
<option value="Martinique">Martinique</option>
<option value="Mauritania">Mauritania</option>
<option value="Mauritius">Mauritius</option>
<option value="Mayotte">Mayotte</option>
<option value="Mexico">Mexico</option>
<option value="Micronesia">Micronesia</option>
<option value="Moldova">Moldova</option>
<option value="Monaco">Monaco</option>
<option value="Mongolia">Mongolia</option>
<option value="Montenegro">Montenegro</option>
<option value="Montserrat">Montserrat</option>
<option value="Morocco">Morocco</option>
<option value="Mozambique">Mozambique</option>
<option value="Myanmar (Burma)">Myanmar (Burma)</option>
<option value="Namibia">Namibia</option>
<option value="Nauru">Nauru</option>
<option value="Nepal">Nepal</option>
<option value="Netherlands">Netherlands</option>
<option value="Netherlands Antilles">Netherlands Antilles</option>
<option value="New Caledonia">New Caledonia</option>
<option value="New Zealand">New Zealand</option>
<option value="Nicaragua">Nicaragua</option>
<option value="Niger">Niger</option>
<option value="Nigeria">Nigeria</option>
<option value="Niue">Niue</option>
<option value="Norfolk Island">Norfolk Island</option>
<option value="North Korea">North Korea</option>
<option value="Northern Mariana Islands">Northern Mariana Islands</option>
<option value="Norway">Norway</option>
<option value="Oman">Oman</option>
<option value="Pakistan">Pakistan</option>
<option value="Palau">Palau</option>
<option value="Palestine">Palestine</option>
<option value="Panama">Panama</option>
<option value="Papua New Guinea">Papua New Guinea</option>
<option value="Paraguay">Paraguay</option>
<option value="Peru">Peru</option>
<option value="Philippines">Philippines</option>
<option value="Pitcairn Islands">Pitcairn Islands</option>
<option value="Poland">Poland</option>
<option value="Portugal">Portugal</option>
<option value="Puerto Rico">Puerto Rico</option>
<option value="Qatar">Qatar</option>
<option value="Réunion">Réunion</option>
<option value="Romania">Romania</option>
<option value="Russia">Russia</option>
<option value="Rwanda">Rwanda</option>
<option value="Saint Barthélemy">Saint Barthélemy</option>
<option value="Saint Helena">Saint Helena</option>
<option value="Saint Kitts and Nevis">Saint Kitts and Nevis</option>
<option value="Saint Lucia">Saint Lucia</option>
<option value="Saint Martin">Saint Martin</option>
<option value="Saint Pierre and Miquelon">Saint Pierre and Miquelon</option>
<option value="Saint Vincent and the Grenadines">Saint Vincent and the Grenadines</option>
<option value="Samoa">Samoa</option>
<option value="San Marino">San Marino</option>
<option value="Sao Tome and Principe">Sao Tome and Principe</option>
<option value="Saudi Arabia">Saudi Arabia</option>
<option value="Senegal">Senegal</option>
<option value="Serbia">Serbia</option>
<option value="Seychelles">Seychelles</option>
<option value="Sierra Leone">Sierra Leone</option>
<option value="Singapore">Singapore</option>
<option value="Sint Maarten">Sint Maarten</option>
<option value="Slovakia">Slovakia</option>
<option value="Slovenia">Slovenia</option>
<option value="Solomon Islands">Solomon Islands</option>
<option value="Somalia">Somalia</option>
<option value="South Africa">South Africa</option>
<option value="South Georgia and the South Sandwich Islands">South Georgia and the South Sandwich Islands</option>
<option value="South Korea">South Korea</option>
<option value="South Sudan">South Sudan</option>
<option value="Spain">Spain</option>
<option value="Sri Lanka">Sri Lanka</option>
<option value="Sudan">Sudan</option>
<option value="Suriname">Suriname</option>
<option value="Svalbard and Jan Mayen">Svalbard and Jan Mayen</option>
<option value="Swaziland">Swaziland</option>
<option value="Sweden">Sweden</option>
<option value="Switzerland">Switzerland</option>
<option value="Syria">Syria</option>
<option value="Taiwan">Taiwan</option>
<option value="Tajikistan">Tajikistan</option>
<option value="Tanzania">Tanzania</option>
<option value="Thailand">Thailand</option>
<option value="Togo">Togo</option>
<option value="Tokelau">Tokelau</option>
<option value="Tonga">Tonga</option>
<option value="Trinidad and Tobago">Trinidad and Tobago</option>
<option value="Tunisia">Tunisia</option>
<option value="Turkey">Turkey</option>
<option value="Turkmenistan">Turkmenistan</option>
<option value="Turks and Caicos Islands">Turks and Caicos Islands</option>
<option value="Tuvalu">Tuvalu</option>
<option value="U.S. Virgin Islands">U.S. Virgin Islands</option>
<option value="Uganda">Uganda</option>
<option value="Ukraine">Ukraine</option>
<option value="United Arab Emirates">United Arab Emirates</option>
<option value="United Kingdom">United Kingdom</option>
<option value="United States">United States</option>
<option value="United States Minor Outlying Islands">United States Minor Outlying Islands</option>
<option value="Uruguay">Uruguay</option>
<option value="Uzbekistan">Uzbekistan</option>
<option value="Vanuatu">Vanuatu</option>
<option value="Vatican City">Vatican City</option>
<option value="Venezuela">Venezuela</option>
<option value="Vietnam">Vietnam</option>
<option value="Wallis and Futuna">Wallis and Futuna</option>
<option value="Western Sahara">Western Sahara</option>
<option value="Yemen">Yemen</option>
<option value="Zambia">Zambia</option>
<option value="Zimbabwe">Zimbabwe</option>
<option value="Myanmar">Myanmar</option>
</select></div>
</div>
<div class="hs_odsc_consent hs-odsc_consent hs-fieldtype-booleancheckbox field hs-form-field">
<legend class="hs-field-desc" style="display: block;">From time to time, we'd like to contact you with other related content and offers. You may unsubscribe at any time.
<a href="https://opendatascience.com/odsc-privacy-policy/" rel="noopener" target="_blank">Privacy Policy</a></legend>
<div class="input">
<ul class="inputs-list" required="">
<li class="hs-form-booleancheckbox"><label for="odsc_consent-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="hs-form-booleancheckbox-display"><input id="odsc_consent-2db28ac9-d988-42c8-bf91-29f8f7fcfac1" class="hs-input" type="checkbox"
name="odsc_consent" value="true"><span>I agree to receive communications from ODSC.<span class="hs-form-required">*</span></span></label></li>
</ul>
</div>
</div>
<div class="hs_submit hs-submit">
<div class="hs-field-desc" style="display: none;"></div>
<div class="actions"><input type="submit" class="hs-button primary large" value="Subscribe"></div>
</div><input name="hs_context" type="hidden"
value="{"embedAtTimestamp":"1732843067693","formDefinitionUpdatedAt":"1691830234115","lang":"en","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","pageTitle":"UNHCR Refugee Data Visualized - Open Data Science - Your News Source for AI, Machine Learning & more","pageUrl":"https://opendatascience.com/unhcr-refugee-data-visualized/","isHubSpotCmsGeneratedPage":false,"contentType":"blog-post","hutk":"1e98bbb393bef741007d21e1c894630c","__hsfp":930271884,"__hssc":"39712252.1.1732843069481","__hstc":"39712252.1e98bbb393bef741007d21e1c894630c.1732843069481.1732843069481.1732843069481.1","formTarget":"#hbspt-form-53b061f9-c9eb-44f2-80a1-019d1e133103","rumScriptExecuteTime":2053.199998855591,"rumTotalRequestTime":2601.6000003814697,"rumTotalRenderTime":2956.199998855591,"rumServiceResponseTime":548.4000015258789,"rumFormRenderTime":354.5999984741211,"connectionType":"4g","firstContentfulPaint":0,"largestContentfulPaint":0,"locale":"en","timestamp":1732843069596,"originalEmbedContext":{"portalId":"1865444","formId":"2db28ac9-d988-42c8-bf91-29f8f7fcfac1","region":"na1","target":"#hbspt-form-53b061f9-c9eb-44f2-80a1-019d1e133103","isBuilder":false,"isTestPage":false,"isPreview":false,"isMobileResponsive":true},"correlationId":"53b061f9-c9eb-44f2-80a1-019d1e133103","renderedFieldsIds":["firstname","lastname","email","country","odsc_consent"],"captchaStatus":"NOT_APPLICABLE","emailResubscribeStatus":"NOT_APPLICABLE","isInsideCrossOriginFrame":false,"source":"forms-embed-1.6227","sourceName":"forms-embed","sourceVersion":"1.6227","sourceVersionMajor":"1","sourceVersionMinor":"6227","allPageIds":{},"_debug_embedLogLines":[{"clientTimestamp":1732843067994,"level":"INFO","message":"Retrieved pageContext values which may be overriden by the embed context: {\"pageTitle\":\"UNHCR Refugee Data Visualized - Open Data Science - Your News Source for AI, Machine Learning & more\",\"pageUrl\":\"https://opendatascience.com/unhcr-refugee-data-visualized/\",\"userAgent\":\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36\",\"isHubSpotCmsGeneratedPage\":false}"},{"clientTimestamp":1732843068004,"level":"INFO","message":"Retrieved countryCode property from normalized embed definition response: \"DE\""},{"clientTimestamp":1732843069593,"level":"INFO","message":"Retrieved analytics values from API response which may be overriden by the embed context: {\"hutk\":\"1e98bbb393bef741007d21e1c894630c\",\"contentType\":\"blog-post\"}"}]}"><iframe
name="target_iframe_2db28ac9-d988-42c8-bf91-29f8f7fcfac1" style="display: none;"></iframe><input type="hidden" id="apbct_visible_fields_3" name="apbct_visible_fields"
value="eyIwIjp7InZpc2libGVfZmllbGRzIjoiZmlyc3RuYW1lIGxhc3RuYW1lIGVtYWlsIGNvdW50cnkiLCJ2aXNpYmxlX2ZpZWxkc19jb3VudCI6NCwiaW52aXNpYmxlX2ZpZWxkcyI6ImhzX2NvbnRleHQiLCJpbnZpc2libGVfZmllbGRzX2NvdW50IjoxfX0=">
</form>
Text Content
* * * * ODSC Conferences * ODSC EAST * ODSC WEST * ODSC EUROPE * ODSC APAC * MEETUPS * AI+ Training * Newsletter * Jobs * Speak at ODSC * * Modeling * Data Analytics * Data Engineering * Data Visualization * Deep Learning * Generative AI * Machine Learning * NLP and LLMs * Python * Business & Use Cases * Career Advice * Write for us * Community * ODSC Community Slack Channel * Meetups * Substack * Medium * Upcoming Webinars * Ai X Podcast * Apple * Spotify * SoundCloud * Training UNHCR REFUGEE DATA VISUALIZED Data VisualizationModelingposted by Eugene Joh December 24, 2017 Eugene Joh Where’s the Data? The data I’m using is taken from the United Nations High Commissioner for Refugees (UNHCR) website – the UN Refugee Agency. You... WHERE’S THE DATA? The data I’m using is taken from the United Nations High Commissioner for Refugees (UNHCR) website – the UN Refugee Agency. You can read more on what they do and why the exist in the link above. Currently you can only download the mid-year statistics for 2015. You get a statement saying: “Error: Statistics filters are not available at this time. Please try again later.” I just checked again and the data is accessible again! In this post I am not going to share my views on the current political landscape in the United States (that can be a complete separate blog on its own). Similar to my previous post, I’m going to do a walkthrough with data cleaning, ask a couple questions and visualize the data in some meaningful way. If you want to skip the details on the code, you can just scroll down to the figures. WORKING IN R As usual, all the code is in my GitHub repository for whoever wants to download and use it for themselves. For this post, I’m going to use the following packages ggplot, grid, scales, reshape2, scales and worldcloud. I was reading some R manuals and I discovered a “new” way to access your working directory environment. It involves the use of the list.files() function, which lists the files or folders in your current working directory. You can also further specify the path name (which saves the time of constantly changing the pathname in the setwd() function (which I have been foolishly doing for a while). 1 2 3 4 5 6 setwd("~/Documents/UNHCR Data/") # ~ acts as base for home directory list.files(full.names=TRUE) # gives full path for files or folders files.all <- list.files(path="All_Data/") #assigns name to file names in the All_Data folder length(files.all) #checks how many objects there are in the /All_Data folder files.all Since the file is a comm delimited file (.csv) we use the read.csv() function to read it in and assign it the name “ref.d”. I used what I know with the paste0() function We set the skip argument equal to 2 because by visual inspection of the file, the first two rows are committed to the file title (we don’t want to read that into R). I also used the na.string argument to specify that any blanks (“”), dashes (“-“) and asterisks (“*”) would be considered missing data, NA. The asterisks are specified to be redacted information, based on the UNHCR website. 1 2 3 4 5 6 ref.d <- read.csv(paste0("All_Data/",files.all), #insert filepath and name into 1st argument header=T, #select the headers in 3rd row skip=2, #skips the first rows (metadata in .csv file) na.string=c(","-","*"), #convert all blanks, "i","*" cells into missing type NA col.names=new.names #since we already made new names ) First thing I see, the names for the columns names are long and they would be annoying to reproduce. So first we’ll change these using the names() function. 1 2 new.names <- c("Year", "Country", "Country_Origin", "Refugees", "Asylum_Seekers", "Returned_Refugees", "IDPs", "Returned_IDPs", "Stateless_People", "Others_of_Concern","Total") names(ref.d) <- new.names By using summary() and str() on the dataset we can see that the range of the data spans from 1951 to 2014, it contains information on the country where refugees are situated, their country of origin, counts for each population of concern and total counts. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 > summary(ref.d) Year Country Country_Origin Refugees Min. :1951 Length:103746 Length:103746 Min. : 1 1st Qu.:2000 Class :character Class :character 1st Qu.: 3 Median :2006 Mode :character Mode :character Median : 16 Mean :2004 Mean : 5992 3rd Qu.:2010 3rd Qu.: 167 Max. :2014 Max. :3272290 NA's :19353 Asylum_Seekers Returned_Refugees IDPs Returned_IDPs Min. : 0.0 Min. : 1 Min. : 470 Min. : 23 1st Qu.: 1.0 1st Qu.: 2 1st Qu.: 90746 1st Qu.: 5000 Median : 5.0 Median : 16 Median : 261704 Median : 27284 Mean : 255.9 Mean : 6737 Mean : 540579 Mean : 111224 3rd Qu.: 34.0 3rd Qu.: 247 3rd Qu.: 594443 3rd Qu.: 104230 Max. :358056.0 Max. :9799410 Max. :7632500 Max. :1186889 NA's :46690 NA's :97327 NA's :103330 NA's :103544 Stateless_People Others_of_Concern Total Min. : 1 Min. : 1.0 Min. : 1 1st Qu.: 205 1st Qu.: 14.8 1st Qu.: 3 Median : 1720 Median : 444.5 Median : 16 Mean : 66803 Mean : 24672.5 Mean : 8605 3rd Qu.: 11462 3rd Qu.: 6000.0 3rd Qu.: 166 Max. :3500000 Max. :957000.0 Max. :9799410 NA's :103103 NA's :103018 NA's :2433 It’s always good practice to identify missing data as well (especially when we set the condition of the read.csv argument above). For non-numeric variables you can use a simple function using apply() and is.na() to identify missing values (NA’s) in your data. 1 apply(ref.d,2, function(x) sum(is.na(x))) When I used str() on the data, I saw that the country names were as factors and the populations of concern categories were integers. I made a short for loop to change these to a character and numeric type respectively. 1 2 3 4 5 6 for(i in 2:length(names(ref.d))){ # "2"-ignores the first column (we want to keep Year as an integer) if (class(ref.d[,i])=="factor"){ ref.d[,i] &lt;- as.character(ref.d[,i])} if (class(ref.d[,i])=="integer"){ ref.d[,i] &lt;- as.numeric(ref.d[,i])} } Also another nuance, I wanted to change some of the names of the countries (they were either very long or had extra information). I first identified the names I wanted to change and then replace them a new set of names. I did this using a for loop as well. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 old.countries <- c("Bolivia (Plurinational State of)", "China, Hong Kong SAR", "China, Macao SAR", "Iran (Islamic Rep. of)", "Micronesia (Federated States of)", "Serbia and Kosovo (S/RES/1244 (1999))", "Venezuela (Bolivarian Republic of)", "Various/Unknown") # replacement names new.countries <- c("Bolivia","Hong Kong","Macao","Iran","Micronesia","Serbia &amp; Kosovo","Venezuela","Unknown") for (k in 1:length(old.countries)){ ref.d$Country_Origin[ref.d$Country_Origin==old.countries[k]]&lt;-new.countries[k] ref.d$Country[ref.d$Country==old.countries[k]]&lt;-new.countries[k] } If any has alternative ways to achieve the above (ie. using the apply family), comment below! Just a short disclaimer on for loops in R. There has been a lot of argument on the effectiveness of for loops in R compared to the apply function family. A quick Google Search shows many opinions on this issue, based on computing speed/power, simplicity, elegance, etc. Advanced R by Hadley Wickham talks about this and I’ve generally used this as a guideline on whether to use a for loop or an apply function. SOME DESCRIPTIVES AND NORTH KOREA Just to get an idea of the data, we can create a list of the countries and countries of origin by using the code similar to identifying countries with certain MRSA strains in my previous post. 1 2 3 4 clist<-sort(unique(ref.d$Country)) #alphabetical clist or.clist<-sort(unique(ref.d$Country_Origin)) #alphabetical or.clist We can then compare them for any differences either using matching operators or the setdiff() function. First we’ll do this… 1 2 3 4 5 clist[!clist %in% or.clist] # or setdiff(clist,or.clist) [1] "Bonaire" "Montserrat" [3] "Sint Maarten (Dutch part)" "State of Palestine" … we can infer that these countries haven’t produced refugees or there is no data on these countries in the UNHCR database. If we reverse the comparison… 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 or.clist[!or.clist %in% clist] # or setdiff(or.clist,clist) [1] "Andorra" "Anguilla" [3] "Bermuda" "Cook Islands" [5] "Dem. People's Rep. of Korea" "Dominica" [7] "French Polynesia" "Gibraltar" [9] "Guadeloupe" "Holy See (the)" [11] "Kiribati" "Maldives" [13] "Marshall Islands" "Martinique" [15] "New Caledonia" "Niue" [17] "Norfolk Island" "Palestinian" [19] "Puerto Rico" "Samoa" [21] "San Marino" "Sao Tome and Principe" [23] "Seychelles" "Stateless" [25] "Tibetan" "Tuvalu" [27] "Wallis and Futuna Islands " "Western Sahara" … we get a list of countries that have only produced refugees (not taken any refugees in) or there is missing data in the UNHCR. I myself being Korean-Canadian I noticed North Korea (the Democratic People’s Republic of Korea) on this list. I wanted to ask the question, which countries have the largest number of North Korean refugees based on the UNHCR Data? What are the top 10? 1 2 3 4 5 6 7 8 9 10 11 12 13 NK.tot<- aggregate(cbind(Total)~Country,data=NK,FUN=sum) NK.tot[order(-NK.tot[,2]),][1:10,] Country Total 31 United Kingdom 4808 5 Canada 2954 10 Germany 2845 18 Netherlands 487 3 Belgium 435 23 Russian Federation 357 32 United States of America 346 1 Australia 318 20 Norway 262 9 France 228 We find that the UK has the highest number of North Koreans refugees, followed by Canada and Germany with similar counts. Learned something new today. WORD CLOUDS IN R If you haven’t guessed based on the packages I loaded in the beginning, a word cloud was inevitable. Making word clouds in R is 0Twitter 0Pin About author EUGENE JOH A detail-oriented MS and MPH graduate with a strong quantitative background, motivated to use his current and developing skill set to improve the health of vulnerable populations in local and global settings. 1 STAY CONNECTED! GET CURATED NEWSLETTERS EVERY WEEK First Name** Last name* Email* Country/Region Please SelectAfghanistanÅland IslandsAlbaniaAlgeriaAmerican SamoaAndorraAngolaAnguillaAntarcticaAntigua and BarbudaArgentinaArmeniaArubaAsia/Pacific RegionAustraliaAustriaAzerbaijanBahamasBahrainBangladeshBarbadosBelarusBelgiumBelizeBeninBermudaBhutanBoliviaBosnia and HerzegovinaBotswanaBouvet IslandBrazilBritish Indian Ocean TerritoryBritish Virgin IslandsBruneiBulgariaBurkina FasoBurundiCambodiaCameroonCanadaCape VerdeCaribbean NetherlandsCayman IslandsCentral African RepublicChadChileChinaChristmas IslandCocos (Keeling) IslandsColombiaComorosCongoCook IslandsCosta RicaCote d'IvoireCroatiaCubaCuraçaoCyprusCzech RepublicDemocratic Republic of the CongoDenmarkDjiboutiDominicaDominican RepublicEast TimorEcuadorEgyptEl SalvadorEquatorial GuineaEritreaEstoniaEthiopiaEuropeFalkland IslandsFaroe IslandsFijiFinlandFranceFrench GuianaFrench PolynesiaFrench Southern and Antarctic LandsGabonGambiaGeorgiaGermanyGhanaGibraltarGreeceGreenlandGrenadaGuadeloupeGuamGuatemalaGuernseyGuineaGuinea-BissauGuyanaHaitiHeard Island and McDonald IslandsHondurasHong KongHungaryIcelandIndiaIndonesiaIranIraqIrelandIsle of ManIsraelItalyJamaicaJapanJerseyJordanKazakhstanKenyaKiribatiKuwaitKyrgyzstanLaosLatviaLebanonLesothoLiberiaLibyaLiechtensteinLithuaniaLuxembourgMacauMacedonia (FYROM)MadagascarMalawiMalaysiaMaldivesMaliMaltaMarshall IslandsMartiniqueMauritaniaMauritiusMayotteMexicoMicronesiaMoldovaMonacoMongoliaMontenegroMontserratMoroccoMozambiqueMyanmar (Burma)NamibiaNauruNepalNetherlandsNetherlands AntillesNew CaledoniaNew ZealandNicaraguaNigerNigeriaNiueNorfolk IslandNorth KoreaNorthern Mariana IslandsNorwayOmanPakistanPalauPalestinePanamaPapua New GuineaParaguayPeruPhilippinesPitcairn IslandsPolandPortugalPuerto RicoQatarRéunionRomaniaRussiaRwandaSaint BarthélemySaint HelenaSaint Kitts and NevisSaint LuciaSaint MartinSaint Pierre and MiquelonSaint Vincent and the GrenadinesSamoaSan MarinoSao Tome and PrincipeSaudi ArabiaSenegalSerbiaSeychellesSierra LeoneSingaporeSint MaartenSlovakiaSloveniaSolomon IslandsSomaliaSouth AfricaSouth Georgia and the South Sandwich IslandsSouth KoreaSouth SudanSpainSri LankaSudanSurinameSvalbard and Jan MayenSwazilandSwedenSwitzerlandSyriaTaiwanTajikistanTanzaniaThailandTogoTokelauTongaTrinidad and TobagoTunisiaTurkeyTurkmenistanTurks and Caicos IslandsTuvaluU.S. Virgin IslandsUgandaUkraineUnited Arab EmiratesUnited KingdomUnited StatesUnited States Minor Outlying IslandsUruguayUzbekistanVanuatuVatican CityVenezuelaVietnamWallis and FutunaWestern SaharaYemenZambiaZimbabweMyanmar From time to time, we'd like to contact you with other related content and offers. You may unsubscribe at any time. Privacy Policy * I agree to receive communications from ODSC.* LATEST POSTS View all 3 EXAMPLES OF AI HELPING POLICE SOLVE COLD CASES Business + Managementposted by Zac Amos Nov 26, 2024 Artificial intelligence (AI) is excellent at reviewing lots of information in a short time — something... DRIVING PROGRESS WITH OPEN DATA SCIENCE: TRENDS, TOOLS, AND OPPORTUNITIES Opinionposted by ODSC Community Nov 26, 2024 What was once only possible for tech giants is now at our fingertips – vast amounts... GREECE BREAKS GROUND ON DATA CENTER, BOOSTING REGIONAL TECH AND AI AMBITIONS AI and Data Science Newsposted by ODSC Team Nov 26, 2024 The Mediterranean region is poised for a significant technological leap forward as Data4, a French data... Tags Machine Learning111Azure69East 202265ODSC East 2015|Speaker Slides64East 202458Microsoft49West 202249West 202449Deep Learning48East 202048East 202347West 202146Podcast45Accelerate AI43East 202142Conferences41West 202340Europe 202039Europe 202138cybersecurity37 Related posts * The Rise of Open-Source Data Catalogs: A New… * Driving Progress with Open Data Science: Trends,… * AI in Data Governance: Enhancing Data Integrity and Security About us Proactively envisioned multimedia based expertise and cross-media growth strategies. Seamlessly visualize quality intellectual capital without superior collaboration and idea-sharing. Holistically pontificate installed base portals after maintainable products. Content Map Modeling1670Conferences747Featured Post723AI and Data Science News688Business + Management535Tools & Languages366Machine Learning350NLP & LLMs268Deep Learning233Career Insights212Blogs from ODSC Speakers202Blog201Data Visualization138Statistics127R125Python116Predictive Analytics99Technology77Guest contributor74Research72 Tags Machine Learning111Azure69East 202265ODSC East 2015|Speaker Slides64East 202458Microsoft49West 202249West 202449Deep Learning48East 202048East 202347West 202146Podcast45Accelerate AI43East 202142Conferences41West 202340Europe 202039Europe 202138cybersecurity37 ODSC Privacy Policy View ODSC Privacy Policy Copyright Open Data Science 2024. All Rights Reserved * * Modeling * Data Analytics * Data Engineering * Data Visualization * Deep Learning * Generative AI * Machine Learning * NLP and LLMs * Python * Business & Use Cases * Career Advice * Write for us * Community * ODSC Community Slack Channel * Meetups * Substack * Medium * Upcoming Webinars * Ai X Podcast * Apple * Spotify * SoundCloud * Training * ODSC Conferences * ODSC EAST * ODSC WEST * ODSC EUROPE * ODSC APAC * MEETUPS * AI+ Training * Newsletter * Jobs * Speak at ODSC We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.ConfirmNoPrivacy policy You can revoke your consent any time using the Revoke consent button.Revoke consent × We Value Your Privacy Settings NextRoll, Inc. ("NextRoll") and our 20 advertising partners use cookies and similar technologies on this site and use personal data (e.g., your IP address). If you consent, the cookies, device identifiers, or other information can be stored or accessed on your device for the purposes described below. You can click "Allow All" or "Decline All" or click Settings above to customise your consent regarding the purposes and features for which your personal data will be processed and/or the partners with whom you will share personal data. NextRoll and our advertising partners process personal data to: ● Store and/or access information on a device; ● Create a personalised content profile; ● Select personalised content; ● Personalised advertising, advertising measurement, audience research and services development; ● Services development. For some of the purposes above, our advertising partners: ● Use precise geolocation data. Some of our partners rely on their legitimate business interests to process personal data. View our advertising partners if you wish to provide or deny consent for specific partners, review the purposes each partner believes they have a legitimate interest for, and object to such processing. If you select Decline All, you will still be able to view content on this site and you will still receive advertising, but the advertising will not be tailored for you. You may change your setting whenever you see the Manage consent preferences on this site. Decline All Allow All Manage consent preferences