{"id":832,"date":"2020-07-18T07:28:00","date_gmt":"2020-07-18T00:28:00","guid":{"rendered":"http:\/\/www.gis2me.com\/geospatial\/?p=832"},"modified":"2025-04-30T09:19:43","modified_gmt":"2025-04-30T02:19:43","slug":"r-studio-ep18-%e0%b8%88%e0%b8%b1%e0%b8%94%e0%b8%8a%e0%b9%88%e0%b8%a7%e0%b8%87%e0%b8%aa%e0%b8%96%e0%b8%b4%e0%b8%95%e0%b8%b4-qualtile-jenks-%e0%b9%81%e0%b8%a5%e0%b8%b0-equal-interval-%e0%b9%81","status":"publish","type":"post","link":"http:\/\/www.gis2me.com\/geospatial\/?p=832","title":{"rendered":"R-studio : ( EP#18 ) \u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34 Qualtile, Jenks \u0e41\u0e25\u0e30 Equal Interval \u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e23\u0e32\u0e22\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14"},"content":{"rendered":"<p>R-studio : ( EP#18 ) \u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34 Qualtile, Jenks \u0e41\u0e25\u0e30 Equal Interval \u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e02\u0e2d\u0e07\u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22 \u0e14\u0e49\u0e27\u0e22\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 R<\/p>\n<p>\u0e40\u0e1b\u0e47\u0e19\u0e01\u0e32\u0e23\u0e1d\u0e36\u0e01\u0e1b\u0e0f\u0e34\u0e1a\u0e31\u0e15\u0e34\u0e01\u0e32\u0e23\u0e15\u0e48\u0e2d\u0e08\u0e32\u0e01 EP#17 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e0a\u0e31\u0e49\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e2a\u0e16\u0e34\u0e15\u0e34\u0e43\u0e19\u0e23\u0e39\u0e1b\u0e41\u0e1a\u0e1a Qualtile, Jenks \u0e41\u0e25\u0e30 Equal Interval \u0e08\u0e32\u0e01\u0e10\u0e32\u0e19\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e23\u0e32\u0e22\u0e04\u0e23\u0e31\u0e27\u0e40\u0e23\u0e37\u0e2d\u0e19\u0e02\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 \u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e19\u0e33\u0e21\u0e32\u0e40\u0e0a\u0e37\u0e48\u0e2d\u0e21\u0e42\u0e22\u0e07\u0e01\u0e31\u0e1a Shapefile \u0e23\u0e32\u0e22\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 \u0e43\u0e19\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 R<\/p>\n<p>\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e44\u0e1f\u0e25\u0e4c R script \u0e44\u0e14\u0e49\u0e17\u0e35\u0e48 <a href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSfmokJQs7y_10X1uubg3wo_KBjwdTz-LFAU6LJZi6EHU-bFaw\/viewform\">https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSfmokJQs7y_10X1uubg3wo_KBjwdTz-LFAU6LJZi6EHU-bFaw\/viewform<\/a><\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/-UnaTRsBk6E\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udded \u0e27\u0e31\u0e15\u0e16\u0e38\u0e1b\u0e23\u0e30\u0e2a\u0e07\u0e04\u0e4c<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e1d\u0e36\u0e01\u0e43\u0e0a\u0e49\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34 (classification methods) \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e40\u0e0a\u0e34\u0e07\u0e1b\u0e23\u0e34\u0e21\u0e32\u0e13 (Choropleth Map) \u0e08\u0e32\u0e01\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e02\u0e2d\u0e07\u0e1b\u0e23\u0e30\u0e0a\u0e32\u0e01\u0e23\u0e44\u0e17\u0e22\u0e23\u0e32\u0e22\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14 \u0e42\u0e14\u0e22\u0e43\u0e0a\u0e49\u0e42\u0e1b\u0e23\u0e41\u0e01\u0e23\u0e21 <strong>R<\/strong> \u0e23\u0e48\u0e27\u0e21\u0e01\u0e31\u0e1a <code>classInt<\/code>, <code>leaflet<\/code>, \u0e41\u0e25\u0e30 <code>sf<\/code><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83e\udde9 \u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e21\u0e37\u0e2d\u0e41\u0e25\u0e30\u0e41\u0e1e\u0e47\u0e01\u0e40\u0e01\u0e08\u0e17\u0e35\u0e48\u0e43\u0e0a\u0e49<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\">rCopyEdit<code>install.packages(c(\"sf\", \"classInt\", \"leaflet\", \"RColorBrewer\", \"dplyr\"))\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\uddc2\ufe0f \u0e02\u0e31\u0e49\u0e19\u0e15\u0e2d\u0e19\u0e01\u0e32\u0e23\u0e14\u0e33\u0e40\u0e19\u0e34\u0e19\u0e07\u0e32\u0e19<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. \u0e19\u0e33\u0e40\u0e02\u0e49\u0e32\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">rCopyEdit<code>library(sf)\nlibrary(readxl)\nlibrary(dplyr)\n\nthai_prov &lt;- st_read(\"thailand_province.shp\")\nincome_data &lt;- read_excel(\"income_by_province.xlsx\")\n\nthai_income &lt;- thai_prov %&gt;%\n  left_join(income_data, by = \"province_name\")\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. \u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25 (Classification Methods)<\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">rCopyEdit<code>library(classInt)\n\n# \u0e2a\u0e23\u0e49\u0e32\u0e07\u0e0a\u0e48\u0e27\u0e07\u0e14\u0e49\u0e27\u0e22 3 \u0e27\u0e34\u0e18\u0e35\nbreaks_quantile &lt;- classIntervals(thai_income$income_avg, n = 5, style = \"quantile\")\nbreaks_jenks &lt;- classIntervals(thai_income$income_avg, n = 5, style = \"jenks\")\nbreaks_equal &lt;- classIntervals(thai_income$income_avg, n = 5, style = \"equal\")\n<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">3. \u0e41\u0e2a\u0e14\u0e07\u0e41\u0e1c\u0e19\u0e17\u0e35\u0e48\u0e14\u0e49\u0e27\u0e22 <code>leaflet<\/code><\/h4>\n\n\n\n<pre class=\"wp-block-preformatted\">rCopyEdit<code>library(leaflet)\nlibrary(RColorBrewer)\n\n# \u0e43\u0e0a\u0e49 Jenks \u0e40\u0e1b\u0e47\u0e19\u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07\npal_jenks &lt;- colorBin(\"YlOrRd\", domain = thai_income$income_avg,\n                      bins = breaks_jenks$brks)\n\nleaflet(thai_income) %&gt;%\n  addTiles() %&gt;%\n  addPolygons(\n    fillColor = ~pal_jenks(income_avg),\n    fillOpacity = 0.7,\n    color = \"#333333\",\n    weight = 1,\n    label = ~paste(province_name, \":\", income_avg, \"\u0e1a\u0e32\u0e17\")\n  ) %&gt;%\n  addLegend(pal = pal_jenks, values = ~income_avg,\n            title = \"\u0e23\u0e32\u0e22\u0e44\u0e14\u0e49\u0e40\u0e09\u0e25\u0e35\u0e48\u0e22 (\u0e1a\u0e32\u0e17)\",\n            opacity = 0.8)\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udcca \u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a\u0e1c\u0e25\u0e25\u0e31\u0e1e\u0e18\u0e4c\u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07<\/h3>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Method<\/th><th>\u0e25\u0e31\u0e01\u0e29\u0e13\u0e30\u0e0a\u0e48\u0e27\u0e07\u0e17\u0e35\u0e48\u0e44\u0e14\u0e49<\/th><\/tr><\/thead><tbody><tr><td><strong>Quantile<\/strong><\/td><td>\u0e08\u0e33\u0e19\u0e27\u0e19\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e43\u0e19\u0e41\u0e15\u0e48\u0e25\u0e30\u0e0a\u0e48\u0e27\u0e07\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e01\u0e31\u0e19<\/td><\/tr><tr><td><strong>Jenks<\/strong><\/td><td>\u0e43\u0e0a\u0e49\u0e40\u0e17\u0e04\u0e19\u0e34\u0e04\u0e01\u0e32\u0e23\u0e25\u0e14\u0e04\u0e27\u0e32\u0e21\u0e41\u0e1b\u0e23\u0e1b\u0e23\u0e27\u0e19\u0e43\u0e19\u0e01\u0e25\u0e38\u0e48\u0e21\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25<\/td><\/tr><tr><td><strong>Equal<\/strong><\/td><td>\u0e04\u0e27\u0e32\u0e21\u0e01\u0e27\u0e49\u0e32\u0e07\u0e02\u0e2d\u0e07\u0e41\u0e15\u0e48\u0e25\u0e30\u0e0a\u0e48\u0e27\u0e07\u0e40\u0e17\u0e48\u0e32\u0e01\u0e31\u0e19<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83e\udde0 <strong>\u0e04\u0e33\u0e41\u0e19\u0e30\u0e19\u0e33\u0e01\u0e32\u0e23\u0e40\u0e25\u0e37\u0e2d\u0e01\u0e43\u0e0a\u0e49<\/strong>:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u0e43\u0e0a\u0e49 <strong>Jenks<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e41\u0e2a\u0e14\u0e07 pattern \u0e02\u0e2d\u0e07\u0e02\u0e49\u0e2d\u0e21\u0e39\u0e25\u0e08\u0e23\u0e34\u0e07\u0e2d\u0e22\u0e48\u0e32\u0e07\u0e40\u0e1b\u0e47\u0e19\u0e18\u0e23\u0e23\u0e21\u0e0a\u0e32\u0e15\u0e34<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49 <strong>Quantile<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e40\u0e19\u0e49\u0e19\u0e01\u0e32\u0e23\u0e40\u0e1b\u0e23\u0e35\u0e22\u0e1a\u0e40\u0e17\u0e35\u0e22\u0e1a\u0e08\u0e31\u0e07\u0e2b\u0e27\u0e31\u0e14\u0e08\u0e33\u0e19\u0e27\u0e19\u0e43\u0e01\u0e25\u0e49\u0e40\u0e04\u0e35\u0e22\u0e07\u0e01\u0e31\u0e19\u0e43\u0e19\u0e41\u0e15\u0e48\u0e25\u0e30\u0e01\u0e25\u0e38\u0e48\u0e21<\/li>\n\n\n\n<li>\u0e43\u0e0a\u0e49 <strong>Equal Interval<\/strong> \u0e40\u0e21\u0e37\u0e48\u0e2d\u0e15\u0e49\u0e2d\u0e07\u0e01\u0e32\u0e23\u0e04\u0e27\u0e32\u0e21\u0e40\u0e02\u0e49\u0e32\u0e43\u0e08\u0e07\u0e48\u0e32\u0e22\u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a\u0e1c\u0e39\u0e49\u0e43\u0e0a\u0e49\u0e17\u0e31\u0e48\u0e27\u0e44\u0e1b<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udce5 \u0e02\u0e2d\u0e23\u0e31\u0e1a R Script \u0e15\u0e31\u0e27\u0e2d\u0e22\u0e48\u0e32\u0e07<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">\ud83d\udc49 <a class=\"\" href=\"https:\/\/docs.google.com\/forms\/d\/e\/1FAIpQLSfmokJQs7y_10X1uubg3wo_KBjwdTz-LFAU6LJZi6EHU-bFaw\/viewform\">\u0e25\u0e07\u0e17\u0e30\u0e40\u0e1a\u0e35\u0e22\u0e19\u0e40\u0e1e\u0e37\u0e48\u0e2d\u0e02\u0e2d\u0e23\u0e31\u0e1a R markdown script \u0e2a\u0e33\u0e2b\u0e23\u0e31\u0e1a EP#18<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>R-studio : ( EP#18 ) \u0e01\u0e32\u0e23\u0e08\u0e31\u0e14\u0e0a\u0e48\u0e27\u0e07\u0e2a\u0e16\u0e34\u0e15\u0e34 Qualtile, Jenks \u0e41\u0e25 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[21],"tags":[465,469,468,440,467,466,443,464,439,475,474,471,470,473,472],"class_list":["post-832","post","type-post","status-publish","format-standard","hentry","category--r-studio","tag-choropleth-map","tag-classint","tag-equal-interval","tag-gis--r","tag-income-mapping","tag-jenks-classification","tag-leaflet","tag-quantile-map","tag-r-studio","tag-r--gis","tag-shapefile-","tag-spatial-classification","tag-thailand-income-map","tag-473","tag-472"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/832","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=832"}],"version-history":[{"count":1,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/832\/revisions"}],"predecessor-version":[{"id":833,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=\/wp\/v2\/posts\/832\/revisions\/833"}],"wp:attachment":[{"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=832"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=832"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.gis2me.com\/geospatial\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=832"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}