{"id":3960,"date":"2023-07-14T12:31:00","date_gmt":"2023-07-14T12:31:00","guid":{"rendered":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/"},"modified":"2023-07-14T12:31:00","modified_gmt":"2023-07-14T12:31:00","slug":"identieke-functie-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/","title":{"rendered":"Hoe u dezelfde functie () in r gebruikt (met voorbeelden)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">De functie <strong>identiek()<\/strong> in R kan worden gebruikt om te testen of twee objecten in R exact gelijk zijn of niet.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Deze functie gebruikt de volgende basissyntaxis:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>identiek(x, y, \u2026)<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>x<\/strong> : De naam van een object in R<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>y<\/strong> : De naam van een ander object in R<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Deze functie retourneert <strong>TRUE<\/strong> als de twee objecten exact gelijk zijn, of <strong>FALSE<\/strong> als dat niet het geval is.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende voorbeelden laten zien hoe u deze functie kunt gebruiken om te testen of twee tekenreeksen, twee vectoren en twee dataframes exact gelijk zijn.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld 1: Gebruik identiek() om te testen of twee strings gelijk zijn<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee tekenreeksen gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two strings\n<\/span>string1 &lt;- 'This is some string'\nstring2 &lt;- 'This is some string'\n\n<span style=\"color: #008080;\">#check if two strings are identical\n<\/span>identical(string1, string2)\n\n[1] TRUE\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\"><span style=\"color: #000000;\">De functie retourneert <strong>WAAR<\/strong> omdat de twee tekenreeksen inderdaad precies hetzelfde zijn.<\/span><\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee andere tekenreeksen exact gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two strings\n<\/span>string1 &lt;- 'This is some string'\nstring2 &lt;- 'This is some cool string'\n\n<span style=\"color: #008080;\">#check if two strings are identical\n<\/span>identical(string1, string2)\n\n[1] FALSE<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De functie retourneert <b>FALSE<\/b> omdat de twee tekenreeksen niet precies hetzelfde zijn.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld 2: Gebruik identiek() om te testen of twee vectoren gelijk zijn<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee vectoren gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two vectors\n<\/span>vector1 &lt;- c('A', 'B', 'C', 'D', 'E', 'F')\nvector2 &lt;- c('A', 'B', 'C', 'D', 'E', 'F')\n\n<span style=\"color: #008080;\">#check if two vectors are identical\n<\/span>identical(vector1, vector2)\n\n[1] TRUE\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De functie retourneert <strong>WAAR<\/strong> omdat de twee vectoren inderdaad precies hetzelfde zijn.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee andere vectoren exact gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two vectors\n<\/span>vector1 &lt;- c('A', 'B', 'C', 'D', 'E', 'F')\nvector2 &lt;- c('A', 'B', 'C', 'D')\n\n<span style=\"color: #008080;\">#check if two vectors are identical\n<\/span>identical(vector1, vector2)\n\n[1] FALSE<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De functie retourneert <b>FALSE<\/b> omdat de twee vectoren niet precies hetzelfde zijn.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Voorbeeld 3: Gebruik identiek() om te testen of twee dataframes gelijk zijn<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee gegevensframes gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two data frames\n<\/span>df1 &lt;- data. <span style=\"color: #3366ff;\">frame<\/span> (team=c('A', 'B', 'C', 'D'),\n                  dots=c(14, 20, 22, 29))\n\ndf2 &lt;- data. <span style=\"color: #3366ff;\">frame<\/span> (team=c('A', 'B', 'C', 'D'),\n                  dots=c(14, 20, 22, 29))\n\n<span style=\"color: #008080;\">#check if two data frames are equal\n<\/span>identical(df1, df2)\n\n[1] TRUE\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De functie retourneert <strong>WAAR<\/strong> omdat de twee dataframes inderdaad precies hetzelfde zijn.<\/span><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u de functie <strong>identiek()<\/strong> kunt gebruiken om te testen of twee andere gegevensframes exact gelijk zijn:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#define two data frames\n<\/span>df1 &lt;- data. <span style=\"color: #3366ff;\">frame<\/span> (team=c('A', 'B', 'C', 'D'),\n                  dots=c(14, 20, 22, 29))\n\ndf2 &lt;- data. <span style=\"color: #3366ff;\">frame<\/span> (team=c('A', 'B', 'C', 'D'),\n                  dots=c(99, 20, 22, 29))\n\n<span style=\"color: #008080;\">#check if two data frames are equal\n<\/span>identical(df1, df2)\n\n[1] FALSE<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De functie retourneert <b>FALSE<\/b> omdat de twee gegevensframes niet precies hetzelfde zijn.<\/span><\/p>\n<h2> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h2>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere veelvoorkomende taken in R kunt uitvoeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/r-dimfunctie\/\" target=\"_blank\" rel=\"noopener\">Hoe de dim()-functie in R te gebruiken<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/transformeer-de-functie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe de transform()-functie in R te gebruiken<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/snijpuntfunctie-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe de intersect()-functie in R te gebruiken<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>De functie identiek() in R kan worden gebruikt om te testen of twee objecten in R exact gelijk zijn of niet. Deze functie gebruikt de volgende basissyntaxis: identiek(x, y, \u2026) Goud: x : De naam van een object in R y : De naam van een ander object in R Deze functie retourneert TRUE als [&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-3960","post","type-post","status-publish","format-standard","hentry","category-gids"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v21.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.\" \/>\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\/nl\/identieke-functie-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-14T12:31:00+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=\"Verfasst von\" \/>\n\t<meta name=\"twitter:data1\" content=\"Dr.benjamin anderson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Gesch\u00e4tzte Lesezeit\" \/>\n\t<meta name=\"twitter:data2\" content=\"3\u00a0Minuten\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/\",\"name\":\"Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-14T12:31:00+00:00\",\"dateModified\":\"2023-07-14T12:31:00+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Hoe u dezelfde functie () in r gebruikt (met voorbeelden)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/statorials.org\/nl\/#website\",\"url\":\"https:\/\/statorials.org\/nl\/\",\"name\":\"Statorials\",\"description\":\"Uw gids voor statistische competentie\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/statorials.org\/nl\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"de\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\",\"name\":\"Dr.benjamin anderson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"de\",\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/\",\"url\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"contentUrl\":\"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg\",\"caption\":\"Dr.benjamin anderson\"},\"description\":\"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder\",\"sameAs\":[\"http:\/\/statorials.org\/nl\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials","description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.","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\/nl\/identieke-functie-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials","og_description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.","og_url":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-14T12:31:00+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"3\u00a0Minuten"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/","url":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/","name":"Hoe u dezelfde()-functie in R kunt gebruiken (met voorbeelden) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-14T12:31:00+00:00","dateModified":"2023-07-14T12:31:00+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt met voorbeelden uitgelegd hoe u de functie identiek() in R kunt gebruiken om te testen of twee objecten identiek zijn of niet.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/identieke-functie-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/identieke-functie-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Hoe u dezelfde functie () in r gebruikt (met voorbeelden)"}]},{"@type":"WebSite","@id":"https:\/\/statorials.org\/nl\/#website","url":"https:\/\/statorials.org\/nl\/","name":"Statorials","description":"Uw gids voor statistische competentie","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/statorials.org\/nl\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"de"},{"@type":"Person","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219","name":"Dr.benjamin anderson","image":{"@type":"ImageObject","inLanguage":"de","@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/image\/","url":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","contentUrl":"http:\/\/statorials.org\/nl\/wp-content\/uploads\/2023\/10\/Dr.-Benjamin-Anderson-96x96.jpg","caption":"Dr.benjamin anderson"},"description":"Ik ben Benjamin, een gepensioneerde hoogleraar statistiek die nu een toegewijde Statorials-lesgever is. Ik heb uitgebreide ervaring en expertise op het gebied van statistiek en ik ben vastbesloten om mijn kennis te delen met studenten via Statorials. Lees verder","sameAs":["http:\/\/statorials.org\/nl"]}]}},"yoast_meta":{"yoast_wpseo_title":"","yoast_wpseo_metadesc":"","yoast_wpseo_canonical":""},"_links":{"self":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3960","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/comments?post=3960"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/3960\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=3960"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=3960"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=3960"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}