{"id":1860,"date":"2023-07-24T17:13:02","date_gmt":"2023-07-24T17:13:02","guid":{"rendered":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/"},"modified":"2023-07-24T17:13:02","modified_gmt":"2023-07-24T17:13:02","slug":"r-onjuist-aantal-afmetingen","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/","title":{"rendered":"Fout in r oplossen: onjuist aantal dimensies"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">Een fout die je tegen kunt komen in R is:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong>Error in x[, 3]: incorrect number of dimensions\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Deze fout treedt op wanneer u probeert een object in R onder te verdelen met meer dimensies dan het object heeft.<\/span><\/p>\n<p> <span style=\"color: #000000;\">In deze tutorial wordt precies uitgelegd hoe u deze fout kunt oplossen.<\/span><\/p>\n<h3> <strong>Hoe de fout te reproduceren<\/strong><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat we de volgende vector in R hebben met 10 waarden:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#definevector\n<\/span>x &lt;- c(3, 4, 7, 7, 14, 19, 22, 28, 29, 30)\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">De vector is eendimensionaal, maar stel dat we proberen een subset in twee dimensies te maken:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#attempt to access value in first row and third column\n<\/span>x[, 3]\n\nError in x[, 3]: incorrect number of dimensions\n\n<span style=\"color: #008080;\">#attempt to access value in third row and first column\n<\/span>x[3, ]\n\nError in x[3, ]: incorrect number of dimensions\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We ontvangen een foutmelding omdat we hebben geprobeerd twee dimensies in te delen terwijl de vector slechts \u00e9\u00e9n dimensie heeft.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Hoe u de fout kunt oplossen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">De eenvoudigste manier om deze fout te corrigeren is door eenvoudigweg een enkele dimensie in te delen. Zo krijgt u bijvoorbeeld toegang tot de derde waarde van de vector:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#access third value in vector\n<span style=\"color: #000000;\">x[3]\n<\/span>\n<span style=\"color: #000000;\">[1] 7<\/span>\n<\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We hebben ook toegang tot meerdere waarden van de vector tegelijk. Hier ziet u bijvoorbeeld hoe u toegang krijgt tot de waarden van posities 2 tot en met 5 in de vector:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #008080;\">#access values in positions 2 through 5\n<span style=\"color: #000000;\">x[2:5]\n<\/span>\n<span style=\"color: #000000;\">[1] 4 7 7 14\n<\/span><\/span><\/strong><\/pre>\n<p> <span style=\"color: #000000;\">Omdat we slechts \u00e9\u00e9n dimensie onderverdelen, vermijden we de fout <strong>van een onjuist aantal dimensies<\/strong> <span style=\"color: #000000;\">.<\/span><\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <a href=\"https:\/\/statorials.org\/nl\/nas-onder-dwang-geintroduceerd-in-r\/\" target=\"_blank\" rel=\"noopener\">Hoe op te lossen in R: NA&#8217;s ge\u00efntroduceerd door dwang<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/r-foutindex-buiten-bereik\/\" target=\"_blank\" rel=\"noopener\">Hoe te repareren in R: index buiten bereik<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\" target=\"_blank\" rel=\"noopener\">Hoe op te lossen in R: de lengte van een langer object is geen veelvoud van de lengte van een korter object<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/r-aantal-te-vervangen-items-niet-een-veelvoud-van-de-vervangingslengte\/\" target=\"_blank\" rel=\"noopener\">Hoe te repareren in R: het aantal te vervangen elementen is geen veelvoud van de vervangingslengte<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Een fout die je tegen kunt komen in R is: Error in x[, 3]: incorrect number of dimensions Deze fout treedt op wanneer u probeert een object in R onder te verdelen met meer dimensies dan het object heeft. In deze tutorial wordt precies uitgelegd hoe u deze fout kunt oplossen. Hoe de fout te [&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-1860","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>Fout in R oplossen: onjuist aantal dimensies<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.\" \/>\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\/r-onjuist-aantal-afmetingen\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Fout in R oplossen: onjuist aantal dimensies\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-24T17:13:02+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=\"1\u00a0Minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/\",\"url\":\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/\",\"name\":\"Fout in R oplossen: onjuist aantal dimensies\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-24T17:13:02+00:00\",\"dateModified\":\"2023-07-24T17:13:02+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Fout in r oplossen: onjuist aantal dimensies\"}]},{\"@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":"Fout in R oplossen: onjuist aantal dimensies","description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.","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\/r-onjuist-aantal-afmetingen\/","og_locale":"de_DE","og_type":"article","og_title":"Fout in R oplossen: onjuist aantal dimensies","og_description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.","og_url":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/","og_site_name":"Statorials","article_published_time":"2023-07-24T17:13:02+00:00","author":"Dr.benjamin anderson","twitter_card":"summary_large_image","twitter_misc":{"Verfasst von":"Dr.benjamin anderson","Gesch\u00e4tzte Lesezeit":"1\u00a0Minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/","url":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/","name":"Fout in R oplossen: onjuist aantal dimensies","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-24T17:13:02+00:00","dateModified":"2023-07-24T17:13:02+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u de volgende fout in R kunt oplossen: onjuist aantal dimensies.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/r-onjuist-aantal-afmetingen\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Fout in r oplossen: onjuist aantal dimensies"}]},{"@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\/1860","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=1860"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1860\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1860"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1860"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1860"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}