{"id":5081,"date":"2025-02-13T06:39:00","date_gmt":"2025-02-12T21:39:00","guid":{"rendered":"https:\/\/secondlife.lol\/?p=5081"},"modified":"2025-02-13T07:41:05","modified_gmt":"2025-02-12T22:41:05","slug":"db-r-shiny-visualization","status":"publish","type":"post","link":"https:\/\/secondlife.lol\/zh\/db-r-shiny-visualization\/","title":{"rendered":"R \u4e2d DB \u9a71\u52a8\u7684 R Shiny \u5e94\u7528\u7a0b\u5e8f\u53ef\u89c6\u5316--\u4ece\u539f\u7406\u5230\u5b9e\u9645\u4ee3\u7801"},"content":{"rendered":"<style>.kb-image5081_c54fd3-e3 .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-image5081_c54fd3-e3 img.kb-img, .kb-image5081_c54fd3-e3 .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-image5081_c54fd3-e3\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1200\" height=\"588\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12.jpg\" alt=\"DB \uae30\ubc18 R \uc0e4\uc774\ub2c8\uc571 \uc2dc\uac01\ud654\" class=\"kb-img wp-image-5082\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12.jpg 1200w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12-300x147.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12-600x294.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12-768x376.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-12-18x9.jpg 18w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption>( DB \uae30\ubc18 R \uc0e4\uc774\ub2c8\uc571 \uc2dc\uac01\ud654 \uc774\ubbf8\uc9c0 )<\/figcaption><\/figure><\/div>\n\n\n\n<p>\ub370\uc774\ud130\ub97c \ubd84\uc11d\ud558\uace0 \uc2dc\uac01\ud654\ud558\ub294 \uacfc\uc815\uc5d0\uc11c <strong>\ud56d\uc0c1 \ucd5c\uc2e0 \ub370\uc774\ud130\ub97c \ubc18\uc601\ud558\ub294 \uac83\uc774 \uc911\uc694<\/strong>\ud569\ub2c8\ub2e4. \ud558\uc9c0\ub9cc CSV \ud30c\uc77c\uc744 \ub9e4\ubc88 \uc5c5\ub370\uc774\ud2b8\ud558\ub294 \uac74 \ubc88\uac70\ub86d\uace0, \ucf54\ub4dc \uc2e4\ud589\ud560 \ub54c\ub9c8\ub2e4 \ub370\uc774\ud130\ub97c \uc0c8\ub85c \ub85c\ub4dc\ud558\ub294 \uac83\ub3c4 \ube44\ud6a8\uc728\uc801\uc774\uc8e0. \ud83d\ude2b<\/p>\n\n\n\n<p>\uc774\ub7f4 \ub54c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud65c\uc6a9\uc774 \uc88b\uc744\uae4c\uc694? <strong><a href=\"https:\/\/secondlife.lol\/excel-to-r-sqlite-data-analysis-guide\/\" data-type=\"post\" data-id=\"3476\">DB \uae30\ubc18<\/a> R \uc0e4\uc774\ub2c8\uc571 \uc2dc\uac01\ud654<\/strong>\ub97c \uc0ac\uc6a9\ud558\uba74 \ub370\uc774\ud130\ub97c \ud6a8\uc728\uc801\uc73c\ub85c \uc800\uc7a5\ud558\uace0, <a href=\"https:\/\/shiny.posit.co\/\" target=\"_blank\" rel=\"noopener\">R Shiny<\/a> \uc571\uc5d0\uc11c \ubd88\ub7ec\uc640 \uc2dc\uac01\ud654\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4! \ud83c\udf89<\/p>\n\n\n\n<p>\uc624\ub298\uc740 <strong>SQLite<\/strong>\ub97c \ud65c\uc6a9\ud574 <strong>5\ub144\uce58 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud558\uace0, \uc774\ub97c Shiny \uc571\uc5d0\uc11c \ubd88\ub7ec\uc640 \uc2dc\uac01\ud654\ud558\ub294 \uacfc\uc815<\/strong>\uc744 \ub2e8\uacc4\ubcc4\ub85c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ubb3c\ub860! <strong>\uc2e4\uc81c \ucf54\ub4dc\ub97c \ud3ec\ud568\ud558\uc5ec \uce5c\uc808\ud558\uac8c \uc124\uba85<\/strong>\ud560 \uc608\uc815\uc774\ub2c8 \ub05d\uae4c\uc9c0 \ud568\uaed8\ud574 \uc8fc\uc138\uc694. \ud83d\ude09<\/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\">\ud83d\udd25 DB \ud65c\uc6a9 \uc774\uc720: \uc65c CSV\uac00 \uc544\ub2cc DB\ub97c \uc368\uc57c \ud560\uae4c?<\/h2>\n\n\n\n<p>CSV\uc640 \ub370\uc774\ud130\ubca0\uc774\uc2a4(DB)\ub97c \ube44\uad50\ud574 \ubcf4\uba74 \ucc28\uc774\uac00 \uba85\ud655\ud574\uc9d1\ub2c8\ub2e4.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>\ube44\uad50 \ud56d\ubaa9<\/th><th>CSV \ud30c\uc77c<\/th><th>\ub370\uc774\ud130\ubca0\uc774\uc2a4(DB)<\/th><\/tr><\/thead><tbody><tr><td>\ub370\uc774\ud130 \uc800\uc7a5<\/td><td>\ud30c\uc77c\ub85c \uc800\uc7a5<\/td><td>\ud14c\uc774\ube14 \ud615\ud0dc\ub85c \uc800\uc7a5<\/td><\/tr><tr><td>\ub370\uc774\ud130 \uc5c5\ub370\uc774\ud2b8<\/td><td>\uc218\ub3d9\uc73c\ub85c \ud30c\uc77c \uc218\uc815<\/td><td>SQL \ucffc\ub9ac\ub85c \uc27d\uac8c \uc218\uc815<\/td><\/tr><tr><td>\ub2e4\uc911 \uc0ac\uc6a9\uc790 \uc811\uadfc<\/td><td>\uc5b4\ub824\uc6c0<\/td><td>\uac00\ub2a5 (Shiny, \uc6f9\uc571 \ud65c\uc6a9)<\/td><\/tr><tr><td>\uc18d\ub3c4<\/td><td>\ub290\ub9bc (\ud30c\uc77c \ub85c\ub4dc \ud544\uc694)<\/td><td>\ube60\ub984 (SQL \ucffc\ub9ac \ud65c\uc6a9)<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\uc704 \ube44\uad50\uc5d0\uc11c \ubcf4\ub4ef\uc774, <strong>Shiny \uc571\uacfc \uac19\uc740 \ub3d9\uc801 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4 \ub54c DB\ub97c \ud65c\uc6a9\ud558\uba74 \ud6e8\uc52c \ud6a8\uc728\uc801<\/strong>\uc785\ub2c8\ub2e4!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\ude80 [\uc2e4\uc804] R Shiny \uc571\uc5d0\uc11c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud65c\uc6a9 \uc2dc\uac01\ud654 \uad6c\ud604\ud558\uae30<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1\ufe0f\u20e3 SQLite DB\uc5d0 \ub370\uc774\ud130 \uc800\uc7a5\ud558\uae30<\/h3>\n\n\n\n<p>\uba3c\uc800, <strong>5\ub144\uce58 (2020~2024\ub144) \ub9e4\ucd9c \ub370\uc774\ud130\ub97c \ub79c\ub364 \uc0dd\uc131\ud558\uc5ec SQLite\uc5d0 \uc800\uc7a5<\/strong>\ud558\ub294 \ucf54\ub4dc\ub97c \uc791\uc131\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code language-R\"><code># \ud328\ud0a4\uc9c0 \ub85c\ub4dc\nlibrary(DBI)\nlibrary(RSQLite)\n\n# SQLite DB \uc5f0\uacb0\nconn &lt;- dbConnect(RSQLite::SQLite(), \"sales_data.sqlite\")\n\n# \ub370\uc774\ud130 \uc0dd\uc131\nset.seed(123)\nyears &lt;- rep(2020:2024, each = 12)\nmonths &lt;- rep(1:12, times = 5)\nsales &lt;- sample(100:500, 60, replace = TRUE) + (years - 2020) * 20  # \uc5f0\ub3c4\ubcc4 \uc99d\uac00 \ubc18\uc601\n\nsales_data &lt;- data.frame(year = years, month = months, sales = sales)\n\n# \uae30\uc874 \ud14c\uc774\ube14 \uc0ad\uc81c \ud6c4 \uc800\uc7a5\ndbExecute(conn, \"DROP TABLE IF EXISTS sales\")\ndbWriteTable(conn, \"sales\", sales_data, overwrite = TRUE, row.names = FALSE)\n\n# DB \uc5f0\uacb0 \ud574\uc81c\ndbDisconnect(conn)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd \ucf54\ub4dc \ud574\uc124<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>SQLite \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0<\/strong>: <code>dbConnect()<\/code>\ub97c \uc0ac\uc6a9\ud558\uc5ec DB \ud30c\uc77c\uc744 \uc0dd\uc131 \ubc0f \uc5f0\uacb0\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>\ub79c\ub364 \ub370\uc774\ud130 \uc0dd\uc131<\/strong>: <code>years<\/code>, <code>months<\/code>, <code>sales<\/code> \ub370\uc774\ud130\ub97c \ub9cc\ub4e4\uc5b4 5\ub144\uce58 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>DB\uc5d0 \uc800\uc7a5<\/strong>: \uae30\uc874 \ud14c\uc774\ube14\uc744 \uc0ad\uc81c\ud55c \ud6c4 <code>dbWriteTable()<\/code>\ub85c \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>DB \uc5f0\uacb0 \ud574\uc81c<\/strong>: <code>dbDisconnect()<\/code>\ub97c \ud638\ucd9c\ud558\uc5ec \uc5f0\uacb0\uc744 \uc885\ub8cc\ud569\ub2c8\ub2e4.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">2\ufe0f\u20e3 Shiny \uc571\uc5d0\uc11c DB \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc640 \uc2dc\uac01\ud654\ud558\uae30<\/h3>\n\n\n\n<p>\uc774\uc81c <strong>Shiny \uc571\uc744 \ud1b5\ud574 SQLite\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc640 ggplot2\ub85c \uc2dc\uac01\ud654<\/strong>\ud558\ub294 \uacfc\uc815\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ud83d\udd25<\/p>\n\n\n\n<pre class=\"wp-block-code language-R\"><code>library(shiny)\nlibrary(DBI)\nlibrary(RSQLite)\nlibrary(ggplot2)\n\n# UI \uc815\uc758\nui &lt;- fluidPage(\n  titlePanel(\"\ud83d\udcca DB \uae30\ubc18 R \uc0e4\uc774\ub2c8\uc571 \uc2dc\uac01\ud654\"),\n  sidebarLayout(\n    sidebarPanel(selectInput(\"year\", \"\uc5f0\ub3c4 \uc120\ud0dd:\", choices = 2020:2024, selected = 2024)),\n    mainPanel(plotOutput(\"salesPlot\"))\n  )\n)\n\n# \uc11c\ubc84 \ub85c\uc9c1\ntserver &lt;- function(input, output) {\n  conn &lt;- dbConnect(RSQLite::SQLite(), \"sales_data.sqlite\")\n  \n  sales_data_reactive &lt;- reactive({\n    query &lt;- paste0(\"SELECT * FROM sales WHERE year = \", input$year)\n    dbGetQuery(conn, query)\n  })\n\n  output$salesPlot &lt;- renderPlot({\n    df &lt;- sales_data_reactive()\n    ggplot(df, aes(x = month, y = sales)) +\n      geom_line(color = \"blue\") +\n      geom_point(color = \"red\") +\n      geom_smooth(method = \"lm\", formula = y ~ poly(x, 2), color = \"darkred\", linetype = \"dashed\") +\n      theme_minimal()\n  })\n  \n  onStop(function() { dbDisconnect(conn) })\n}\n\nshinyApp(ui, server)\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd \ucf54\ub4dc \ud574\uc124<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>\uc0ac\uc6a9\uc790\uac00 \uc5f0\ub3c4\ub97c \uc120\ud0dd\ud560 \uc218 \uc788\ub3c4\ub85d UI \uad6c\uc131<\/strong> (<code>selectInput()<\/code> \uc0ac\uc6a9)<\/li>\n\n\n\n<li><strong>Shiny \uc11c\ubc84\uc5d0\uc11c DB \uc5f0\uacb0 \ud6c4 \ud574\ub2f9 \uc5f0\ub3c4\uc758 \ub370\uc774\ud130 \ubd88\ub7ec\uc624\uae30<\/strong><\/li>\n\n\n\n<li><strong>ggplot2\ub97c \ud65c\uc6a9\ud55c \uc2dc\uac01\ud654<\/strong> (<code>geom_line()<\/code> + <code>geom_smooth()<\/code>\ub85c \ucd94\uc138\uc120 \ucd94\uac00)<\/li>\n<\/ol>\n\n\n<style>.kb-image5081_4b4c3c-9d .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-image5081_4b4c3c-9d img.kb-img, .kb-image5081_4b4c3c-9d .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-image5081_4b4c3c-9d\"><figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"1200\" height=\"570\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13.jpg\" alt=\"\" class=\"kb-img wp-image-5083\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13.jpg 1200w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13-300x143.jpg 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13-600x285.jpg 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13-768x365.jpg 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/image-4-13-18x9.jpg 18w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" \/><figcaption>( DB \uae30\ubc18 R \uc0e4\uc774\ub2c8\uc571 \uc2dc\uac01\ud654 \uc774\ubbf8\uc9c0 &#8211; \uac1c\ubcc4 \uc5f0\ub3c4 \uc120\ud0dd )<\/figcaption><\/figure><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udd04 DB \ub370\uc774\ud130 \ucd94\uac00 \uc5c5\ub370\uc774\ud2b8 \ubc29\ubc95<\/h2>\n\n\n\n<p>DB\uc5d0 \uc0c8\ub85c\uc6b4 \uc5f0\ub3c4\uc758 \ub370\uc774\ud130\ub97c \ucd94\uac00\ud558\ub824\uba74 \uae30\uc874 \ud14c\uc774\ube14\uc744 \uc0ad\uc81c\ud558\uc9c0 \uc54a\uace0 <strong>\ub370\uc774\ud130\ub97c \ucd94\uac00(append)\ud558\ub294 \ubc29\uc2dd\uc73c\ub85c \uc5c5\ub370\uc774\ud2b8<\/strong>\ud574\uc57c \ud569\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, 2025\ub144 \ub370\uc774\ud130\ub97c \ucd94\uac00\ud558\ub294 \ucf54\ub4dc\ub97c \uc791\uc131\ud558\uba74 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<pre class=\"wp-block-code language-R\"><code>conn &lt;- dbConnect(RSQLite::SQLite(), \"sales_data.sqlite\")\n\n# 2025\ub144 \ub370\uc774\ud130 \uc0dd\uc131\nset.seed(125)\nyears &lt;- rep(2025, each = 12)\nmonths &lt;- 1:12\nsales &lt;- sample(100:500, 12, replace = TRUE) + (2025 - 2020) * 20\n\nnew_data &lt;- data.frame(year = years, month = months, sales = sales)\n\n# \uae30\uc874 \ud14c\uc774\ube14\uc5d0 \ucd94\uac00\ndbWriteTable(conn, \"sales\", new_data, append = TRUE, row.names = FALSE)\n\n# DB \uc5f0\uacb0 \ud574\uc81c\ndbDisconnect(conn)<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcdd \ucf54\ub4dc \ud574\uc124<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li><strong>\uc0c8\ub85c\uc6b4 \uc5f0\ub3c4\uc758 \ub370\uc774\ud130 \uc0dd\uc131<\/strong>: <code>set.seed(125)<\/code>\ub97c \uc124\uc815\ud558\uace0 2025\ub144 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>\ub370\uc774\ud130\ud504\ub808\uc784 \uad6c\uc131<\/strong>: \uae30\uc874\uacfc \ub3d9\uc77c\ud55c \uad6c\uc870\uc758 \ub370\uc774\ud130\ud504\ub808\uc784\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>DB\uc5d0 \ub370\uc774\ud130 \ucd94\uac00<\/strong>: <code>dbWriteTable()<\/code>\uc744 <code>append = TRUE<\/code>\ub85c \uc124\uc815\ud558\uc5ec \uae30\uc874 \ub370\uc774\ud130\uc5d0 \uc0c8\ub85c\uc6b4 \ub370\uc774\ud130\ub97c \ucd94\uac00\ud569\ub2c8\ub2e4.<\/li>\n\n\n\n<li><strong>DB \uc5f0\uacb0 \ud574\uc81c<\/strong>: <code>dbDisconnect()<\/code>\ub97c \ud638\ucd9c\ud558\uc5ec \uc5f0\uacb0\uc744 \uc885\ub8cc\ud569\ub2c8\ub2e4.<\/li>\n<\/ol>\n\n\n\n<p>\uc774\uc81c 2025\ub144 \ub370\uc774\ud130\ub97c \ucd94\uac00\ud55c \ud6c4 Shiny \uc571\uc5d0\uc11c \uc120\ud0dd\ud560 \uc218 \uc788\ub3c4\ub85d UI\uc758 <code>selectInput()<\/code>\uc5d0\ub3c4 2025\ub144\uc744 \ucd94\uac00\ud558\uba74 \ub429\ub2c8\ub2e4. \ud83d\udcca<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc \ub9c8\ubb34\ub9ac\ud558\uba70\u2026<\/h2>\n\n\n\n<p>\uc774\uc81c \uc6b0\ub9ac\ub294 <strong>R Shiny \uc571\uc5d0\uc11c DB \uae30\ubc18 \ub370\uc774\ud130 \uc2dc\uac01\ud654\ub97c \ud558\ub294 \ubc29\ubc95<\/strong>\uc744 \ubc30\uc6e0\uc2b5\ub2c8\ub2e4!<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\uc65c DB\ub97c \uc0ac\uc6a9\ud558\ub294 \uac83\uc774 \uc88b\uc740\uc9c0 \uc774\ud574<\/strong><\/li>\n\n\n\n<li><strong>SQLite\uc5d0 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\ub294 \ubc95 \ud559\uc2b5<\/strong><\/li>\n\n\n\n<li><strong>Shiny \uc571\uc5d0\uc11c \ub370\uc774\ud130\ub97c \ubd88\ub7ec\uc640 \uc2dc\uac01\ud654\ud558\ub294 \uacfc\uc815<\/strong> \uc775\ud788\uae30<\/li>\n<\/ul>\n\n\n\n<p>\uc2e4\uc81c \ud504\ub85c\uc81d\ud2b8\uc5d0\uc11c SQLite\ubfd0\ub9cc \uc544\ub2c8\ub77c <strong>MySQL, PostgreSQL \ub4f1 \ub2e4\uc591\ud55c DB<\/strong>\ub97c \ud65c\uc6a9\ud560 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4. \ud83d\ude0a<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udcda \uc6a9\uc5b4 \ud574\uc124<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Shiny<\/strong>: R\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uc27d\uac8c \ub9cc\ub4e4 \uc218 \uc788\ub294 \ud328\ud0a4\uc9c0.<\/li>\n\n\n\n<li><strong>SQLite<\/strong>: \uacbd\ub7c9 \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub85c \ud30c\uc77c \ud558\ub098\ub85c \uad00\ub9ac \uac00\ub2a5\ud558\uba70, \uac04\ub2e8\ud55c \ub370\uc774\ud130 \uc800\uc7a5\uc6a9\uc73c\ub85c \uc801\ud569\ud568.<\/li>\n\n\n\n<li><strong>ggplot2<\/strong>: \ub370\uc774\ud130 \uc2dc\uac01\ud654\ub97c \uc704\ud55c R \ud328\ud0a4\uc9c0\ub85c \ub2e4\uc591\ud55c \uadf8\ub798\ud504\ub97c \uc0dd\uc131 \uac00\ub2a5.<\/li>\n\n\n\n<li><strong>reactive()<\/strong>: Shiny\uc5d0\uc11c \ub370\uc774\ud130\uac00 \ub3d9\uc801\uc73c\ub85c \ubcc0\ud560 \uc218 \uc788\ub3c4\ub85d \ud558\ub294 \ud568\uc218.<\/li>\n<\/ul>\n\n\n<style>.kb-image4457_249bea-0c.kb-image-is-ratio-size, .kb-image4457_249bea-0c .kb-image-is-ratio-size{max-width:300px;width:100%;}.wp-block-kadence-column > .kt-inside-inner-col > .kb-image4457_249bea-0c.kb-image-is-ratio-size, .wp-block-kadence-column > .kt-inside-inner-col > .kb-image4457_249bea-0c .kb-image-is-ratio-size{align-self:unset;}.kb-image4457_249bea-0c figure{max-width:300px;}.kb-image4457_249bea-0c .image-is-svg, .kb-image4457_249bea-0c .image-is-svg img{width:100%;}.kb-image4457_249bea-0c .kb-image-has-overlay:after{opacity:0.3;}<\/style>\n<div class=\"wp-block-kadence-image kb-image4457_249bea-0c\"><figure class=\"aligncenter size-medium\"><img decoding=\"async\" width=\"300\" height=\"300\" src=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-300x300.webp\" alt=\"\ud14c\ub9ac \uc774\ubaa8\ud2f0\ucf58\" class=\"kb-img wp-image-4456\" srcset=\"https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-300x300.webp 300w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-600x600.webp 600w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-150x150.webp 150w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-768x768.webp 768w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding-12x12.webp 12w, https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/01\/teri-coding.webp 1024w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><figcaption><strong>( \uc990\uac81\uac8c \ucf54\ub529\uc744 \ud569\uc2dc\ub2e4! )<\/strong><\/figcaption><\/figure><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u5728\u5206\u6790\u548c\u53ef\u89c6\u5316\u6570\u636e\u65f6\uff0c\u91cd\u8981\u7684\u662f\u8981\u59cb\u7ec8\u53cd\u6620\u6700\u65b0\u6570\u636e....\u3002<\/p>","protected":false},"author":3,"featured_media":5090,"comment_status":"open","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":[905,176,38,904,903,489,177,164,486],"class_list":["post-5081","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r-coding","tag-db-","tag-ggplot2","tag-r","tag-r-shiny","tag-shiny","tag-sqlite","tag-177","tag-164","tag-486"],"taxonomy_info":{"category":[{"value":6,"label":"\uc54c(R)"}],"post_tag":[{"value":905,"label":"DB \ud65c\uc6a9"},{"value":176,"label":"ggplot2"},{"value":38,"label":"R"},{"value":904,"label":"R Shiny"},{"value":903,"label":"Shiny"},{"value":489,"label":"SQLite"},{"value":177,"label":"\ub370\uc774\ud130 \ubd84\uc11d"},{"value":164,"label":"\ub370\uc774\ud130 \uc2dc\uac01\ud654"},{"value":486,"label":"\ub370\uc774\ud130\ubca0\uc774\uc2a4"}]},"featured_image_src_large":["https:\/\/secondlife.lol\/wp-content\/uploads\/2025\/02\/DB-\uae30\ubc18-R-\uc0e4\uc774\ub2c8\uc571-\uc2dc\uac01\ud654-\ud3ec\uc2a4\ud2b8-\uc378\ub124\uc77c-600x600.jpg",600,600,true],"author_info":{"display_name":"TERE","author_link":"https:\/\/secondlife.lol\/zh\/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":905,"name":"DB \ud65c\uc6a9","slug":"db-%ed%99%9c%ec%9a%a9","term_group":0,"term_taxonomy_id":905,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"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":904,"name":"R Shiny","slug":"r-shiny","term_group":0,"term_taxonomy_id":904,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":903,"name":"Shiny","slug":"shiny","term_group":0,"term_taxonomy_id":903,"taxonomy":"post_tag","description":"","parent":0,"count":1,"filter":"raw"},{"term_id":489,"name":"SQLite","slug":"sqlite","term_group":0,"term_taxonomy_id":489,"taxonomy":"post_tag","description":"","parent":0,"count":2,"filter":"raw"},{"term_id":177,"name":"\ub370\uc774\ud130 \ubd84\uc11d","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0-%eb%b6%84%ec%84%9d","term_group":0,"term_taxonomy_id":177,"taxonomy":"post_tag","description":"","parent":0,"count":36,"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":486,"name":"\ub370\uc774\ud130\ubca0\uc774\uc2a4","slug":"%eb%8d%b0%ec%9d%b4%ed%84%b0%eb%b2%a0%ec%9d%b4%ec%8a%a4","term_group":0,"term_taxonomy_id":486,"taxonomy":"post_tag","description":"","parent":0,"count":4,"filter":"raw"}],"_links":{"self":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/5081","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/comments?post=5081"}],"version-history":[{"count":10,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/5081\/revisions"}],"predecessor-version":[{"id":5094,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/posts\/5081\/revisions\/5094"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/media\/5090"}],"wp:attachment":[{"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/media?parent=5081"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/categories?post=5081"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/secondlife.lol\/zh\/wp-json\/wp\/v2\/tags?post=5081"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}