{"id":1085,"date":"2023-07-27T17:36:07","date_gmt":"2023-07-27T17:36:07","guid":{"rendered":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/"},"modified":"2023-07-27T17:36:07","modified_gmt":"2023-07-27T17:36:07","slug":"r-iki-sutunu-bir-sutunda-birlestirin","status":"publish","type":"post","link":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/","title":{"rendered":"R&#39;de i\u0307ki s\u00fctunu bir s\u00fctunda birle\u015ftirme (\u00f6rneklerle)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Genellikle R&#8217;de iki s\u00fctunu bir s\u00fctunda birle\u015ftirmek isteyebilirsiniz. \u00d6rne\u011fin, \u00fc\u00e7 s\u00fctunlu bir veri \u00e7er\u00e7eveniz oldu\u011funu varsayal\u0131m:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>month year value\n   10 2019 15\n   10 2020 13\n   11 2020 13\n   11 2021 19\n   12 2021 22\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Ay ve y\u0131l s\u00fctunlar\u0131n\u0131 <em>tarih<\/em> ad\u0131 verilen tek bir s\u00fctunda birle\u015ftirmek isteyebilirsiniz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>date value\n   2019_10 15\n   2020_10 13\n   2020_11 13\n   2021_11 19\n   2021_12 22<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Bu e\u011fitimde bunu R&#8217;de h\u0131zl\u0131 bir \u015fekilde yapman\u0131n iki yolu a\u00e7\u0131klanmaktad\u0131r.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Y\u00f6ntem 1: Base R&#8217;den Yap\u0131\u015ft\u0131r i\u015flevini kullan\u0131n<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, <em>ay<\/em> ve <em>y\u0131l<\/em> s\u00fctunlar\u0131n\u0131 <em>tarih<\/em> ad\u0131 verilen tek bir s\u00fctunda birle\u015ftirmek i\u00e7in R veritaban\u0131 <strong>yap\u0131\u015ft\u0131rma<\/strong> i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#create data frame<\/span>\ndata &lt;- data.frame(month=c(10, 10, 11, 11, 12),\n                   year=c(2019, 2020, 2020, 2021, 2021),\n                   value=c(15, 13, 13, 19, 22))\n\n<span style=\"color: #008080;\">#view data frame\n<\/span>data\n\n<span style=\"color: #008080;\">#combine year and month into one column<\/span>\ndata$date &lt;- <span style=\"color: #3366ff;\">paste<\/span> (data$year, data$month, sep=\" <span style=\"color: #008000;\">_<\/span> \")\n\n<span style=\"color: #008080;\">#view new data frame<\/span>\ndata\n\n  month year value date\n1 10 2019 15 2019_10\n2 10 2020 13 2020_10\n3 11 2020 13 2020_11\n4 11 2021 19 2021_11\n5 12 2021 22 2021_12\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">\u0130ki s\u00fctunu birle\u015ftirdikten sonra istersek eskilerini silebiliriz:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>data_new &lt;- data[c(\" <span style=\"color: #008000;\">date<\/span> \", \" <span style=\"color: #008000;\">value<\/span> \")]\n\ndata_new\n\n     date value\n1 2019_10 15\n2 2020_10 13\n3 2020_11 13\n4 2021_11 19\n5 2021_12 22\n<\/strong><\/pre>\n<h3> <span style=\"color: #000000;\"><strong>Y\u00f6ntem 2: Tidyr&#8217;s Unite \u00f6zelli\u011fini kullan\u0131n<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">A\u015fa\u011f\u0131daki kod, <em>ay<\/em> ve <em>y\u0131l<\/em> s\u00fctunlar\u0131n\u0131 <em>tarih<\/em> ad\u0131 verilen tek bir s\u00fctunda birle\u015ftirmek i\u00e7in tiydr paketindeki <b>birim<\/b> i\u015flevinin nas\u0131l kullan\u0131laca\u011f\u0131n\u0131 g\u00f6sterir:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\"><span style=\"color: #000000;\"><span style=\"color: #008080;\">#load tidyr package<\/span>\nlibrary(tidyr)<\/span>\n\n#create data frame<\/span>\ndata &lt;- data.frame(month=c(10, 10, 11, 11, 12),\n                   year=c(2019, 2020, 2020, 2021, 2021),\n                   value=c(15, 13, 13, 19, 22))\n\n<span style=\"color: #008080;\">#combine year and month into one column<\/span>\n<span style=\"color: #3366ff;\">unit<\/span> (data, date, c(year, month))\n\n     date value\n1 2019_10 15\n2 2020_10 13\n3 2020_11 13\n4 2021_11 19\n5 2021_12 22<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Her iki y\u00f6ntemin de ayn\u0131 sonu\u00e7lar\u0131 \u00fcretti\u011fini unutmay\u0131n.<\/span><\/p>\n<p> <span style=\"color: #000000;\"><em>\u00dcnite fonksiyonunun tam belgelerini <a href=\"https:\/\/tidyr.tidyverse.org\/reference\/unite.html\" target=\"_blank\" rel=\"noopener noreferrer\">burada<\/a> bulabilirsiniz.<\/em><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Genellikle R&#8217;de iki s\u00fctunu bir s\u00fctunda birle\u015ftirmek isteyebilirsiniz. \u00d6rne\u011fin, \u00fc\u00e7 s\u00fctunlu bir veri \u00e7er\u00e7eveniz oldu\u011funu varsayal\u0131m: month year value 10 2019 15 10 2020 13 11 2020 13 11 2021 19 12 2021 22 Ay ve y\u0131l s\u00fctunlar\u0131n\u0131 tarih ad\u0131 verilen tek bir s\u00fctunda birle\u015ftirmek isteyebilirsiniz: date value 2019_10 15 2020_10 13 2020_11 13 2021_11 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-1085","post","type-post","status-publish","format-standard","hentry","category-rehber"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>R&#039;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)<\/title>\n<meta name=\"description\" content=\"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/\" \/>\n<meta property=\"og:locale\" content=\"tr_TR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"R&#039;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)\" \/>\n<meta property=\"og:description\" content=\"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T17:36:07+00:00\" \/>\n<meta name=\"author\" content=\"Dr.benjamin anderson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Yazan:\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Tahmini okuma s\u00fcresi\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 dakika\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/\",\"url\":\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/\",\"name\":\"R&#39;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/tr\/#website\"},\"datePublished\":\"2023-07-27T17:36:07+00:00\",\"dateModified\":\"2023-07-27T17:36:07+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\"},\"description\":\"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/#breadcrumb\"},\"inLanguage\":\"tr\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Ev\",\"item\":\"https:\/\/statorials.org\/tr\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"R&#39;de i\u0307ki s\u00fctunu bir s\u00fctunda birle\u015ftirme (\u00f6rneklerle)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/tr\/#website\",\"url\":\"https:\/\/statorials.org\/tr\/\",\"name\":\"Statorials\",\"description\":\"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/tr\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"tr\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"tr\",\"@id\":\"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil\",\"sameAs\":[\"https:\/\/statorials.org\/tr\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"R&#39;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)","description":"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/","og_locale":"tr_TR","og_type":"article","og_title":"R&#39;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)","og_description":"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.","og_url":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/","og_site_name":"Statorials","article_published_time":"2023-07-27T17:36:07+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Yazan:":"Dr.benjamin anderson","Tahmini okuma s\u00fcresi":"1 dakika"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/","url":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/","name":"R&#39;de \u0130ki S\u00fctunu Bir S\u00fctunda Birle\u015ftirme (\u00d6rneklerle)","isPartOf":{"@id":"https:\/\/statorials.org\/tr\/#website"},"datePublished":"2023-07-27T17:36:07+00:00","dateModified":"2023-07-27T17:36:07+00:00","author":{"@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48"},"description":"Bu e\u011fitimde iki s\u00fctunun bir R veri \u00e7er\u00e7evesinde nas\u0131l birle\u015ftirilece\u011fi a\u00e7\u0131klanmaktad\u0131r.","breadcrumb":{"@id":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/#breadcrumb"},"inLanguage":"tr","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/tr\/r-iki-sutunu-bir-sutunda-birlestirin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Ev","item":"https:\/\/statorials.org\/tr\/"},{"@type":"ListItem","position":2,"name":"R&#39;de i\u0307ki s\u00fctunu bir s\u00fctunda birle\u015ftirme (\u00f6rneklerle)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/tr\/#website","url":"https:\/\/statorials.org\/tr\/","name":"Statorials","description":"\u0130statistik okuryazarl\u0131\u011f\u0131 rehberiniz!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/tr\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"tr"},{"@type":"Person","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/365dc158a39a7c8ae256355451e3de48","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"tr","@id":"https:\/\/statorials.org\/tr\/#\/schema\/person\/image\/","url":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"https:\/\/statorials.org\/tr\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Merhaba, ben Benjamin, emekli bir istatistik profes\u00f6r\u00fc ve Statorials \u00f6\u011fretmenine d\u00f6n\u00fc\u015ft\u00fcm. \u0130statistik alan\u0131ndaki kapsaml\u0131 deneyimim ve uzmanl\u0131\u011f\u0131mla, \u00f6\u011frencilerimi Statorials arac\u0131l\u0131\u011f\u0131yla g\u00fc\u00e7lendirmek i\u00e7in bilgilerimi payla\u015fmaya can at\u0131yorum. Daha fazlas\u0131n\u0131 bil","sameAs":["https:\/\/statorials.org\/tr"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/1085","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/comments?post=1085"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/posts\/1085\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/media?parent=1085"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/categories?post=1085"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/tr\/wp-json\/wp\/v2\/tags?post=1085"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}