{"id":3807,"date":"2024-12-04T06:10:05","date_gmt":"2024-12-03T21:10:05","guid":{"rendered":"https:\/\/secondlife.lol\/?p=3807"},"modified":"2024-12-04T06:30:01","modified_gmt":"2024-12-03T21:30:01","slug":"how-to-read-number-units-visualization-with-r","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/en\/how-to-read-number-units-visualization-with-r\/","title":{"rendered":"How to Read Numeric Units: From Billion to Wonders, Visualize with R"},"content":{"rendered":"<p class=\"wp-block-paragraph\">Hello, everyone! Today we're here with a really exciting topic: we're going to talk about how to read numeric units. Have you ever encountered the '<strong>Stewardess<\/strong>'? It's probably new to most of you, but did you know that there are actually huge units of numbers beyond the 'billion' and 'trillion' that we use every day?<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Today, we're going to visualize these interesting numerical units with R programming, so you can learn how to read them and dive into the world of data visualization at the same time. So, let's get started!<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title-wrap{color:var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{color:var(--global-palette2, #2B6CB0);font-size:28px;font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);line-height:2em;font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap .kb-table-of-content-list .kb-table-of-contents__entry:hover{color:var(--global-palette6, #718096);}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-content-wrap{border-top:3px solid var(--global-palette2, #2B6CB0);border-right:3px solid var(--global-palette2, #2B6CB0);border-bottom:3px solid var(--global-palette2, #2B6CB0);border-left:3px solid var(--global-palette2, #2B6CB0);}.kb-table-of-content-nav.kb-table-of-content-id83_5f28a6-34 .kb-table-of-contents-title{font-size:28px;}}<\/style>\n\n<style>.kb-image3807_d23052-92 .kb-image-has-overlay:after{opacity:0.3;}<\/style>\n<div class=\"wp-block-kadence-image kb-image3807_d23052-92\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1200\" height=\"598\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66.jpg\" alt=\"\uc22b\uc790 \ub2e8\uc704 \uc77d\ub294 \ubc95\" class=\"kb-img wp-image-3810\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66.jpg 1200w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66-300x150.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66-600x299.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66-768x383.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-66-18x9.jpg 18w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption>(How to read numeric units - reference illustration)<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">World in Korean numerical units<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">We often stop at \"million, billion, and trillion\" when it comes to the numerical units we use in our daily lives, but there's more to it than that. If you look at the Korean numerical system, you'll see that<strong>billion<\/strong>', starting with '<strong>joe, kyung, year, za, yang, gu, ku, liver, chung, jae, ash, pole, hanghasa, aseungki, nayuta, wonder<\/strong>'. These large numbers are often used in science and astronomy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Visualize numeric units in R<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now we'll use R to visualize these huge numerical units. <a href=\"https:\/\/secondlife.lol\/en\/ggplot2-intro\/\" data-type=\"post\" data-id=\"3055\">The ggplot2 library<\/a>to create two different graphs. <strong>One in normal scale, the other in logarithmic scale<\/strong>I will.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Load the ggplot2 package\nlibrary(ggplot2)\nlibrary(gridExtra) Load the gridExtra package for side-by-side # graphs\n\nGenerate # data\nunits &lt;- c(&quot;Eog&quot;, &quot;Jo&quot;, &quot;Gyeong&quot;, &quot;Hae&quot;, &quot;Ja&quot;, &quot;Yang&quot;, &quot;Gu&quot;, &quot;Gan&quot;, &quot;Dam&quot;, &quot;Jae&quot;, &quot;Geug&quot;, &quot;Hanghasa&quot;, &quot;Aseunggi&quot;, &quot;Nayuta&quot;, &quot;Bulgaui&quot;)\nvalues &lt;- 10^(seq(8, 64, by=4)) # 10^8 to 10^64 in increments of 4\n\nCreate a # dataframe\ndata &lt;- data.frame(Unit = factor(units, levels = units), Value = values)\n\nGraph the # normal scale\nplot_linear &lt;- ggplot(data, aes(x = Unit, y = Value)) +\n    geom_bar(stat = &quot;identity&quot;, fill = &quot;steelblue&quot;) +\n    theme_minimal() +\n    labs(title = &quot;Linear Scale&quot;, x = &quot;Unit (Romanized)&quot;, y = &quot;Value&quot;) +\n    theme(axis.text.x = element_text(angle = 45, hjust = 1))\n\n# log scale graph\nplot_log &lt;- ggplot(data, aes(x = Unit, y = Value)) +\n    geom_bar(stat = &quot;identity&quot;, fill = &quot;darkred&quot;) + # Generate a bar graph\n    scale_y_log10(\n        breaks = 10^(seq(8, 64, by=4)), # log values to display on y-axis\n        labels = scales::scientific # label y-axis with scientific notation\n    ) + 1\n    theme_minimal() + # Apply minimalist style theme\n    labs(title = &quot;Logarithmic Scale&quot;, x = &quot;Unit (Romanized)&quot;, y = &quot;Value (Log Scale)&quot;) + # Set title and axis labels\n    theme(axis.text.x = element_text(angle = 45, hjust = 1)) # Rotate x-axis text\n\n# Output the two graphs side by side\ngrid.arrange(plot_linear, plot_log, ncol = 2)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Code commentary<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Load the necessary libraries. ggplot2 is responsible for graph generation, <a href=\"https:\/\/cran.r-project.org\/package=gridExtra\" target=\"_blank\" rel=\"noopener\">gridExtra<\/a>is used for graph placement.<\/li>\n\n\n\n<li>Generates a numeric unit and its corresponding value. The value is expressed as a power of 10.<\/li>\n\n\n\n<li>Create a dataframe to store units and values.<\/li>\n\n\n\n<li>Create a normal scaled graph: draw a bar graph with geom_bar() and apply a clean design with theme_minimal().<\/li>\n\n\n\n<li>Create a log-scaled graph similarly, but use scale_y_log10() to convert the y-axis to a log scale.<\/li>\n\n\n\n<li>Use grid.arrange() to place the two graphs side by side.<\/li>\n<\/ol>\n\n\n<style>.kb-image3807_c32b2b-fe .kb-image-has-overlay:after{opacity:0.3;border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;}.kb-image3807_c32b2b-fe img.kb-img, .kb-image3807_c32b2b-fe .kb-img img{border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:0px 0px 14px 0px rgba(0, 0, 0, 0.2);}<\/style>\n<div class=\"wp-block-kadence-image kb-image3807_c32b2b-fe\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1042\" height=\"527\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67.jpg\" alt=\"\uc22b\uc790 \ub2e8\uc704 \uc77d\ub294 \ubc95 - \uc2dc\uac01\ud654 \ube44\uad50\" class=\"kb-img wp-image-3811\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67.jpg 1042w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67-300x152.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67-600x303.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67-768x388.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/image-4-67-18x9.jpg 18w\" sizes=\"(max-width: 1042px) 100vw, 1042px\" \/><figcaption>(How to Read Numeric Units - R Visualize Graphs )<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">How to Read Numeric Units: The Importance of Visualization<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In a normal scale graph, you can see that the height of the bar increases exponentially as you go from 'billion' to 'wonder', but the value of wonder is so large that the values below it are not represented in the graph. In a logarithmic scale graph, you can more clearly compare the difference between each unit (4 powers of 10).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This visualization makes it easier for us to understand how to read numbers in units, and it gives us an intuitive sense of how big the \"wonder\" is.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Interesting stories in numbers<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now, here's a fun story about numerical units from \"sailor\" to \"wonder\".<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Hanghasa (\u6052\u6cb3\u6c99): Grains of sand from the Ganges River.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\"Hanghasa\" means as many as the grains of sand in the Ganges. Have you ever counted the grains of sand in the Ganges, India's holy river? There are more than you can count, which is why Buddhists use this expression to refer to an uncountable number.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Aesop: An immeasurable number<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\"Ascension\" comes from the Sanskrit word \"asanga,\" which means \"immeasurable.\" In Buddhism, this number is 10,000 times the number of \"sanghas.\" Can you imagine?<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Nayuta (\u90a3\u7531\u4ed6): A larger number<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\"Nayuta\" represents a much larger number than \"ascetic,\" and while we don't know exactly how large, we do know it's huge.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Wonders (\u4e0d\u53ef\u601d\u8b70): A number that cannot even be thought of.<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, a \"mystery\" is literally an \"unthinkable\" number. In Buddhism, it's 10,000 times the number of \"nayutas.\" It's not just a big number, it's a concept beyond our imagination.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Organize<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Today we learned how to read numerical units and visualize them in R. By doing this, we've made the concept of big numbers a little easier to understand. The next time someone mentions the unit \"wonder,\" you'll be able to think about how big it is.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Why not visualize a variety of data in this way? R and ggplot2 are really powerful tools. I'm sure they'll help you uncover the stories behind your data. Until next time, I'll be back with another fun topic. Bye!<\/p>","protected":false},"excerpt":{"rendered":"<p>Hello, everyone! Today we're here with a really exciting topic: numerical units...<\/p>","protected":false},"author":3,"featured_media":3814,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6],"tags":[176,174,164,557,558],"class_list":["post-3807","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-ggplot2","tag-r-","tag-164","tag-557","tag-558"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":176,"label":"ggplot2"},{"value":174,"label":"R \ud504\ub85c\uadf8\ub798\ubc0d"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":557,"label":"\uc22b\uc790 \ub2e8\uc704"},{"value":558,"label":"\ud55c\uad6d\uc5b4 \uc218 \uccb4\uacc4 \ud3ec\ucee4\uc2a4 \ud0a4\uc6cc\ub4dc: \uc22b\uc790 \ub2e8\uc704 \uc77d\ub294 \ubc95"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/11\/\uc22b\uc790-\ub2e8\uc704-\uc77d\ub294-\ubc95-post-thumbnail-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/en\/author\/tere\/"},"comment_info":0,"category_info":[{"term_id":6,"name":"\uc54c(R)","slug":"r-coding","term_group":0,"term_taxonomy_id":6,"taxonomy":"category","description":"","parent":20,"count":61,"filter":"raw","cat_ID":6,"category_count":61,"category_description":"","cat_name":"\uc54c(R)","category_nicename":"r-coding","category_parent":20}],"tag_info":[{"term_id":176,"name":"ggplot2","slug":"ggplot2","term_group":0,"term_taxonomy_id":176,"taxonomy":"post_tag","description":"","parent":0,"count":15,"filter":"raw"},{"term_id":174,"name":"R \ud504\ub85c\uadf8\ub798\ubc0d","slug":"r-%ed%94%84%eb%a1%9c%ea%b7%b8%eb%9e%98%eb%b0%8d","term_group":0,"term_taxonomy_id":174,"taxonomy":"post_tag","description":"","parent":0,"count":15,"filter":"raw"},{"term_id":164,"name":"\ub370\uc774\ud130 \uc2dc\uac01\ud654","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0-%ec%8b%9c%ea%b0%81%ed%99%94","term_group":0,"term_taxonomy_id":164,"taxonomy":"post_tag","description":"","parent":0,"count":52,"filter":"raw"},{"term_id":557,"name":"\uc22b\uc790 \ub2e8\uc704","slug":"%ec%88%ab%ec%9e%90-%eb%8b%a8%ec%9c%84","term_group":0,"term_taxonomy_id":557,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":558,"name":"\ud55c\uad6d\uc5b4 \uc218 \uccb4\uacc4 \ud3ec\ucee4\uc2a4 \ud0a4\uc6cc\ub4dc: \uc22b\uc790 \ub2e8\uc704 \uc77d\ub294 \ubc95","slug":"%ed%95%9c%ea%b5%ad%ec%96%b4-%ec%88%98-%ec%b2%b4%ea%b3%84-%ed%8f%ac%ec%bb%a4%ec%8a%a4-%ed%82%a4%ec%9b%8c%eb%93%9c-%ec%88%ab%ec%9e%90-%eb%8b%a8%ec%9c%84-%ec%9d%bd%eb%8a%94-%eb%b2%95","term_group":0,"term_taxonomy_id":558,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/3807","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/comments?post=3807"}],"version-history":[{"count":6,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/3807\/revisions"}],"predecessor-version":[{"id":3819,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/3807\/revisions\/3819"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media\/3814"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media?parent=3807"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/categories?post=3807"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/tags?post=3807"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}