{"id":360,"date":"2023-12-02T01:40:05","date_gmt":"2023-12-02T01:40:05","guid":{"rendered":"https:\/\/agustincastro.es\/?p=360"},"modified":"2026-01-24T13:22:44","modified_gmt":"2026-01-24T13:22:44","slug":"r-y-starwars-preparando-unos-casos-practicos-con-este-conocido-dataset","status":"publish","type":"post","link":"https:\/\/agustincastro.es\/index.php\/2023\/12\/02\/r-y-starwars-preparando-unos-casos-practicos-con-este-conocido-dataset\/","title":{"rendered":"R, y STARWARS \u00bf?&#8230; Preparando unos casos pr\u00e1cticos con este conocido dataset"},"content":{"rendered":"\n<p><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/t39\/1\/16\/1f4e2.png\" alt=\"\ud83d\udce2\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\"> Seguimos picando c\u00f3digo en R, y avanzando: Esta vez estoy enredado en un proyecto que utiliza el conocido dataset de \u00abSTARWARS\u00bb. Aqu\u00ed va un avance del trabajo&#8230;<\/p>\n\n\n\n<p><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/tac\/1\/16\/1f4cc.png\" alt=\"\ud83d\udccc\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\">  Este conjunto de datos contiene informaci\u00f3n sobre varios personajes de Star Wars, incluyendo caracter\u00edsticas como el nombre, la altura, el peso, el color del cabello, el color de la piel, el g\u00e9nero o el planeta de origen, entre otras. Los datos te permiten practicar con funciones de todo tipo, al tiempo que resulta curioso, por la tem\u00e1tica.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"387\" height=\"493\" data-src=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/starwars.png\" alt=\"\" class=\"wp-image-361 lazyload\" data-srcset=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/starwars.png 387w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/starwars-235x300.png 235w\" data-sizes=\"(max-width: 387px) 100vw, 387px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 387px; --smush-placeholder-aspect-ratio: 387\/493;\" \/><\/figure>\n<\/div>\n\n\n<p><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/t49\/1\/16\/1f4da.png\" alt=\"\ud83d\udcda\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\"><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/t1\/1\/16\/1f4c8.png\" alt=\"\ud83d\udcc8\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\"> Utilizando este dataset he preparado una pr\u00e1ctica en R que consta de unos 30 ejercicios pr\u00e1cticos. <strong>Consultas <\/strong>y <strong>b\u00fasquedas <\/strong>mediante <strong>operadores l\u00f3gicos<\/strong>, <strong>transformaci\u00f3n <\/strong>y <strong>creaci\u00f3n de variables<\/strong> nuevas, limpieza de datos, manejo de los <strong>NAs <\/strong>y <strong>NaN<\/strong>, uso de funciones como <strong>select<\/strong>, <strong>filter<\/strong>, <strong>group_by<\/strong>, <strong>summarise<\/strong>, <strong>arrange<\/strong>, <strong>mutate <\/strong>y, la creaci\u00f3n de gr\u00e1ficos con <strong>ggplot<\/strong>, entre otras tantas.<\/p>\n\n\n\n<p><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/tfc\/1\/16\/1f7e2.png\" alt=\"\ud83d\udfe2\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\">  Estas dos im\u00e1genes son una peque\u00f1a muestra, con un ejemplo concreto: una representaci\u00f3n gr\u00e1fica del \u00cdndice de Masa Corporal calculado para los personajes que tienen como origen el planeta de Tatooine.  Se calcula a partir de datos de altura (m) y masa (kg) &gt; <strong>IMC = peso (kg)\/ [altura (m)]2<\/strong><\/p>\n\n\n\n<p>Este \u00edndice es una herramienta ampliamente utilizada para clasificar a las personas en categor\u00edas de peso y evaluar el riesgo asociado con el peso corporal en t\u00e9rminos de salud&#8230; <strong><em>aunque a C3PO o R5-D4 le va a valer de poco lo que le salga<\/em><\/strong>&#8230; <img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/t40\/1\/16\/1f4a5.png\" alt=\"\ud83d\udca5\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\"><img decoding=\"async\" height=\"16\" width=\"16\" data-src=\"https:\/\/static.xx.fbcdn.net\/images\/emoji.php\/v9\/tc3\/1\/16\/1f4a8.png\" alt=\"\ud83d\udca8\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 16px; --smush-placeholder-aspect-ratio: 16\/16;\"><\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"599\" data-src=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine-1024x599.jpg\" alt=\"\" class=\"wp-image-367 lazyload\" data-srcset=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine-1024x599.jpg 1024w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine-300x175.jpg 300w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine-768x449.jpg 768w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine-1536x898.jpg 1536w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/IMC-personajes-en-Tatooine.jpg 1845w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/599;\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"819\" data-src=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-1024x819.jpg\" alt=\"\" class=\"wp-image-363 lazyload\" data-srcset=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-1024x819.jpg 1024w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-300x240.jpg 300w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-768x615.jpg 768w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-1536x1229.jpg 1536w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/tatooine_names_IMC-2048x1639.jpg 2048w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/819;\" \/><\/figure>\n\n\n\n<p>No todo van a ser longitud de s\u00e9palos, p\u00e9talos y el dataset de mtcars&#8230; <\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"576\" data-src=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-1024x576.png\" alt=\"\" class=\"wp-image-364 lazyload\" data-srcset=\"https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-1024x576.png 1024w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-300x169.png 300w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-768x432.png 768w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-1536x864.png 1536w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image-1280x720.png 1280w, https:\/\/agustincastro.es\/wp-content\/uploads\/2023\/12\/image.png 1920w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/576;\" \/><\/figure>\n\n\n\n<p>eof<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Seguimos picando c\u00f3digo en R, y avanzando: Esta vez estoy enredado en un proyecto que utiliza el conocido dataset de \u00abSTARWARS\u00bb. Aqu\u00ed va un avance del trabajo&#8230; Este conjunto de datos contiene informaci\u00f3n sobre varios personajes de Star Wars, incluyendo caracter\u00edsticas como el nombre, la altura, el peso, el color del cabello, el color de [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":364,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,5],"tags":[],"class_list":["post-360","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-r","category-tecnica-y-practica"],"_links":{"self":[{"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/posts\/360","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/comments?post=360"}],"version-history":[{"count":3,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/posts\/360\/revisions"}],"predecessor-version":[{"id":368,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/posts\/360\/revisions\/368"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/media\/364"}],"wp:attachment":[{"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/media?parent=360"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/categories?post=360"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/agustincastro.es\/index.php\/wp-json\/wp\/v2\/tags?post=360"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}