{"id":2284,"date":"2024-07-24T08:06:34","date_gmt":"2024-07-23T23:06:34","guid":{"rendered":"https:\/\/secondlife.lol\/?p=2284"},"modified":"2024-07-26T22:52:00","modified_gmt":"2024-07-26T13:52:00","slug":"trump-2024-rnc-acceptance-speech-visualization","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/ja\/trump-2024-rnc-acceptance-speech-visualization\/","title":{"rendered":"\u30c6\u30ad\u30b9\u30c8\u30de\u30a4\u30cb\u30f3\u30b0\u6280\u6cd5\u3092\u5229\u7528\u3057\u305f2024\u5e74\u5171\u548c\u515a\u5927\u7d71\u9818\u5019\u88dc\u53d7\u8afe\u306e\u30c8\u30e9\u30f3\u30d7\u6f14\u8aac\u5185\u5bb9\u3092\u8996\u899a\u5316\u3059\u308b"},"content":{"rendered":"\n<p>2024\ub144 7\uc6d4 19\uc77c(\ud604\uc9c0 \uc77c\uc790)\uc5d0 \ub3c4\ub110\ub4dc \ud2b8\ub7fc\ud504\uc758 \ub300\uc120\ud6c4\ubcf4 \uc218\ub77d \uc5f0\uc124\uc774 \uc788\uc5c8\uc2b5\ub2c8\ub2e4. \uc774 \uc2a4\ud53c\uce58\ub97c \uae30\ubc18\uc73c\ub85c R\uc744 \uc774\uc6a9\ud558\uc5ec \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\uc744 \uc801\uc6a9\ud558\uc5ec \uc2dc\uac01\ud654 \uc791\uc5c5\uc744 \ud574\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774 \uc791\uc5c5\uc744 \uc704\ud55c \uc18c\uc2a4\ucf54\ub4dc\ub97c \uc791\uc131\ud558\uace0 \uc2a4\ud15d\ubc14\uc774\uc2a4\ud15d\uc73c\ub85c \uc124\uba85\uc744 \ub4dc\ub9ac\ub3c4\ub85d \ud558\uaca0\uc2b5\ub2c8\ub2e4. <\/p>\n\n\n\n<p>\uc774\ubc88 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\uc744 \uc0ac\uc6a9\ud558\uc5ec\uc11c \uc601\ubb38\uc73c\ub85c \uc791\uc131\ub41c \uac01\uc885 \ud14d\uc2a4\ud2b8 \uc815\ubcf4\uc5d0 \ub300\ud574 \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d, \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \uc0dd\uc131, \uac10\uc131 \ubd84\uc11d, \ubc14\uc774\uadf8\ub7a8 \ubd84\uc11d \ub4f1 \ub2e4\uc591\ud55c \ubd84\uc11d\uc744 \uc2dc\ub3c4\ud574 \ubcf4\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4. \uad73\uc774 \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uc0ac\uc774\ud2b8\ub97c \ucc3e\uc544 \ud5e4\ub9ec \ud544\uc694\uac00 \uc5c6\uc2b5\ub2c8\ub2e4.<\/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\n<p>\ub370\uc774\ud130 \uc2dc\uac01\ud654\ub294 \ubcf5\uc7a1\ud55c \ub370\uc774\ud130\ub97c \uc2dc\uac01\uc801\uc73c\ub85c \ud45c\ud604\ud558\uc5ec \uc774\ud574\ub97c \ub3d5\ub294 \uc911\uc694\ud55c \uae30\uc220\uc785\ub2c8\ub2e4. \ud2b9\ud788, \ud14d\uc2a4\ud2b8 \ub370\uc774\ud130\uc758 \uacbd\uc6b0 \uc2dc\uac01\ud654\ub97c \ud1b5\ud574 \uc228\uaca8\uc9c4 \ud328\ud134\uacfc \ud1b5\ucc30\uc744 \ubc1c\uacac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud2b8\ub7fc\ud504\uc758 \uc5f0\uc124\uc744 \ubd84\uc11d\ud558\uc5ec \ub2e8\uc5b4 \ube48\ub3c4 \ub4f1\uc744 \uc2dc\uac01\ud654\ud568\uc73c\ub85c\uc368 \uc5f0\uc124\uc758 \uc8fc\uc694 \uc8fc\uc81c\uc640 \ubd84\uc704\uae30\ub97c \ud30c\uc545\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\uc744 \uc704\ud55c R \uc18c\uc2a4\ucf54\ub4dc<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc124\uce58 \ubc0f \ub85c\ub4dc<\/h3>\n\n\n\n<p>\uba3c\uc800, \ud544\uc694\ud55c R \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud558\uace0 \ub85c\ub4dc\ud569\ub2c8\ub2e4. \uc774 \ucf54\ub4dc\ub294 \ud544\uc694\ud55c \ud328\ud0a4\uc9c0\ub97c \uc790\ub3d9\uc73c\ub85c \uc124\uce58\ud558\uace0 \ub85c\ub4dc\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc124\uce58 \ubc0f \ub85c\ub4dc<br>required_packages &lt;- c(\"tidytext\", \"dplyr\", \"ggplot2\", \"stringr\", \"igraph\", \"ggraph\", \"readr\", \"textdata\", \"wordcloud2\", \"htmlwidgets\", \"tidyr\", \"showtext\")<br><br># \uc124\uce58\ub418\uc9c0 \uc54a\uc740 \ud328\ud0a4\uc9c0 \ud655\uc778 \ubc0f \uc124\uce58<br>new_packages &lt;- required_packages[!(required_packages %in% installed.packages()[,\"Package\"])]<br>if(length(new_packages)) install.packages(new_packages)<br><br># \ud328\ud0a4\uc9c0 \ub85c\ub4dc<br>lapply(required_packages, require, character.only = TRUE)<br>showtext_auto()<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \ud544\uc694\ud55c \ubaa8\ub4e0 \ud328\ud0a4\uc9c0\ub97c \uc124\uce58\ud558\uace0 \ub85c\ub4dc\ud569\ub2c8\ub2e4. <code>showtext_auto()<\/code> \ud568\uc218\ub294 \uae00\uaf34\uc744 \uc790\ub3d9\uc73c\ub85c \ub85c\ub4dc\ud558\uc5ec ggplot2 \uadf8\ub798\ud504\uc5d0\uc11c \ud14d\uc2a4\ud2b8\uac00 \uae68\uc9c0\uc9c0 \uc54a\ub3c4\ub85d \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud14d\uc2a4\ud2b8 \ud30c\uc77c \uc77d\uae30<\/h3>\n\n\n\n<p>\ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc744 \uc77d\uace0 \ub2e8\uc5b4\ub85c \ud1a0\ud070\ud654\ud569\ub2c8\ub2e4. \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc740 <a href=\"https:\/\/www.nytimes.com\/2024\/07\/19\/us\/politics\/trump-rnc-speech-transcript.html\" target=\"_blank\" rel=\"noopener\">\ub274\uc695\ud0c0\uc784\uc2a4\uc5d0\uc11c \uacf5\uac1c\ud55c \uc6f9\ud398\uc774\uc9c0<\/a>\ub97c \ud65c\uc6a9\ud558\uc5ec\uc11c \ub9cc\ub4e4\uc5c8\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \ud14d\uc2a4\ud2b8 \ud30c\uc77c \uc77d\uae30(file_path\ub294 \uc790\uc2e0\uc758 \ud3f4\ub354\uc5d0 \ub9de\ucd94\uc2dc\uae30 \ubc14\ub78d\ub2c8\ub2e4.)<br>file_path &lt;- \"C:\\\\R\\\\Trump_2024_RNC_Acceptance_Speech.txt\"<br>text &lt;- read_file(file_path)<br><br># \ud14d\uc2a4\ud2b8\ub97c \ub2e8\uc5b4\ub85c \ud1a0\ud070\ud654<br>words &lt;- tibble(text = text) %&gt;%<br>    unnest_tokens(word, text)<br><br># \ubd88\uc6a9\uc5b4 \uc81c\uac70<br>data(stop_words)<br>words &lt;- words %&gt;%<br>    anti_join(stop_words)<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \ud14d\uc2a4\ud2b8 \ud30c\uc77c\uc744 \uc77d\uc5b4 \ub4e4\uc778 \ud6c4, \ud14d\uc2a4\ud2b8\ub97c \ub2e8\uc5b4 \ub2e8\uc704\ub85c \ubd84\ub9ac\ud558\uace0 \ubd88\uc6a9\uc5b4\ub97c \uc81c\uac70\ud569\ub2c8\ub2e4. \ubd88\uc6a9\uc5b4\ub294 \uc758\ubbf8 \uc5c6\ub294 \ub2e8\uc5b4\ub97c \uc758\ubbf8\ud558\ub294\ub370 \uc774\ub97c \uc81c\uc678\ud558\uba74 \ubd84\uc11d\uc758 \uc815\ud655\uc131\uc744 \ub192\uc77c \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<\/h3>\n\n\n\n<p>\ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d\uc744 \ud1b5\ud574 \uc5f0\uc124\uc5d0\uc11c \uac00\uc7a5 \uc790\uc8fc \uc0ac\uc6a9\ub41c \ub2e8\uc5b4\ub97c \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<br>word_freq &lt;- words %&gt;%<br>    count(word, sort = TRUE)<br><br>ggplot(word_freq[1:20,], aes(x = reorder(word, n), y = n, label = n)) +<br>    geom_col() +<br>    geom_text(hjust = -0.1, color = \"black\") +<br>    coord_flip() +<br>    labs(title = \"Top 20 Words in Trump's 2024 RNC Acceptance Speech\", x = \"Word\", y = \"Frequency\")<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uc0c1\uc704 20\uac1c\uc758 \ub2e8\uc5b4\uc640 \uadf8 \ube48\ub3c4\ub97c \uadf8\ub798\ud504\ub85c \uc2dc\uac01\ud654\ud569\ub2c8\ub2e4. \uac01 \ub2e8\uc5b4\uc758 \ube48\ub3c4\ub97c \ub9c9\ub300\uadf8\ub798\ud504\ub85c \ud45c\uc2dc\ud558\uace0, \ube48\ub3c4 \uc218\ub97c \ub808\uc774\ube14\ub85c \ucd94\uac00\ud569\ub2c8\ub2e4.<\/p>\n\n\n<style>.kb-image2284_cff832-b9 .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-image2284_cff832-b9 img.kb-img, .kb-image2284_cff832-b9 .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-image2284_cff832-b9\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"348\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8-600x348.jpg\" alt=\"\ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\" class=\"kb-img wp-image-2288\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8-600x348.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8-300x174.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8-768x446.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-8.jpg 915w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>\uc774 \ub9c9\ub300 \uadf8\ub798\ud504\ub294 \ub3c4\ub110\ub4dc \ud2b8\ub7fc\ud504\uc758 2024\ub144 RNC \uc218\ub77d \uc5f0\uc124\uc5d0\uc11c \uac00\uc7a5 \uc790\uc8fc \ub4f1\uc7a5\ud55c \uc0c1\uc704 20\uac1c\uc758 \ub2e8\uc5b4\ub97c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. \uac00\uc7a5 \ub450\ub4dc\ub7ec\uc9c4 \ub2e8\uc5b4\ub85c\ub294 &#8220;people(\uc0ac\ub78c\ub4e4)&#8221;, &#8220;country(\uad6d\uac00)&#8221;, &#8220;we&#8217;re(\uc6b0\ub9ac\ub294)&#8221;\uac00 \uc788\uc73c\uba70, \uc774\ub294 \uc9d1\ub2e8 \uc815\uccb4\uc131\uacfc \uad6d\uac00\uc5d0 \ub300\ud55c \ucd08\uc810\uc744 \ub098\ud0c0\ub0c5\ub2c8\ub2e4. &#8220;America(\ubbf8\uad6d)&#8221;, &#8220;world(\uc138\uacc4)&#8221;, &#8220;administration(\ud589\uc815\ubd80)&#8221;\uc640 \uac19\uc740 \ub2e8\uc5b4\uac00 \ub9ce\uc774 \ub4f1\uc7a5\ud558\ub294 \uac83\uc740 \uc815\ubd80\uc640 \uae00\ub85c\ubc8c \ubb38\uc81c\uc5d0 \ub300\ud55c \uc8fc\uc81c\ub97c \uc554\uc2dc\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \uc0dd\uc131<\/h3>\n\n\n\n<p>\uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub2e8\uc5b4\uc758 \ube48\ub3c4\ub97c \uc2dc\uac01\uc801\uc73c\ub85c \ub098\ud0c0\ub0c5\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \uc0dd\uc131<br>set.seed(1234) # \uc7ac\ud604 \uac00\ub2a5\uc131\uc744 \uc704\ud55c \uc2dc\ub4dc \uc124\uc815<br>wordcloud_data &lt;- word_freq %&gt;%<br>    filter(n &gt; 1) %&gt;% # \ucd5c\uc18c 2\ubc88 \uc774\uc0c1 \ub4f1\uc7a5\ud55c \ub2e8\uc5b4\ub9cc \ud3ec\ud568<br>    head(100) # \uc0c1\uc704 100\uac1c \ub2e8\uc5b4\ub9cc \uc0ac\uc6a9<br><br># \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \uc0dd\uc131<br>wc &lt;- wordcloud2(data = wordcloud_data, <br>                 size = 1,<br>                 color = \"random-dark\",<br>                 backgroundColor = \"white\",<br>                 rotateRatio = 0.3,<br>                 shape = \"circle\")<br><br># HTML \ud30c\uc77c\ub85c \uc800\uc7a5<br>saveWidget(wc, \"wordcloud_trump_2024.html\", selfcontained = TRUE)<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uc0c1\uc704 100\uac1c\uc758 \ub2e8\uc5b4\ub85c \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. <code>wordcloud2<\/code> \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub2e4\uc591\ud55c \uc635\uc158\uc744 \uc124\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n<style>.kb-image2284_9efef7-52 .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-image2284_9efef7-52 img.kb-img, .kb-image2284_9efef7-52 .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-image2284_9efef7-52\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"488\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9-600x488.jpg\" alt=\"\uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\" class=\"kb-img wp-image-2289\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9-600x488.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9-300x244.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9-768x624.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-9.jpg 1000w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>\uc774 \uc6cc\ub4dc \ud074\ub77c\uc6b0\ub4dc\ub294 \uc5f0\uc124\uc5d0\uc11c \uac00\uc7a5 \ub9ce\uc774 \uc0ac\uc6a9\ub41c \ub2e8\uc5b4\ub4e4\uc744 \uc2dc\uac01\ud654\ud55c \uac83\uc73c\ub85c, \ub2e8\uc5b4\uc758 \ud06c\uae30\ub294 \ube48\ub3c4\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. &#8220;country(\uad6d\uac00)&#8221;, &#8220;people(\uc0ac\ub78c\ub4e4)&#8221;, &#8220;we&#8217;re(\uc6b0\ub9ac\ub294)&#8221;\uc640 \uac19\uc740 \uc8fc\uc694 \ub2e8\uc5b4\ub4e4\uc774 \ub450\ub4dc\ub7ec\uc9d1\ub2c8\ub2e4. &#8220;love(\uc0ac\ub791)&#8221;, &#8220;beautiful(\uc544\ub984\ub2e4\uc6b4)&#8221;, &#8220;America(\ubbf8\uad6d)&#8221; \ub4f1 \ub2e4\uc591\ud55c \ub2e8\uc5b4\ub4e4\uc774 \ud3ec\ud568\ub418\uc5b4 \uc788\uc73c\uba70, \uc774\ub294 \uc5f0\uc124\uc5d0\uc11c \uc560\uad6d\uc2ec, \ucc2c\uc0ac, \uae0d\uc815\uc801 \uc8fc\uc81c\ub4e4\uc774 \uac15\uc870\ub418\uc5c8\uc74c\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. \uac10\uc131 \ubd84\uc11d<\/h3>\n\n\n\n<p>\uc5f0\uc124\uc758 \uac10\uc131\uc744 \ubd84\uc11d\ud558\uc5ec \uae0d\uc815\uc801 \ub610\ub294 \ubd80\uc815\uc801\uc778 \ub2e8\uc5b4\uc758 \ube48\ub3c4\ub97c \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \uac10\uc131 \ubd84\uc11d<br>sentiments &lt;- get_sentiments(\"bing\")<br>sentiment_analysis &lt;- words %&gt;%<br>    inner_join(sentiments) %&gt;%<br>    count(sentiment) %&gt;%<br>    pivot_wider(names_from = sentiment, values_from = n, values_fill = 0) %&gt;%<br>    mutate(sentiment = positive - negative)<br><br>print(sentiment_analysis)<br><\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uc5f0\uc124\uc5d0\uc11c \uae0d\uc815\uc801, \ubd80\uc815\uc801 \ub2e8\uc5b4\uc758 \ube48\ub3c4\ub97c \uacc4\uc0b0\ud558\uace0, \uadf8 \ucc28\uc774\ub97c \ud1b5\ud574 \uc804\uccb4\uc801\uc778 \uac10\uc131\uc744 \ud3c9\uac00\ud569\ub2c8\ub2e4.<\/p>\n\n\n<style>.kb-image2284_53ccc3-0b .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-image2284_53ccc3-0b img.kb-img, .kb-image2284_53ccc3-0b .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-image2284_53ccc3-0b\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"288\" height=\"51\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-10.jpg\" alt=\"\uac10\uc131 \ubd84 \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\" class=\"kb-img wp-image-2292\"\/><\/figure><\/div>\n\n\n\n<p>\uc774 \ud45c\ub294 \uc5f0\uc124\uc758 \uac10\uc131 \ubd84\uc11d\uc744 \uc694\uc57d\ud55c \uac83\uc785\ub2c8\ub2e4. \uc5f0\uc124\uc5d0\ub294 290\uac1c\uc758 \ubd80\uc815\uc801\uc778 \ub2e8\uc5b4\uc640 329\uac1c\uc758 \uae0d\uc815\uc801\uc778 \ub2e8\uc5b4\uac00 \ud3ec\ud568\ub418\uc5b4 \uc788\uc73c\uba70, \uc774\ub294 \uc21c \uae0d\uc815 \uac10\uc131 \uc810\uc218 39\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. \uc774\ub294 \uc804\ubc18\uc801\uc73c\ub85c \uc57d\uac04 \ub354 \uae0d\uc815\uc801\uc778 \ud1a4\uc744 \ubcf4\uc784\uc744 \uc758\ubbf8\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">4. \ubc14\uc774\uadf8\ub7a8 \ubd84\uc11d<\/h3>\n\n\n\n<p>\ub2e8\uc5b4 \uc30d(\ubc14\uc774\uadf8\ub7a8)\uc744 \ubd84\uc11d\ud558\uc5ec \uc790\uc8fc \ud568\uaed8 \uc0ac\uc6a9\ub41c \ub2e8\uc5b4 \uc30d\uc744 \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \ubc14\uc774\uadf8\ub7a8 \ubd84\uc11d<br>bigrams &lt;- tibble(text = text) %&gt;%<br>    unnest_tokens(bigram, text, token = \"ngrams\", n = 2)<br><br>bigram_counts &lt;- bigrams %&gt;%<br>    separate(bigram, c(\"word1\", \"word2\"), sep = \" \") %&gt;%<br>    filter(!word1 %in% stop_words$word) %&gt;%<br>    filter(!word2 %in% stop_words$word) %&gt;%<br>    count(word1, word2, sort = TRUE)<br><br># \uc0c1\uc704 15\uac1c \ubc14\uc774\uadf8\ub7a8 \uc2dc\uac01\ud654<br>bigram_graph &lt;- bigram_counts[1:15,] %&gt;%<br>    graph_from_data_frame()<br><br>ggraph(bigram_graph, layout = \"fr\") +<br>    geom_edge_link(aes(edge_alpha = n), show.legend = FALSE) +<br>    geom_node_point(color = \"lightblue\", size = 5) +<br>    geom_node_text(aes(label = name), vjust = 1, hjust = 1) +<br>    theme_void() +<br>    labs(title = \"Top 15 Bigrams in Trump's 2024 RNC Acceptance Speech\")<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uc0c1\uc704 15\uac1c\uc758 \ub2e8\uc5b4 \uc30d\uc744 \uc2dc\uac01\ud654\ud558\uc5ec \uc5f0\uc124\uc5d0\uc11c \uc790\uc8fc \ud568\uaed8 \uc0ac\uc6a9\ub41c \ub2e8\uc5b4 \uc30d\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.<\/p>\n\n\n<style>.kb-image2284_81cc27-7e .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-image2284_81cc27-7e img.kb-img, .kb-image2284_81cc27-7e .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-image2284_81cc27-7e\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"441\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13-600x441.jpg\" alt=\"\ubc14\uc774\uadf8\ub7a8 \uc2dc\uac01\ud654\" class=\"kb-img wp-image-2297\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13-600x441.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13-300x220.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13-768x564.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-13.jpg 1156w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>\uc774 \uadf8\ub798\ud504\ub294 \uc5f0\uc124\uc5d0\uc11c \uac00\uc7a5 \ub9ce\uc774 \uc0ac\uc6a9\ub41c \uc0c1\uc704 15\uac1c\uc758 \ubc14\uc774\uadf8\ub7a8(\ub450 \ub2e8\uc5b4\ub85c \uc774\ub8e8\uc5b4\uc9c4 \uad6c)\uc744 \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. &#8220;they&#8217;re coming(\uadf8\ub4e4\uc774 \uc624\uace0 \uc788\ub2e4)&#8221;, &#8220;border patrol(\uad6d\uacbd \uc21c\ucc30)&#8221;, &#8220;illegal aliens(\ubd88\ubc95 \uc774\ubbfc\uc790)&#8221;\uc640 \uac19\uc740 \uad6c\uc808\uc740 \uc774\ubbfc \ubb38\uc81c\uc5d0 \ub300\ud55c \uc6b0\ub824\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. &#8220;incredible people(\ub180\ub77c\uc6b4 \uc0ac\ub78c\ub4e4)&#8221;, &#8220;worst administration(\ucd5c\uc545\uc758 \ud589\uc815\ubd80)&#8221;\uc640 \uac19\uc740 \ub2e4\ub978 \uc911\uc694\ud55c \ubc14\uc774\uadf8\ub7a8\uc740 \uce6d\ucc2c\uacfc \ube44\ud310\uc758 \uc8fc\uc81c\ub97c \ub4dc\ub7ec\ub0c5\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">5. TF-IDF \ubd84\uc11d<\/h3>\n\n\n\n<p>TF-IDF \ubd84\uc11d\uc744 \ud1b5\ud574 \ubb38\uc7a5\uc5d0\uc11c \uc911\uc694\ud55c \ub2e8\uc5b4\ub97c \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">r\ucf54\ub4dc \ubcf5\uc0ac<code># \ubb38\uc7a5\uc744 \ub2e8\uc704\ub85c \ub098\ub204\uae30<br>sentences &lt;- tibble(sentence = unlist(str_split(text, \"\\\\. \"))) %&gt;%<br>    mutate(sentence_id = row_number())<br><br>tfidf &lt;- sentences %&gt;%<br>    unnest_tokens(word, sentence) %&gt;%<br>    count(sentence_id, word, sort = TRUE) %&gt;%<br>    bind_tf_idf(word, sentence_id, n)<br><br># \uc0c1\uc704 TF-IDF \ub2e8\uc5b4 \uc2dc\uac01\ud654<br>tfidf %&gt;%<br>    arrange(desc(tf_idf)) %&gt;%<br>    mutate(word = factor(word, levels = rev(unique(word)))) %&gt;%<br>    group_by(sentence_id) %&gt;%<br>    top_n(5) %&gt;%<br>    ungroup() %&gt;%<br>    ggplot(aes(word, tf_idf, fill = sentence_id)) +<br>    geom_col(show.legend = FALSE) +<br>    labs(x = NULL, y = \"tf-idf\", title = \"Top TF-IDF Words by Sentence in Trump's Speech\") +<br>    facet_wrap(~sentence_id, ncol = 2, scales = \"free\") +<br>    coord_flip()<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uac01 \ubb38\uc7a5\uc5d0\uc11c TF-IDF \uac12\uc774 \ub192\uc740 \ub2e8\uc5b4\ub97c \uc2dc\uac01\ud654\ud558\uc5ec \uc911\uc694\ud55c \ub2e8\uc5b4\ub97c \ud30c\uc545\ud569\ub2c8\ub2e4.(\uc774 \ubd80\ubd84\uc740 \uc870\uae08 \ub354 \ubcf4\uc644\uc774 \ud544\uc694\ud560 \uac83 \uac19\uc2b5\ub2c8\ub2e4.)<\/p>\n\n\n<style>.kb-image2284_46dbcd-df .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-image2284_46dbcd-df img.kb-img, .kb-image2284_46dbcd-df .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-image2284_46dbcd-df\"><figure class=\"aligncenter size-large\"><a href=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14.jpg\" class=\"kb-advanced-image-link\"><img decoding=\"async\" width=\"600\" height=\"348\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14-600x348.jpg\" alt=\"TF-IDF \uc2dc\uac01\ud654\" class=\"kb-img wp-image-2298\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14-600x348.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14-300x174.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14-768x446.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-14.jpg 915w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><\/figure><\/div>\n\n\n\n<p>\uc774 \ud50c\ub86f\uc740 \ubb38\uc7a5\ubcc4\ub85c \uc0c1\uc704 TF-IDF(\uc6a9\uc5b4 \ube48\ub3c4-\uc5ed \ubb38\uc11c \ube48\ub3c4) \ub2e8\uc5b4\ub97c \ubcf4\uc5ec\uc8fc\uba70, \uc5f0\uc124\uc758 \ub2e4\uc591\ud55c \ubd80\ubd84\uc5d0\uc11c \uc0ac\uc6a9\ub41c \ub3c5\ud2b9\ud558\uace0 \uc911\uc694\ud55c \uc6a9\uc5b4\ub4e4\uc744 \uac15\uc870\ud569\ub2c8\ub2e4. \uac01 \ub2e8\uc5b4\uc758 \uc911\uc694\uc131\uc740 TF-IDF \uc810\uc218\ub85c \ub098\ud0c0\ub098\uba70, &#8220;economy(\uacbd\uc81c)&#8221;, &#8220;jobs(\uc77c\uc790\ub9ac)&#8221;, &#8220;taxes(\uc138\uae08)&#8221;\uc640 \uac19\uc740 \ub2e8\uc5b4\ub4e4\uc774 \ud2b9\uc815 \ubb38\uc7a5\uc5d0\uc11c \uc911\uc694\ud55c \uc8fc\uc81c\ub97c \ubc18\uc601\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">6. \uc8fc\uc81c\ubcc4 \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<\/h3>\n\n\n\n<p>\uc8fc\uc81c\ubcc4\ub85c \ub2e8\uc5b4 \ube48\ub3c4\ub97c \ubd84\uc11d\ud558\uc5ec \uc5f0\uc124\uc5d0\uc11c \ub2e4\ub8ec \uc8fc\uc694 \uc8fc\uc81c\ub97c \ud655\uc778\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \uc8fc\uc81c\ubcc4 \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<br>topics &lt;- c(\"economy\", \"immigration\", \"foreign_policy\", \"social_issues\")<br>topic_words &lt;- list(<br>    economy = c(\"economy\", \"jobs\", \"taxes\", \"inflation\", \"business\"),<br>    immigration = c(\"border\", \"immigration\", \"illegal\", \"wall\"),<br>    foreign_policy = c(\"war\", \"peace\", \"military\", \"allies\", \"enemies\"),<br>    social_issues = c(\"education\", \"healthcare\", \"crime\", \"family\", \"values\")<br>)<br><br>topic_frequency &lt;- words %&gt;%<br>    mutate(topic = case_when(<br>        word %in% topic_words$economy ~ \"Economy\",<br>        word %in% topic_words$immigration ~ \"Immigration\",<br>        word %in% topic_words$foreign_policy ~ \"Foreign Policy\",<br>        word %in% topic_words$social_issues ~ \"Social Issues\",<br>        TRUE ~ \"Other\"<br>    )) %&gt;%<br>    count(topic) %&gt;%<br>    filter(topic != \"Other\")<br><br>ggplot(topic_frequency, aes(x = reorder(topic, n), y = n, fill = topic)) +<br>    geom_col() +<br>    coord_flip() +<br>    labs(title = \"Frequency of Topics in Trump's 2024 RNC Acceptance Speech\",<br>         x = \"Topic\", y = \"Frequency\") +<br>    theme_minimal()<\/code><\/pre>\n\n\n\n<p>\uc774 \ucf54\ub4dc\ub294 \uc5f0\uc124\uc5d0\uc11c \ub2e4\ub8ec \uc8fc\uc694 \uc8fc\uc81c\ubcc4 \ub2e8\uc5b4 \ube48\ub3c4\ub97c \uc2dc\uac01\ud654\ud558\uc5ec, \uac01 \uc8fc\uc81c\uc758 \uc911\uc694\uc131\uc744 \ud30c\uc545\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n<style>.kb-image2284_3affbc-cd .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-image2284_3affbc-cd img.kb-img, .kb-image2284_3affbc-cd .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-image2284_3affbc-cd\"><figure class=\"aligncenter size-large\"><img decoding=\"async\" width=\"600\" height=\"348\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-11-600x348.jpg\" alt=\"\uc8fc\uc81c\ubcc4 \ub2e8\uc5b4 \ube48\ub3c4 \uc2dc\uac01\ud654\" class=\"kb-img wp-image-2293\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-11-600x348.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-11-300x174.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-11-768x446.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/image-11.jpg 915w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/figure><\/div>\n\n\n\n<p>\uc774 \ub9c9\ub300 \uadf8\ub798\ud504\ub294 \ud2b8\ub7fc\ud504 \uc5f0\uc124\uc758 \uc8fc\uc81c\ub97c \uacbd\uc81c, \uc774\ubbfc, \uc678\uad50 \uc815\ucc45, \uc0ac\ud68c \ubb38\uc81c\ub85c \ubd84\ub958\ud558\uc5ec \uc8fc\uc81c\ubcc4 \ube48\ub3c4\ub97c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4. \uacbd\uc81c\ub294 \uac00\uc7a5 \ub9ce\uc774 \ub17c\uc758\ub41c \uc8fc\uc81c\uc774\uba70, \uadf8 \ub2e4\uc74c\uc73c\ub85c \uc774\ubbfc, \uc678\uad50 \uc815\ucc45, \uc0ac\ud68c \ubb38\uc81c\uac00 \ub4a4\ub530\ub985\ub2c8\ub2e4. \uc774 \ubd84\ub958\ub294 \uc5f0\uc124\uc758 \uc8fc\uc694 \ucd08\uc810 \uc601\uc5ed\uc744 \ub4dc\ub7ec\ub0b4\uba70, \uacbd\uc81c \ubb38\uc81c\uc640 \uc774\ubbfc \ubb38\uc81c\uc5d0 \ub300\ud55c \uac15\uc870\ub97c \ubcf4\uc5ec\uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uacf5\ud1b5\uc801\uc778 \uc2e4\uc218\uc640 \ud574\uacb0 \ubc29\ubc95<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">\ub370\uc774\ud130 \uc804\ucc98\ub9ac\uc758 \uc911\uc694\uc131<\/h3>\n\n\n\n<p>\ud14d\uc2a4\ud2b8 \ub370\uc774\ud130 \ubd84\uc11d\uc5d0\uc11c \uac00\uc7a5 \uc911\uc694\ud55c \uac83\uc740 \ub370\uc774\ud130 \uc804\ucc98\ub9ac\uc785\ub2c8\ub2e4. \ubd88\uc6a9\uc5b4 \uc81c\uac70, \ud14d\uc2a4\ud2b8 \uc815\uaddc\ud654, \ucca0\uc790 \uc218\uc815 \ub4f1\uc740 \ubd84\uc11d\uc758 \uc815\ud655\uc131\uc744 \ud06c\uac8c \ud5a5\uc0c1\uc2dc\ud0b5\ub2c8\ub2e4. \uc774\ub7ec\ud55c \uc791\uc5c5\uc744 \uc18c\ud640\ud788 \ud558\uba74 \ubd84\uc11d \uacb0\uacfc\uac00 \uc65c\uace1\ub420 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\uc801\uc808\ud55c \uc2dc\uac01\ud654 \ub3c4\uad6c \uc120\ud0dd<\/h3>\n\n\n\n<p>\ubd84\uc11d \ubaa9\uc801\uc5d0 \ub9de\ub294 \uc2dc\uac01\ud654 \ub3c4\uad6c\ub97c \uc120\ud0dd\ud558\ub294 \uac83\uc774 \uc911\uc694\ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d\uc5d0\ub294 \ub9c9\ub300 \uadf8\ub798\ud504\uac00 \ud6a8\uacfc\uc801\uc774\uc9c0\ub9cc, \uac10\uc131 \ubd84\uc11d\uc5d0\ub294 \ud30c\uc774 \ucc28\ud2b8\ub098 \ub9c9\ub300 \uadf8\ub798\ud504\uac00 \ub354 \uc801\ud569\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub2e4\uc591\ud55c \uc2dc\uac01\ud654 \ub3c4\uad6c\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ub97c \ub2e4\uac01\ub3c4\ub85c \ubd84\uc11d\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\uc804\uccb4 \uc18c\uc2a4 \ucf54\ub4dc \ubc0f \uacb0\uacfc<\/h2>\n\n\n\n<p>\uc704\uc5d0\uc11c \ub2e4\ub8ec \ubaa8\ub4e0 \ucf54\ub4dc\ub97c \uc885\ud569\ud558\uc5ec \ub2e4\uc2dc \ud55c\ubc88 \uc694\uc57d\ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><code># \ud544\uc694\ud55c \ud328\ud0a4\uc9c0 \uc124\uce58 \ubc0f \ub85c\ub4dc<br>required_packages &lt;- c(\"tidytext\", \"dplyr\", \"ggplot2\", \"stringr\", \"igraph\", \"ggraph\", \"readr\", \"textdata\", \"wordcloud2\", \"htmlwidgets\", \"tidyr\", \"showtext\")<br>new_packages &lt;- required_packages[!(required_packages %in% installed.packages()[,\"Package\"])]<br>if(length(new_packages)) install.packages(new_packages)<br>lapply(required_packages, require, character.only = TRUE)<br>showtext_auto()<br><br># \ud14d\uc2a4\ud2b8 \ud30c\uc77c \uc77d\uae30<br>file_path &lt;- \"C:\\\\R\\\\Project\\\\secondlife-r\\\\Trump_2024_RNC_Acceptance_Speech.txt\"<br>text &lt;- read_file(file_path)<br><br># \ud14d\uc2a4\ud2b8\ub97c \ub2e8\uc5b4\ub85c \ud1a0\ud070\ud654 \ubc0f \ubd88\uc6a9\uc5b4 \uc81c\uac70<br>words &lt;- tibble(text = text) %&gt;%<br>    unnest_tokens(word, text) %&gt;%<br>    anti_join(stop_words)<br><br># \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<br>word_freq &lt;- words %&gt;%<br>    count(word, sort = TRUE)<br>ggplot(word_freq[1:20,], aes(x = reorder(word, n), y = n, label = n)) +<br>    geom_col() +<br>    geom_text(hjust = -0.1, color = \"black\") +<br>    coord_flip() +<br>    labs(title = \"Top 20 Words in Trump's 2024 RNC Acceptance Speech\", x = \"Word\", y = \"Frequency\")<br><br># \uc6cc\ub4dc\ud074\ub77c\uc6b0\ub4dc \uc0dd\uc131<br>set.seed(1234)<br>wordcloud_data &lt;- word_freq %&gt;%<br>    filter(n &gt; 1) %&gt;%<br>    head(100)<br>wc &lt;- wordcloud2(data = wordcloud_data, size = 1, color = \"random-dark\", backgroundColor = \"white\", rotateRatio = 0.3, shape = \"circle\")<br>saveWidget(wc, \"wordcloud_trump_2024.html\", selfcontained = TRUE)<br><br># \uac10\uc131 \ubd84\uc11d<br>sentiments &lt;- get_sentiments(\"bing\")<br>sentiment_analysis &lt;- words %&gt;%<br>    inner_join(sentiments) %&gt;%<br>    count(sentiment) %&gt;%<br>    pivot_wider(names_from = sentiment, values_from = n, values_fill = 0) %&gt;%<br>    mutate(sentiment = positive - negative)<br>print(sentiment_analysis)<br><br># \ubc14\uc774\uadf8\ub7a8 \ubd84\uc11d<br>bigrams &lt;- tibble(text = text) %&gt;%<br>    unnest_tokens(bigram, text, token = \"ngrams\", n = 2)<br>bigram_counts &lt;- bigrams %&gt;%<br>    separate(bigram, c(\"word1\", \"word2\"), sep = \" \") %&gt;%<br>    filter(!word1 %in% stop_words$word) %&gt;%<br>    filter(!word2 %in% stop_words$word) %&gt;%<br>    count(word1, word2, sort = TRUE)<br>bigram_graph &lt;- bigram_counts[1:15,] %&gt;%<br>    graph_from_data_frame()<br>ggraph(bigram_graph, layout = \"fr\") +<br>    geom_edge_link(aes(edge_alpha = n), show.legend = FALSE) +<br>    geom_node_point(color = \"lightblue\", size = 5) +<br>    geom_node_text(aes(label = name), vjust = 1, hjust = 1) +<br>    theme_void() +<br>    labs(title = \"Top 15 Bigrams in Trump's 2024 RNC Acceptance Speech\")<br><br># TF-IDF \ubd84\uc11d<br>sentences &lt;- tibble(sentence = unlist(str_split(text, \"\\\\. \"))) %&gt;%<br>    mutate(sentence_id = row_number())<br>tfidf &lt;- sentences %&gt;%<br>    unnest_tokens(word, sentence) %&gt;%<br>    count(sentence_id, word, sort = TRUE) %&gt;%<br>    bind_tf_idf(word, sentence_id, n)<br>tfidf %&gt;%<br>    arrange(desc(tf_idf)) %&gt;%<br>    mutate(word = factor(word, levels = rev(unique(word)))) %&gt;%<br>    group_by(sentence_id) %&gt;%<br>    top_n(5) %&gt;%<br>    ungroup() %&gt;%<br>    ggplot(aes(word, tf_idf, fill = sentence_id)) +<br>    geom_col(show.legend = FALSE) +<br>    labs(x = NULL, y = \"tf-idf\", title = \"Top TF-IDF Words by Sentence in Trump's Speech\") +<br>    facet_wrap(~sentence_id, ncol = 2, scales = \"free\") +<br>    coord_flip()<br><br># \uc8fc\uc81c\ubcc4 \ub2e8\uc5b4 \ube48\ub3c4 \ubd84\uc11d<br>topics &lt;- c(\"economy\", \"immigration\", \"foreign_policy\", \"social_issues\")<br>topic_words &lt;- list(<br>    economy = c(\"economy\", \"jobs\", \"taxes\", \"inflation\", \"business\"),<br>    immigration = c(\"border\", \"immigration\", \"illegal\", \"wall\"),<br>    foreign_policy = c(\"war\", \"peace\", \"military\", \"allies\", \"enemies\"),<br>    social_issues = c(\"education\", \"healthcare\", \"crime\", \"family\", \"values\")<br>)<br>topic_frequency &lt;- words %&gt;%<br>    mutate(topic = case_when(<br>        word %in% topic_words$economy ~ \"Economy\",<br>        word %in% topic_words$immigration ~ \"Immigration\",<br>        word %in% topic_words$foreign_policy ~ \"Foreign Policy\",<br>        word %in% topic_words$social_issues ~ \"Social Issues\",<br>        TRUE ~ \"Other\"<br>    )) %&gt;%<br>    count(topic) %&gt;%<br>    filter(topic != \"Other\")<br>ggplot(topic_frequency, aes(x = reorder(topic, n), y = n, fill = topic)) +<br>    geom_col() +<br>    coord_flip() +<br>    labs(title = \"Frequency of Topics in Trump's 2024 RNC Acceptance Speech\", x = \"Topic\", y = \"Frequency\") +<br>    theme_minimal()<br><\/code><\/pre>\n\n\n\n<p>\uc704 \ucf54\ub4dc\ub97c \uc2e4\ud589\ud558\uba74 \ud2b8\ub7fc\ud504\uc758 \uc5f0\uc124\uc744 \ub2e4\uc591\ud55c \uce21\uba74\uc5d0\uc11c \ubd84\uc11d\ud55c \uacb0\uacfc\ub97c \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uac01 \ubd84\uc11d\uc740 \uc5f0\uc124\uc758 \uc8fc\uc694 \ub2e8\uc5b4, \uac10\uc131, \ubc14\uc774\uadf8\ub7a8, TF-IDF, \uc8fc\uc81c\ubcc4 \ube48\ub3c4 \ub4f1\uc744 \uc2dc\uac01\ud654\ud558\uc5ec \uc5f0\uc124\uc758 \uc804\ubc18\uc801\uc778 \ub0b4\uc6a9\uc744 \uc774\ud574\ud558\ub294 \ub370 \ub3c4\uc6c0\uc744 \uc90d\ub2c8\ub2e4.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ub9c8\ubb34\ub9ac<\/h2>\n\n\n\n<p>\uc804\uccb4\uc801\uc73c\ub85c, \ub3c4\ub110\ub4dc \ud2b8\ub7fc\ud504\uc758 2024\ub144 RNC \uc218\ub77d \uc5f0\uc124\uc740 &#8220;people(\uc0ac\ub78c\ub4e4)&#8221;, &#8220;country(\uad6d\uac00)&#8221;, &#8220;America(\ubbf8\uad6d)&#8221;\uc640 \uac19\uc740 \ub2e8\uc5b4\uc758 \ube48\ub3c4\uac00 \ub192\uc740 \uac83\uc744 \ud1b5\ud574 \uad6d\uac00 \uc815\uccb4\uc131\uacfc \uc560\uad6d\uc2ec \uc8fc\uc81c\ub97c \uac15\ud558\uac8c \uac15\uc870\ud558\uace0 \uc788\uc74c\uc744 \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5f0\uc124\uc740 \uc774\ubbfc \ubc0f \ud589\uc815\ubd80 \ube44\ud310\uacfc \uac19\uc740 \ubb38\uc81c\ub4e4\uc744 \ub2e4\ub8e8\uba74\uc11c\ub3c4 \uc21c \uae0d\uc815 \uac10\uc131\uc744 \uc720\uc9c0\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \ud2b9\uc815 \uc8fc\uc81c, \ud2b9\ud788 \uacbd\uc81c\uc640 \uc774\ubbfc\uc5d0 \ub300\ud55c \ucd08\uc810\uc740 \ud2b8\ub7fc\ud504\uc758 \uc8fc\uc694 \uc815\uce58\uc801 \uc6b0\uc120\uc21c\uc704\uc640 \uc77c\uce58\ud569\ub2c8\ub2e4. TF-IDF \ubd84\uc11d\uacfc \ubc14\uc774\uadf8\ub7a8 \uc2dc\uac01\ud654\uc5d0\uc11c \ud655\uc778\ub41c \uc0c1\uc138\ud55c \ub2e8\uc5b4 \uc0ac\uc6a9\uacfc \uc911\uc694\ud55c \uad6c\uc808\ub4e4\uc740 \uc774\ub7ec\ud55c \uc8fc\uc81c\ub97c \ub354\uc6b1 \ubd80\uac01\uc2dc\ud0a4\uba70, \uc5f0\uc124\uc758 \ub0b4\uc6a9\uacfc \ucd08\uc810\uc744 \uc885\ud569\uc801\uc73c\ub85c \uc774\ud574\ud560 \uc218 \uc788\uac8c \ud569\ub2c8\ub2e4.<\/p>\n\n\n\n<p>\uc774\ubc88 \ud3ec\uc2a4\ud2b8\uc5d0\uc11c\ub294 R\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud14d\uc2a4\ud2b8 \ub370\uc774\ud130\ub97c \ubd84\uc11d\ud558\uace0 \uc2dc\uac01\ud654\ud558\ub294 \ubc29\ubc95\uc744 \ub2e4\ub918\uc2b5\ub2c8\ub2e4. \ud2b8\ub7fc\ud504\uc758 \uc5f0\uc124\uc744 \uc608\uc2dc\ub85c \uc0ac\uc6a9\ud558\uc5ec \ub2e4\uc591\ud55c \ud14d\uc2a4\ud2b8\ub9c8\uc774\ub2dd \uae30\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc558\uc2b5\ub2c8\ub2e4. \uc774 \ubc29\ubc95\ub4e4\uc744 \ud1b5\ud574 \ud14d\uc2a4\ud2b8 \ub370\uc774\ud130\uc5d0\uc11c \uc720\uc758\ubbf8\ud55c \ud1b5\ucc30\uc744 \uc5bb\uc744 \uc218 \uc788\uae30\ub97c \ubc14\ub78d\ub2c8\ub2e4.<\/p>\n\n\n\n<p><em>**RNC:  &#8220;Republican National Committee&#8221;\uc758 \uc57d\uc790\ub85c, \ubbf8\uad6d \uacf5\ud654\ub2f9\uc758 \uc804\uad6d \uc704\uc6d0\ud68c\ub97c \uc758\ubbf8\ud569\ub2c8\ub2e4. RNC\ub294 \uacf5\ud654\ub2f9\uc758 \uacf5\uc2dd \uc870\uc9c1\uc73c\ub85c, \ub2f9\uc758 \uc804\ub7b5\uc744 \uae30\ud68d\ud558\uace0 \uc120\uac70 \ucea0\ud398\uc778\uc744 \uc9c0\uc6d0\ud558\uba70 \ub2f9\uc758 \uc8fc\uc694 \ud589\uc0ac\ub97c \uc870\uc9c1\ud569\ub2c8\ub2e4. \uc5ec\uae30\uc5d0\ub294 \ub300\uc120 \ud6c4\ubcf4\ub97c \uc9c0\uba85\ud558\ub294 \uc804\ub2f9\ub300\ud68c(Republican National Convention)\ub3c4 \ud3ec\ud568\ub429\ub2c8\ub2e4.<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>2024\u5e747\u670819\u65e5\uff08\u73fe\u5730\u65e5\u4ed8\uff09\u306b\u30c9\u30ca\u30eb\u30c9\u30fb\u30c8\u30e9\u30f3\u30d7\u306e\u5927\u7d71\u9818\u5019\u88dc\u53d7\u8afe\u6f14\u8aac\u304c\u3042\u308a\u307e\u3057\u305f....\u3002<\/p>","protected":false},"author":3,"featured_media":2300,"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,38,184,164,183],"class_list":["post-2284","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-ggplot2","tag-r","tag-wordcloud","tag-164","tag-183"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":176,"label":"ggplot2"},{"value":38,"label":"R"},{"value":184,"label":"wordcloud"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":183,"label":"\ud14d\uc2a4\ud2b8 \ubd84\uc11d"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/07\/text-mining-thumbnail-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/ja\/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":38,"name":"R","slug":"r","term_group":0,"term_taxonomy_id":38,"taxonomy":"post_tag","description":"","parent":0,"count":9,"filter":"raw"},{"term_id":184,"name":"wordcloud","slug":"wordcloud","term_group":0,"term_taxonomy_id":184,"taxonomy":"post_tag","description":"","parent":0,"count":1,"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":183,"name":"\ud14d\uc2a4\ud2b8 \ubd84\uc11d","slug":"%ed%85%8d%ec%8a%a4%ed%8a%b8-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":183,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2284","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/comments?post=2284"}],"version-history":[{"count":9,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2284\/revisions"}],"predecessor-version":[{"id":2302,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/posts\/2284\/revisions\/2302"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media\/2300"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/media?parent=2284"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/categories?post=2284"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/ja\/wp-json\/wp\/v2\/tags?post=2284"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}