{"id":1157,"date":"2023-07-27T11:30:10","date_gmt":"2023-07-27T11:30:10","guid":{"rendered":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/"},"modified":"2023-07-27T11:30:10","modified_gmt":"2023-07-27T11:30:10","slug":"excel-importeren-in-r","status":"publish","type":"post","link":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/","title":{"rendered":"Excel-bestanden importeren in r (stap voor stap)"},"content":{"rendered":"<p><\/p>\n<hr>\n<p><span style=\"color: #000000;\">De eenvoudigste manier om een Excel-bestand in R te importeren is door de functie <strong>read_excel()<\/strong> uit het <a href=\"https:\/\/readxl.tidyverse.org\/\" target=\"_blank\" rel=\"noopener noreferrer\">readxl-pakket<\/a> te gebruiken.<\/span><\/p>\n<p> <span style=\"color: #000000;\">Deze functie gebruikt de volgende syntaxis:<\/span><\/p>\n<p> <strong><span style=\"color: #000000;\">read_excel(pad, blad = NULL)<\/span><\/strong><\/p>\n<p> <span style=\"color: #000000;\">Goud:<\/span><\/p>\n<ul>\n<li> <span style=\"color: #000000;\"><strong>pad:<\/strong> pad naar xls\/xlsx-bestand<\/span><\/li>\n<li> <span style=\"color: #000000;\"><strong>blad:<\/strong> het blad dat moet worden gelezen. Dit kan de bladnaam of de bladpositie zijn. Als dit niet is gespecificeerd, wordt het eerste blad gelezen.<\/span><\/li>\n<\/ul>\n<p> <span style=\"color: #000000;\">Deze tutorial geeft een voorbeeld van het gebruik van deze functie om een Excel-bestand in R te importeren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Voorbeeld: importeer een Excel-bestand in R<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">Stel dat ik een Excel-bestand heb opgeslagen op de volgende locatie:<\/span><\/p>\n<p> <span style=\"color: #000000;\"><strong>C:\\Gebruikers\\Bob\\Desktop\\data.xlsx<\/strong><\/span><\/p>\n<p> <span style=\"color: #000000;\">Het bestand bevat de volgende gegevens:<\/span> <\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter wp-image-11600 \" src=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/importerexcel1.png\" alt=\"Excel importeren in R\" width=\"403\" height=\"343\" srcset=\"\" sizes=\"auto, \"><\/p>\n<p> <span style=\"color: #000000;\">De volgende code laat zien hoe u dit Excel-bestand in R importeert:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#install and load readxl package<\/span>\n<span style=\"color: #993300;\">install.packages<\/span> (' <span style=\"color: #008000;\">readxl<\/span> ')\n<span style=\"color: #993300;\">library<\/span> (readxl)\n\n<span style=\"color: #008080;\">#import Excel file into R\n<\/span>data &lt;- read_excel(' <span style=\"color: #008000;\">C:\\\\Users\\\\Bob\\\\Desktop\\\\data.xlsx<\/span> ')\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">Houd er rekening mee dat we dubbele backslashes (\\\\) in het bestandspad hebben gebruikt om de volgende veelvoorkomende fout te voorkomen:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <strong><span style=\"color: #993300;\">Error: '\\U' used without hex digits in character string starting \"\"C:\\U\"<\/span>\n<\/strong><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen de volgende code gebruiken om de gegevens snel te visualiseren:<\/span><\/p>\n<pre style=\"background-color: #ececec; font-size: 15px;\"> <span style=\"color: #000000;\"><strong><span style=\"color: #008080;\">#view entire dataset\n<span style=\"color: #000000;\">data\n\n#A tibble: 5 x 3\n team points assists\n &lt;chr&gt; &lt;dbl&gt; &lt;dbl&gt;\n1 A 78 12\n2 B 85 20\n3 C 93 23\n4 D 90 8\n5 E 91 14<\/span><\/span>\n<\/strong><\/span><\/pre>\n<p> <span style=\"color: #000000;\">We kunnen zien dat R het Excel-bestand importeerde en automatisch bepaalde dat <em>team<\/em> een stringvariabele was, terwijl <em>punten<\/em> en <em>assists<\/em> numerieke variabelen waren.<\/span><\/p>\n<h3> <span style=\"color: #000000;\"><strong>Aanvullende bronnen<\/strong><\/span><\/h3>\n<p> <span style=\"color: #000000;\">In de volgende tutorials wordt uitgelegd hoe u andere bestandstypen in R kunt importeren:<\/span><\/p>\n<p> <a href=\"https:\/\/statorials.org\/nl\/csv-importeren-in-r\/\" target=\"_blank\" rel=\"noopener\">CSV-bestanden importeren in R<\/a><br \/> <span style=\"color: #000000;\"><a href=\"https:\/\/statorials.org\/nl\/importeer-sas-in-r\/\" target=\"_blank\" rel=\"noopener\">SAS-bestanden importeren in R<\/a><br \/> <a href=\"https:\/\/statorials.org\/nl\/voer-gegevens-in-r-in\/\" target=\"_blank\" rel=\"noopener\">Handmatig ruwe gegevens invoeren in R<\/a><br \/><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>De eenvoudigste manier om een Excel-bestand in R te importeren is door de functie read_excel() uit het readxl-pakket te gebruiken. Deze functie gebruikt de volgende syntaxis: read_excel(pad, blad = NULL) Goud: pad: pad naar xls\/xlsx-bestand blad: het blad dat moet worden gelezen. Dit kan de bladnaam of de bladpositie zijn. Als dit niet is gespecificeerd, [&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-1157","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>Excel-bestanden importeren in R (stap voor stap) - Statorials<\/title>\n<meta name=\"description\" content=\"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.\" \/>\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\/excel-importeren-in-r\/\" \/>\n<meta property=\"og:locale\" content=\"de_DE\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Excel-bestanden importeren in R (stap voor stap) - Statorials\" \/>\n<meta property=\"og:description\" content=\"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/\" \/>\n<meta property=\"og:site_name\" content=\"Statorials\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-27T11:30:10+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/importerexcel1.png\" \/>\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\/excel-importeren-in-r\/\",\"url\":\"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/\",\"name\":\"Excel-bestanden importeren in R (stap voor stap) - Statorials\",\"isPartOf\":{\"@id\":\"https:\/\/statorials.org\/nl\/#website\"},\"datePublished\":\"2023-07-27T11:30:10+00:00\",\"dateModified\":\"2023-07-27T11:30:10+00:00\",\"author\":{\"@id\":\"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219\"},\"description\":\"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.\",\"breadcrumb\":{\"@id\":\"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/#breadcrumb\"},\"inLanguage\":\"de\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thuis\",\"item\":\"https:\/\/statorials.org\/nl\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Excel-bestanden importeren in r (stap voor stap)\"}]},{\"@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":"Excel-bestanden importeren in R (stap voor stap) - Statorials","description":"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.","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\/excel-importeren-in-r\/","og_locale":"de_DE","og_type":"article","og_title":"Excel-bestanden importeren in R (stap voor stap) - Statorials","og_description":"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.","og_url":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/","og_site_name":"Statorials","article_published_time":"2023-07-27T11:30:10+00:00","og_image":[{"url":"https:\/\/statorials.org\/wp-content\/uploads\/2023\/08\/importerexcel1.png"}],"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\/excel-importeren-in-r\/","url":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/","name":"Excel-bestanden importeren in R (stap voor stap) - Statorials","isPartOf":{"@id":"https:\/\/statorials.org\/nl\/#website"},"datePublished":"2023-07-27T11:30:10+00:00","dateModified":"2023-07-27T11:30:10+00:00","author":{"@id":"https:\/\/statorials.org\/nl\/#\/schema\/person\/d4b8842173cca1bb62cdec41860e4219"},"description":"In deze tutorial wordt uitgelegd hoe u snel Excel-bestanden in R importeert, met stapsgewijze voorbeelden.","breadcrumb":{"@id":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/#breadcrumb"},"inLanguage":"de","potentialAction":[{"@type":"ReadAction","target":["https:\/\/statorials.org\/nl\/excel-importeren-in-r\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/statorials.org\/nl\/excel-importeren-in-r\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Thuis","item":"https:\/\/statorials.org\/nl\/"},{"@type":"ListItem","position":2,"name":"Excel-bestanden importeren in r (stap voor stap)"}]},{"@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\/1157","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=1157"}],"version-history":[{"count":0,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/posts\/1157\/revisions"}],"wp:attachment":[{"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/media?parent=1157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/categories?post=1157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/statorials.org\/nl\/wp-json\/wp\/v2\/tags?post=1157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}