{"id":4202,"date":"2024-12-26T21:31:23","date_gmt":"2024-12-26T12:31:23","guid":{"rendered":"https:\/\/secondlife.lol\/?p=4202"},"modified":"2024-12-25T21:32:34","modified_gmt":"2024-12-25T12:32:34","slug":"marriage-birth-stacked-bar-graph","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/en\/marriage-birth-stacked-bar-graph\/","title":{"rendered":"Changing Perceptions of Marital Childbearing: Analyzing Data with Stacked Bar Graphs"},"content":{"rendered":"<style>.kb-image4202_ea3596-0f .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-image4202_ea3596-0f img.kb-img, .kb-image4202_ea3596-0f .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-image4202_ea3596-0f\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1120\" height=\"619\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47.jpg\" alt=\"\uacb0\ud63c \ucd9c\uc0b0 \uc778\uc2dd \ubcc0\ud654 \uc774\ubbf8\uc9c0\" class=\"kb-img wp-image-4203\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47.jpg 1120w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47-300x166.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47-600x332.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47-768x424.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-47-18x10.jpg 18w\" sizes=\"(max-width: 1120px) 100vw, 1120px\" \/><figcaption>( <a href=\"https:\/\/www.index.go.kr\/unity\/potal\/com\/selectPoMainBBSBordDtlt.do?publ=Y\" target=\"_blank\" rel=\"noopener\">Illustration from the 2024 Low Birthrate Press Release<\/a> )<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">\"Do you think people should have children when they get married?\"<br>In the past, most of us would have answered \"of course\" to this question, but it's a little different now. Married procreation is no longer a given. <strong>Area of selection<\/strong>and we can see this change in the data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this guide, we covered how to install and configure Oh My OpenCode in a way that even beginners can follow easily. <strong>Data on changing perceptions of childbearing in marriage<\/strong>based on the <strong>Leverage R coding to create <a href=\"https:\/\/secondlife.lol\/en\/national-pension-portfolio-r-visualization\/\" data-type=\"post\" data-id=\"4124\">Stacked Bar Graphs<\/a><\/strong>and explore what this change means. Together, we'll use data to understand how our society is changing and gain the insights we need to prepare for the future.<\/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<h2 class=\"wp-block-heading\">Survey data on marriage and fertility<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here are two years of response data to the question \"If you get married, you should have children\" for the population aged 13 and over, provided by the National Statistics Social Survey. The units are %.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th class=\"has-text-align-center\" data-align=\"center\">Year<\/th><th class=\"has-text-align-center\" data-align=\"center\">Totally agree<\/th><th class=\"has-text-align-center\" data-align=\"center\">Somewhat Agree<\/th><th class=\"has-text-align-center\" data-align=\"center\">Slightly opposite<\/th><th class=\"has-text-align-center\" data-align=\"center\">Totally opposite<\/th><\/tr><\/thead><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\">2018<\/td><td class=\"has-text-align-center\" data-align=\"center\">25.4<\/td><td class=\"has-text-align-center\" data-align=\"center\">44.1<\/td><td class=\"has-text-align-center\" data-align=\"center\">21.9<\/td><td class=\"has-text-align-center\" data-align=\"center\">8.6<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2020<\/td><td class=\"has-text-align-center\" data-align=\"center\">25.5<\/td><td class=\"has-text-align-center\" data-align=\"center\">42.6<\/td><td class=\"has-text-align-center\" data-align=\"center\">22.1<\/td><td class=\"has-text-align-center\" data-align=\"center\">9.8<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2022<\/td><td class=\"has-text-align-center\" data-align=\"center\">21.6<\/td><td class=\"has-text-align-center\" data-align=\"center\">43.8<\/td><td class=\"has-text-align-center\" data-align=\"center\">23.9<\/td><td class=\"has-text-align-center\" data-align=\"center\">10.8<\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">2024<\/td><td class=\"has-text-align-center\" data-align=\"center\">23.4<\/td><td class=\"has-text-align-center\" data-align=\"center\">44.9<\/td><td class=\"has-text-align-center\" data-align=\"center\">22.7<\/td><td class=\"has-text-align-center\" data-align=\"center\">9.0<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Implications of changing perceptions of marital childbearing<\/h2>\n\n\n<style>.kb-image4202_c02943-e7.kb-image-is-ratio-size, .kb-image4202_c02943-e7 .kb-image-is-ratio-size{max-width:646px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image4202_c02943-e7.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image4202_c02943-e7 .kb-image-is-ratio-size{align-self:unset;}.kb-image4202_c02943-e7 figure{max-width:646px;}.kb-image4202_c02943-e7 .image-is-svg, .kb-image4202_c02943-e7 .image-is-svg img{width:100%;}.kb-image4202_c02943-e7 .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-image4202_c02943-e7 img.kb-img, .kb-image4202_c02943-e7 .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-image4202_c02943-e7\"><figure class=\"aligncenter size-medium_large\"><img decoding=\"async\" width=\"768\" height=\"588\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-768x588.png\" alt=\"\uacb0\ud63c \ucd9c\uc0b0 \uc778\uc2dd \ubcc0\ud654 \uc694\uc57d \uadf8\ub9bc\" class=\"kb-img wp-image-4209\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-768x588.png 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-300x230.png 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-600x459.png 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-16x12.png 16w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1.png 818w\" sizes=\"(max-width: 768px) 100vw, 768px\" \/><figcaption>(Summary illustration of changes in perceptions of marital childbearing)<\/figcaption><\/figure><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">When you look at this data, you'll notice a few important trends.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Reduced percentage of fully agree<\/strong>\n<ul class=\"wp-block-list\">\n<li>Decrease from 25.41 TP3T in 2018 to 23.41 TP3T in 2024.<\/li>\n\n\n\n<li>This shows that traditional values about marriage and procreation are gradually eroding.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Increase in dissenting responses<\/strong>\n<ul class=\"wp-block-list\">\n<li>The percentage of both slightly opposed and totally opposed is increasing.<\/li>\n\n\n\n<li>In particular, totally opposed has been on a steady rise, although it has increased slightly from 8.61 TP3T in 2018 to 9.01 TP3T in 2024.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Maintain some consent<\/strong>\n<ul class=\"wp-block-list\">\n<li>The slightly agree percentage changed little, from 44.11 TP3T in 2018 to 44.91 TP3T in 2024.<\/li>\n\n\n\n<li>This shows that many people still feel that they \"need\" to have children, but they don't feel strongly about it.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Create a Stacked Bar Graph with R Coding<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now let's use the data above to create a stacked bar graph in R! This graph shows at a glance how pronounced the changes are.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># Load required libraries\nlibrary(ggplot2)\nlibrary(dplyr)\n\n# Create the dataset\ndata &lt;- data.frame(\n  Year = c(2018, 2020, 2022, 2024),\n  Strongly_Agree = c(25.4, 25.5, 21.6, 23.4),\n  Somewhat_Agree = c(44.1, 42.6, 43.8, 44.9),\n  Somewhat_Disagree = c(21.9, 22.1, 23.9, 22.7),\n  Strongly_Disagree = c(8.6, 9.8, 10.8, 9.0)\n)\n\n# Transform data to long format\ndata_long %\n  tidyr::pivot_longer(\n    cols = starts_with(\"Strongly_\") | starts_with(\"Somewhat_\"),\n    names_to = \"Response\",\n    values_to = \"Percentage\"\n  )\n\n# Set response order\ndata_long$Response &lt;- factor(\n  data_long$Response,\n  levels = c(&quot;Strongly_Agree&quot;, &quot;Somewhat_Agree&quot;, &quot;Somewhat_Disagree&quot;, &quot;Strongly_Disagree&quot;)\n)\n\n# Create stacked bar graph\nggplot(data_long, aes(x = factor(Year), y = Percentage, fill = Response)) +\n  geom_bar(stat = &quot;identity&quot;, position = position_stack(reverse = TRUE), color = &quot;black&quot;) +\n  geom_text(aes(label = round(Percentage, 1)),\n            position = position_stack(vjust = 0.5, reverse = TRUE), size = 3.5, color = &quot;white&quot;) +\n  scale_fill_manual(\n    values = c(\n      &quot;Strongly_Agree&quot; = &quot;#74C476&quot;,\n      &quot;Somewhat_Agree&quot; = &quot;#31A354&quot;,\n      &quot;Somewhat_Disagree&quot; = &quot;#FD8D3C&quot;,\n      &quot;Strongly_Disagree&quot; = &quot;#E31A1C&quot;\n    ),\n    labels = c(&quot;Strongly Agree&quot;, &quot;Somewhat Agree&quot;, &quot;Somewhat Disagree&quot;, &quot;Strongly Disagree&quot;)\n  ) +\n  labs(\n    title = &quot;Changes in Opinions About Having Children After Marriage&quot;,\n    x = &quot;Year&quot;,\n    y = &quot;Percentage (%)&quot;,\n    fill = &quot;Response&quot;\n  ) + \u0392\n  theme_minimal() +\n  theme(\n    plot.title = element_text(hjust = 0.5, size = 16, face = &quot;bold&quot;),\n    axis.title = element_text(size = 12),\n    axis.text = element_text(size = 10),\n    legend.title = element_text(size = 12),\n    legend.text = element_text(size = 10)\n  ) +\n  coord_flip()\n<\/code><\/pre>\n\n\n<style>.kb-image4202_7c9c19-6d .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-image4202_7c9c19-6d img.kb-img, .kb-image4202_7c9c19-6d .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-image4202_7c9c19-6d\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1049\" height=\"528\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48.jpg\" alt=\"\uacb0\ud63c \ucd9c\uc0b0 \uc778\uc2dd \ubcc0\ud654 - R \uc2dc\uac01\ud654 \ub204\uc801\ub9c9\ub300\uadf8\ub798\ud504\" class=\"kb-img wp-image-4205\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48.jpg 1049w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48-300x151.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48-600x302.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48-768x387.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/image-1-48-18x9.jpg 18w\" sizes=\"(max-width: 1049px) 100vw, 1049px\" \/><figcaption>(Change in perception of marital fertility - R visualization stacked bar graph)<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Wrapping up<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Data can help us understand change and make better decisions. More than just numbers, the shifts in attitudes toward marriage and childbearing are a clear indication of how our society is changing, and it's important for policymakers and individuals alike to understand how we view marriage and childbearing differently than in the past.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Stacked bar graphs are a great way to visually unpack complex data, and with the R code in this article, you can visualize and analyze your own data. You'll be able to understand the nature of your problems and find new solutions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">While marital reproduction is a personal choice, it's clear that it plays an important role in moving toward a sustainable society. Whatever insights you take away from this data, we hope it's a small seed for building a better future.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">As a side note, how did the change in attitudes toward childbearing after marriage play out in the total fertility rate? <a href=\"https:\/\/secondlife.lol\/en\/total-fertility-rate-r-trendy-visualization\/\" data-type=\"post\" data-id=\"4187\">Total Fertility Rate Definition and Calculation: Trendy Visualizations with R<\/a> Check out the post to learn more. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">#<strong>Code breakdown<\/strong><\/h3>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<h4 class=\"wp-block-heading\">1. load the library<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>library(ggplot2)\nlibrary(dplyr)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ggplot2: A powerful graphics library for data visualization<\/li>\n\n\n\n<li>DPLYR: Providing efficient tools for data manipulation<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">2. Create a dataset<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>data &lt;- data.frame(\n  Year = c(2018, 2020, 2022, 2024),\n  Strongly_Agree = c(25.4, 25.5, 21.6, 23.4),\n  Somewhat_Agree = c(44.1, 42.6, 43.8, 44.9),\n  Somewhat_Disagree = c(21.9, 22.1, 23.9, 22.7),\n  Strongly_Disagree = c(8.6, 9.8, 10.8, 9.0)\n)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a dataframe with response rates by year<\/li>\n\n\n\n<li>Each column represents a percentage by year and response type<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">3. transform your data<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>data_long %\n  tidyr::pivot_longer(\n    cols = starts_with(\"Strongly_\") | starts_with(\"Somewhat_\"),\n    names_to = \"Response\",\n    values_to = \"Percentage\"\n  )<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Convert data to long format using the tidyr::pivot_longer() function<\/li>\n\n\n\n<li>Convert columns that start with 'Strongly_' or 'Somewhat_' to 'Response' columns<\/li>\n\n\n\n<li>Move those values to the 'Percentage' column<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">4. Set the response order<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>data_long$Response &lt;- factor(\n  data_long$Response,\n  levels = c(&quot;Strongly_Agree&quot;, &quot;Somewhat_Agree&quot;, &quot;Somewhat_Disagree&quot;, &quot;Strongly_Disagree&quot;)\n)<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Convert Response column to factor to sort in a specific order<\/li>\n\n\n\n<li>This determines the order of the bars in the graph<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">5. Create a graph<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>ggplot(data_long, aes(x = factor(Year), y = Percentage, fill = Response)) +\n  geom_bar(stat = \"identity\", position = position_stack(reverse = TRUE), color = \"black\") +\n  geom_text(aes(label = round(Percentage, 1)),\n            position = position_stack(vjust = 0.5, reverse = TRUE), size = 3.5, color = \"white\") +<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Create a basic graph object with ggplot()<\/li>\n\n\n\n<li>Create a bar graph with geom_bar(), stack bars with position_stack()<\/li>\n\n\n\n<li>Show percentage values inside each bar with geom_text()<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">6. set colors and labels<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  scale_fill_manual(\n    values = c(\n      \"Strongly_Agree\" = \"#74C476\",\n      \"Somewhat_Agree\" = \"#31A354\",\n      \"Somewhat_Disagree\" = \"#FD8D3C\",\n      \"Strongly_Disagree\" = \"#E31A1C\"\n    ),\n    labels = c(\"Strongly Agree\", \"Somewhat Agree\", \"Somewhat Disagree\", \"Strongly Disagree\")\n  )<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Specifying colors for each response type with scale_fill_manual()<\/li>\n\n\n\n<li>Setting the label text for the legend with the labels parameter<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">7. set the graph title and axis labels<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  labs(\n    title = \"Changes in Opinions About Having Children After Marriage\",\n    x = \"Year\",\n    y = \"Percentage (%)\",\n    fill = \"Response\"\n  ) +<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Set graph title, x-axis label, y-axis label, and legend title with labs() function<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">8. Theme and style settings<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  theme_minimal() +\n  theme(\n    plot.title = element_text(hjust = 0.5, size = 16, face = \"bold\"),\n    axis.title = element_text(size = 12),\n    axis.text = element_text(size = 10),\n    legend.title = element_text(size = 12),\n    legend.text = element_text(size = 10)\n  )<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Apply the default minimal theme with theme_minimal()<\/li>\n\n\n\n<li>Use the theme() function to fine-style titles, axis labels, legends, etc.<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">9. flip the axis<\/h4>\n\n\n\n<pre class=\"wp-block-code\"><code>  coord_flip()<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Flip the x and y axes with coord_flip() to convert to a horizontal bar graph<\/li>\n<\/ul>\n<\/blockquote>","protected":false},"excerpt":{"rendered":"<p>\"Do you think people should have children when they get married?\"This question, in the past, would probably have been answered by most people with a resounding \"Of course...<\/p>","protected":false},"author":3,"featured_media":4211,"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":[398,670,672,674,671,669,646,164,673,666],"class_list":["post-4202","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-r-","tag-670","tag-672","tag-674","tag-671","tag-669","tag-646","tag-164","tag-673","tag-666"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":398,"label":"R \ucf54\ub529"},{"value":670,"label":"\uacb0\ud63c \ucd9c\uc0b0"},{"value":672,"label":"\uacb0\ud63c \ucd9c\uc0b0 \ub370\uc774\ud130"},{"value":674,"label":"\uacb0\ud63c \ucd9c\uc0b0 \ubcc0\ud654"},{"value":671,"label":"\uacb0\ud63c \ucd9c\uc0b0 \uc778\uc2dd"},{"value":669,"label":"\uacb0\ud63c\uacfc \ucd9c\uc0b0"},{"value":646,"label":"\ub204\uc801\ub9c9\ub300\uadf8\ub798\ud504"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":673,"label":"\uc0ac\ud68c \uc870\uc0ac"},{"value":666,"label":"\uc800\ucd9c\uc0b0 \ubb38\uc81c"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2024\/12\/\uacb0\ud63c-\ucd9c\uc0b0-\ud3ec\uc2a4\ud2b8-\uc378\ub124\uc77c-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":398,"name":"R \ucf54\ub529","slug":"r-%ec%bd%94%eb%94%a9","term_group":0,"term_taxonomy_id":398,"taxonomy":"post_tag","description":"","parent":0,"count":6,"filter":"raw"},{"term_id":670,"name":"\uacb0\ud63c \ucd9c\uc0b0","slug":"%ea%b2%b0%ed%98%bc-%ec%b6%9c%ec%82%b0","term_group":0,"term_taxonomy_id":670,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":672,"name":"\uacb0\ud63c \ucd9c\uc0b0 \ub370\uc774\ud130","slug":"%ea%b2%b0%ed%98%bc-%ec%b6%9c%ec%82%b0-%eb%8d%b0%ec%9d%b4%ed%84%b0","term_group":0,"term_taxonomy_id":672,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":674,"name":"\uacb0\ud63c \ucd9c\uc0b0 \ubcc0\ud654","slug":"%ea%b2%b0%ed%98%bc-%ec%b6%9c%ec%82%b0-%eb%b3%80%ed%99%94","term_group":0,"term_taxonomy_id":674,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":671,"name":"\uacb0\ud63c \ucd9c\uc0b0 \uc778\uc2dd","slug":"%ea%b2%b0%ed%98%bc-%ec%b6%9c%ec%82%b0-%ec%9d%b8%ec%8b%9d","term_group":0,"term_taxonomy_id":671,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":669,"name":"\uacb0\ud63c\uacfc \ucd9c\uc0b0","slug":"%ea%b2%b0%ed%98%bc%ea%b3%bc-%ec%b6%9c%ec%82%b0","term_group":0,"term_taxonomy_id":669,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":646,"name":"\ub204\uc801\ub9c9\ub300\uadf8\ub798\ud504","slug":"%eb%88%84%ec%a0%81%eb%a7%89%eb%8c%80%ea%b7%b8%eb%9e%98%ed%94%84","term_group":0,"term_taxonomy_id":646,"taxonomy":"post_tag","description":"","parent":0,"count":2,"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":673,"name":"\uc0ac\ud68c \uc870\uc0ac","slug":"%ec%82%ac%ed%9a%8c-%ec%a1%b0%ec%82%ac","term_group":0,"term_taxonomy_id":673,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":666,"name":"\uc800\ucd9c\uc0b0 \ubb38\uc81c","slug":"%ec%a0%80%ec%b6%9c%ec%82%b0-%eb%ac%b8%ec%a0%9c","term_group":0,"term_taxonomy_id":666,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4202","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=4202"}],"version-history":[{"count":6,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4202\/revisions"}],"predecessor-version":[{"id":4213,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/posts\/4202\/revisions\/4213"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media\/4211"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/media?parent=4202"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/categories?post=4202"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/en\/wp-json\/wp\/v2\/tags?post=4202"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}