{"id":76291,"date":"2020-04-01T13:42:28","date_gmt":"2020-04-01T11:42:28","guid":{"rendered":"https:\/\/prohoster.info\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider"},"modified":"2020-04-01T13:42:28","modified_gmt":"2020-04-01T11:42:28","slug":"r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider","status":"publish","type":"post","link":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider","title":{"rendered":"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider","gt_translate_keys":[{"key":"rendered","format":"text"}]},"content":{"rendered":"<p>Paketa <strong>tidyr<\/strong> b\u00ebn\u00eb pjes\u00eb n\u00eb b\u00ebrtham\u00ebn e nj\u00eb prej bibliotekave m\u00eb t\u00eb njohura n\u00eb gjuh\u00ebn R \u2014 <strong>tidyverse<\/strong>.<br \/>\nQ\u00ebllimi kryesor i paket\u00ebs \u00ebsht\u00eb t\u00eb sjell\u00eb t\u00eb dh\u00ebnat n\u00eb nj\u00eb form\u00eb t\u00eb organizuar.<\/p>\n<p><\/p>\n<p>N\u00eb Habr\u00eb tashm\u00eb ekziston <noindex><a rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/248741\/\">publikimi<\/a><\/noindex> e dedikuar p\u00ebr k\u00ebt\u00eb paket\u00eb, por \u00ebsht\u00eb e datuar n\u00eb vitin 2015. Un\u00eb dua t\u00eb flas p\u00ebr ndryshimet m\u00eb t\u00eb r\u00ebnd\u00ebsishme, p\u00ebr t\u00eb cilat autori i saj, Hadley Wickham, njoftoi para disa dit\u00ebsh.<\/p>\n<p>\n<img decoding=\"async\" alt=\"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider\" src=\"\/wp-content\/uploads\/2020\/04\/a290263b63aaea3db70e83a1ec411415.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<blockquote><p><b>SJK<\/b>: A do t\u00eb konsiderohen funksionet gather() dhe spread() t\u00eb vjetra?<\/p>\n<p><b>Hadley Wickham<\/b>: N\u00eb nj\u00eb far\u00eb m\u00ebnyre. Ne do t\u00eb ndalojm\u00eb rekomandimin e p\u00ebrdorimit t\u00eb k\u00ebtyre funksioneve dhe do t\u00eb ndalojm\u00eb rregullimin e gabimeve n\u00eb to, por ato do t\u00eb vazhdojn\u00eb t\u00eb jen\u00eb t\u00eb pranishme n\u00eb paket\u00eb n\u00eb gjendjen aktuale.<\/p><\/blockquote>\n<p><noindex><a rel=\"nofollow\" name=\"habracut\"><\/a><\/noindex><\/p>\n<h2 id=\"soderzhanie\">P\u00ebrmbajtja<\/h2>\n<p><\/p>\n<p><em>N\u00ebse jeni t\u00eb interesuar p\u00ebr analiz\u00ebn e t\u00eb dh\u00ebnave, ndoshta do t'ju interesojn\u00eb kanalet e mia <noindex><a rel=\"nofollow\" href=\"https:\/\/t.me\/R4marketing\">telegram<\/a><\/noindex> dhe <noindex><a rel=\"nofollow\" href=\"https:\/\/www.youtube.com\/R4marketing\/?sub_confirmation=1\">youtube<\/a><\/noindex> Shumica e p\u00ebrmbajtjes s\u00eb tyre \u00ebsht\u00eb e dedikuar gjuh\u00ebs R.<\/em><\/p>\n<p><\/p>\n<ul>\n<li><noindex><a rel=\"nofollow\" href=\"#koncepciya-tidydata\">Koncepti TidyData<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#osnovnye-funkcii-vhodyaschie-v-paket-tydir\">Funksionet kryesore q\u00eb p\u00ebrfshihen n\u00eb paket\u00ebn tidyr<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#novaya-koncepciya-preobrazovaniya-dannyh-iz-shirokogo-formata-v-dlinnyy-i-naoborot\">Nj\u00eb koncept i ri p\u00ebr transformimin e t\u00eb dh\u00ebnave nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb dhe anasjelltas<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"http:\/\/ustnovka-naibolee-aktualnoy-versii-tidyr-0839000\">Instaloni versionin m\u00eb t\u00eb fundit t\u00eb tidyr 0.8.3.9000<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#perehod-na-novye-funkcii\">Kalim n\u00eb funksionet e reja<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#prostoy-primer-preobrazovaniya-dannyh-iz-shirokogo-formata-v-dlinnyy\">Nj\u00eb shembull i thjesht\u00eb i transformimit t\u00eb t\u00eb dh\u00ebnave nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#specifikacii\">Specifikimet<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#specifikaciya-s-ispolzovaniem-neskolkih-znacheniyvalue\">Specifikimi duke p\u00ebrdorur disa vlera (.value)<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#preobrazovanie-data-freymov-iz-dlinnogo-formata-k-shirokomu\">Transformimi i frame-ve t\u00eb t\u00eb dh\u00ebnave nga formati i gjat\u00eb n\u00eb t\u00eb gjer\u00eb<\/a><\/noindex>\n<ul>\n<li><noindex><a rel=\"nofollow\" href=\"#prosteyshiy-primer-privedeniya-tablicy-k-shirokomu-formatu\">Shembulli m\u00eb i thjesht\u00eb i sjelljes s\u00eb nj\u00eb tabele n\u00eb format t\u00eb gjer\u00eb<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#generaciya-imeni-stolbca-iz-neskolkih-ishodnyh-peremennyh\">Gjenerimi i emrit t\u00eb kolon\u00ebs nga disa variabla burimor\u00eb<\/a><\/noindex><\/li>\n<\/ul>\n<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#neskolko-prodvinutyh-primerov-raboty-s-novoy-koncepciey-tidyr\">Disa shembuj m\u00eb t\u00eb avancuar t\u00eb pun\u00ebs me konceptin e ri tidyr<\/a><\/noindex>\n<ul>\n<li><noindex><a rel=\"nofollow\" href=\"#privedenie-dannyh-k-akkuratnomu-vidu-na-primere-nabora-dannyh-o-perepisi-dohoda-i-arendnoy-platy-v-ssha\">Shtyrja e t\u00eb dh\u00ebnave n\u00eb nj\u00eb form\u00eb t\u00eb organizuar me shembuj nga kompleti i t\u00eb dh\u00ebnave p\u00ebr popullsin\u00eb dhe qiradh\u00ebnien n\u00eb SHBA<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#vsemirnyy-bank\">Bank\u00ebn Bot\u00ebrore<\/a><\/noindex><\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#spisok-kontaktov\">Lista e kontakteve<\/a><\/noindex><\/li>\n<\/ul>\n<\/li>\n<li><noindex><a rel=\"nofollow\" href=\"#zaklyuchenie\">P\u00ebrfundimi<\/a><\/noindex><\/li>\n<\/ul>\n<p><\/p>\n<h2 id=\"koncepciya-tidydata\">Koncepti TidyData<\/h2>\n<p><\/p>\n<p>Q\u00ebllimi <strong>tidyr<\/strong> \u2014 p\u00ebr t'ju ndihmuar t\u00eb sjellni t\u00eb dh\u00ebnat n\u00eb nj\u00eb form\u00eb t\u00eb organizuar. T\u00eb dh\u00ebnat e organizuara jan\u00eb ato ku: <\/p>\n<p><\/p>\n<ul>\n<li>\u00c7do variab\u00ebl \u00ebsht\u00eb n\u00eb nj\u00eb kolon\u00eb. <\/li>\n<li>\u00c7do v\u00ebzhgim \u00ebsht\u00eb nj\u00eb rresht. <\/li>\n<li>\u00c7do vler\u00eb \u00ebsht\u00eb nj\u00eb celul.<\/li>\n<\/ul>\n<p><\/p>\n<p>Me t\u00eb dh\u00ebnat q\u00eb jan\u00eb sjell\u00eb n\u00eb form\u00ebn tidy data, \u00ebsht\u00eb shum\u00eb m\u00eb e leht\u00eb t\u00eb punoni gjat\u00eb analizes.<\/p>\n<p><\/p>\n<h2 id=\"osnovnye-funkcii-vhodyaschie-v-paket-tidyr\">Funksionet kryesore q\u00eb p\u00ebrfshihen n\u00eb paket\u00ebn tidyr<\/h2>\n<p><\/p>\n<p>tidyr p\u00ebrmban nj\u00eb grup funksionesh t\u00eb dizajnuara p\u00ebr transformimin e tabelave:<\/p>\n<p><\/p>\n<ul>\n<li><code>fill()<\/code> \u2014 mbushja e vlerave t\u00eb humbura n\u00eb kolon\u00eb me vlerat p\u00ebrpara;<\/li>\n<li><code>separate()<\/code> \u2014 ndan nj\u00eb fush\u00eb n\u00eb disa n\u00ebp\u00ebrmjet ndar\u00ebsit;<\/li>\n<li><code>unite()<\/code> \u2014 b\u00ebn operacionin e bashkimit t\u00eb disa fushave n\u00eb nj\u00eb, nj\u00eb veprim i kund\u00ebrt me funksionin <code>separate()<\/code>;<\/li>\n<li><code>pivot_longer()<\/code> \u2014 funksioni q\u00eb transformon t\u00eb dh\u00ebnat nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb;<\/li>\n<li><code>pivot_wider()<\/code> \u2014 funksioni q\u00eb transformon t\u00eb dh\u00ebnat nga formati i gjat\u00eb n\u00eb t\u00eb gjer\u00eb. Operacioni i kund\u00ebrt i asaj q\u00eb b\u00ebn funksioni <code>pivot_longer()<\/code>.<\/li>\n<li><code>gather()<\/code><strong>i vjetruar<\/strong> \u2014 funksioni q\u00eb transformon t\u00eb dh\u00ebnat nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb;<\/li>\n<li><code>spread()<\/code><strong>i vjetruar<\/strong> \u2014 funksioni q\u00eb transformon t\u00eb dh\u00ebnat nga formati i gjat\u00eb n\u00eb t\u00eb gjer\u00eb. Operacioni i kund\u00ebrt i asaj q\u00eb b\u00ebn funksioni <code>gather()<\/code>.<\/li>\n<\/ul>\n<p><\/p>\n<h2 id=\"novaya-koncepciya-preobrazovaniya-dannyh-iz-shirokogo-formata-v-dlinnyy-i-naoborot\">Nj\u00eb koncept i ri p\u00ebr transformimin e t\u00eb dh\u00ebnave nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb dhe anasjelltas<\/h2>\n<p><\/p>\n<p>M\u00eb par\u00eb p\u00ebr k\u00ebt\u00eb lloj transformimi ishin p\u00ebrdorur funksionet <code>gather()<\/code> dhe <code>spread()<\/code>. N\u00eb vitet e ekzistenc\u00ebs s\u00eb k\u00ebtyre funksioneve, \u00ebsht\u00eb b\u00ebr\u00eb e qart\u00eb se p\u00ebr shumic\u00ebn e p\u00ebrdoruesve, p\u00ebrfshir\u00eb autorin e paket\u00ebs, emrat e k\u00ebtyre funksioneve dhe argumenteve t\u00eb tyre ishin mjaft t\u00eb paqarta, duke shkaktuar v\u00ebshtir\u00ebsi n\u00eb k\u00ebrkimin dhe kuptimin se cili nga k\u00ebto funksione sillte frame-in e t\u00eb dh\u00ebnave nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb dhe anasjelltas.<\/p>\n<p><\/p>\n<p>P\u00ebr k\u00ebt\u00eb arsye, n\u00eb <strong>tidyr<\/strong> jan\u00eb shtuar dy funksione t\u00eb reja, t\u00eb r\u00ebnd\u00ebsishme, t\u00eb dizajnuara p\u00ebr transformimin e frame-ve t\u00eb t\u00eb dh\u00ebnave.<\/p>\n<p><\/p>\n<p>Funkcionet e reja <code>pivot_longer()<\/code> dhe <code>pivot_wider()<\/code> kan\u00eb qen\u00eb t\u00eb frym\u00ebzuar nga disa funksione nga paketa <strong>cdata<\/strong>, e krijuar nga John Mount dhe Nina Zumel.<\/p>\n<p><\/p>\n<h3 id=\"ustanovka-naibolee-aktualnoy-versii-tidyr-0839000\">Instaloni versionin m\u00eb t\u00eb fundit t\u00eb tidyr 0.8.3.9000<\/h3>\n<p><\/p>\n<p>P\u00ebr t\u00eb instaluar versionin e ri, m\u00eb t\u00eb fundit t\u00eb paket\u00ebs <strong>tidyr<\/strong> <em>0.8.3.9000<\/em>, n\u00eb t\u00eb cilin funksionet e reja jan\u00eb t\u00eb disponueshme, p\u00ebrdorni kodin e m\u00ebposht\u00ebm.<\/p>\n<p><\/p>\n<p><code>devtools::install_github(\"tidyverse\/tidyr\")<\/code><\/p>\n<p><\/p>\n<p>N\u00eb koh\u00ebn e shkrimit t\u00eb k\u00ebtij artikulli, k\u00ebto funksione jan\u00eb t\u00eb disponueshme vet\u00ebm n\u00eb versionin dev t\u00eb paket\u00ebs n\u00eb GitHub.<\/p>\n<p><\/p>\n<h3 id=\"perehod-na-novye-funkcii\">Kalim n\u00eb funksionet e reja<\/h3>\n<p><\/p>\n<p>N\u00eb t\u00eb v\u00ebrtet\u00eb, t\u00eb kalosh skriptet e vjetra p\u00ebr t\u00eb punuar me funksionet e reja nuk \u00ebsht\u00eb e v\u00ebshtir\u00eb; p\u00ebr m\u00eb shum\u00eb kuptim, do t\u00eb marr nj\u00eb shembull nga dokumentacioni i funksioneve t\u00eb vjetra dhe do t\u00eb tregoj si k\u00ebto operacione kryhen me ndihm\u00ebn e titujve t\u00eb rinj <code>pivot_*()<\/code> funksione.<\/p>\n<p><\/p>\n<p>Transformimi i formatit t\u00eb gjer\u00eb n\u00eb t\u00eb gjat\u00eb.<\/p>\n<p>\n<b class=\"spoiler_title\">Shembulli i kodit nga dokumentacioni i funksionit gather<\/b><\/p>\n<pre><code class=\"plaintext\"># example\nlibrary(dplyr)\nstocks &lt;- data.frame(\n  time = as.Date('2009-01-01') + 0:9,\n  X = rnorm(10, 0, 1),\n  Y = rnorm(10, 0, 2),\n  Z = rnorm(10, 0, 4)\n)\n\n# old\nstocks_gather &lt;- stocks %&gt;% gather(key   = stock, \n                                   value = price, \n                                   -time)\n\n# new\nstocks_long   &lt;- stocks %&gt;% pivot_longer(cols      = -time, \n                                       names_to  = &quot;stock&quot;, \n                                       values_to = &quot;price&quot;)\n<\/code><\/pre>\n<p><\/p>\n<p>Transformimi i formatit t\u00eb gjat\u00eb n\u00eb t\u00eb gjer\u00eb.<\/p>\n<p>\n<b class=\"spoiler_title\">Shembulli i kodit nga dokumentacioni i funksionit spread<\/b><\/p>\n<pre><code class=\"plaintext\"># old\nstocks_spread &lt;- stocks_gather %&gt;% spread(key = stock, \n                                          value = price) \n\n# new \nstock_wide    &lt;- stocks_long %&gt;% pivot_wider(names_from  = &quot;stock&quot;,\n                                            values_from = &quot;price&quot;)\n<\/code><\/pre>\n<p><\/p>\n<p>Duke qen\u00eb se n\u00eb shembujt e m\u00ebsip\u00ebrm t\u00eb pun\u00ebs me <code>pivot_longer()<\/code> dhe <code>pivot_wider()<\/code>, n\u00eb tabel\u00ebn e origjin\u00ebs <em>stocks<\/em> nuk ka kolonash t\u00eb p\u00ebrmendura n\u00eb argumentet <em>names_to<\/em> dhe <em>values_to<\/em> emrat e tyre duhet t\u00eb p\u00ebrcaktohen n\u00eb thonj\u00ebza.<\/p>\n<p><\/p>\n<p>Tabela me t\u00eb cil\u00ebn do t'ju jet\u00eb m\u00eb e leht\u00eb t\u00eb kuptoni se si t\u00eb kaloni n\u00eb pun\u00ebn me konceptin e ri <strong>tidyr<\/strong>.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider\" src=\"\/wp-content\/uploads\/2020\/04\/fe598b5cd152088a2f1b23b846d212e9.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<h2 id=\"primechanie-ot-avtora\">V\u00ebrejtje nga autori<\/h2>\n<p><\/p>\n<blockquote><p>I gjith\u00eb teksti i m\u00ebpassh\u00ebm \u00ebsht\u00eb nj\u00eb p\u00ebrkthim adaptiv, madje mund ta quaja p\u00ebrkthim t\u00eb lir\u00eb <noindex><a rel=\"nofollow\" href=\"https:\/\/tidyr.tidyverse.org\/dev\/articles\/pivot.html\">vignettes<\/a><\/noindex> nga faqja zyrtare e bibliotek\u00ebs tidyverse.<\/p><\/blockquote>\n<p><\/p>\n<h2 id=\"prostoy-primer-preobrazovaniya-dannyh-iz-shirokogo-formata-v-dlinnyy\">Nj\u00eb shembull i thjesht\u00eb i transformimit t\u00eb t\u00eb dh\u00ebnave nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb<\/h2>\n<p><\/p>\n<p><code>pivot_longer ()<\/code> \u2014 b\u00ebn setet e t\u00eb dh\u00ebnave m\u00eb t\u00eb gjat\u00eb, duke reduktuar numrin e kolonnave dhe duke rritur numrin e rreshtave.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider\" src=\"\/wp-content\/uploads\/2020\/04\/fc88b99f2fecdcdaa6179d2e7d29e59d.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>P\u00ebr t\u00eb realizuar shembujt e paraqitur n\u00eb artikull, fillimisht \u00ebsht\u00eb e nevojshme t\u00eb ngarkoni paketat e nevojshme:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">library(tidyr)\nlibrary(dplyr)\nlibrary(readr)<\/code><\/pre>\n<p><\/p>\n<p>Le t\u00eb supozojm\u00eb se kemi nj\u00eb tabel\u00eb me rezultatet e nj\u00eb ankete, n\u00eb t\u00eb cil\u00ebn (nd\u00ebr t\u00eb tjera) iu k\u00ebrkua njer\u00ebzve p\u00ebr besimin e tyre dhe t\u00eb ardhurat e tyre vjetore:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 18 x 11\n#&gt;    religion `&lt;$10k` `$10-20k` `$20-30k` `$30-40k` `$40-50k` `$50-75k`\n#&gt;    &lt;chr&gt;      &lt;dbl&gt;     &lt;dbl&gt;     &lt;dbl&gt;     &lt;dbl&gt;     &lt;dbl&gt;     &lt;dbl&gt;\n#&gt;  1 Agnostic      27        34        60        81        76       137\n#&gt;  2 Atheist       12        27        37        52        35        70\n#&gt;  3 Buddhist      27        21        30        34        33        58\n#&gt;  4 Catholic     418       617       732       670       638      1116\n#&gt;  5 Don\u2019t k\u2026      15        14        15        11        10        35\n#&gt;  6 Evangel\u2026     575       869      1064       982       881      1486\n#&gt;  7 Hindu          1         9         7         9        11        34\n#&gt;  8 Histori\u2026     228       244       236       238       197       223\n#&gt;  9 Jehovah\u2026      20        27        24        24        21        30\n#&gt; 10 Jewish        19        19        25        25        30        95\n#&gt; # \u2026 with 8 more rows, and 4 more variables: `$75-100k` &lt;dbl&gt;,\n#&gt; #   `$100-150k` &lt;dbl&gt;, `&gt;150k` &lt;dbl&gt;, `Don't know\/refused` &lt;dbl&gt;<\/code><\/pre>\n<p><\/p>\n<p>Ky tabela p\u00ebrmban t\u00eb dh\u00ebna mbi fen\u00eb e respondent\u00ebve n\u00eb rreshta, nd\u00ebrsa nivelet e t\u00eb ardhurave jan\u00eb shp\u00ebrndar\u00eb n\u00eb emrat e kolonave. Numri i respondent\u00ebve nga \u00e7do kategori ruhet n\u00eb vlerat e qelizave n\u00eb nd\u00ebrthyerjen e fes\u00eb dhe nivelit t\u00eb t\u00eb ardhurave. P\u00ebr ta sjell\u00eb tabel\u00ebn n\u00eb nj\u00eb format t\u00eb past\u00ebr dhe t\u00eb sakt\u00eb, mjafton t\u00eb p\u00ebrdorni <code>pivot_longer()<\/code>:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">pew %&gt;% \n  pivot_longer(cols = -religion, names_to = \"income\", values_to = \"count\")<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">pew %&gt;% \n  pivot_longer(cols = -religion, names_to = \"income\", values_to = \"count\")\n#&gt; # A tibble: 180 x 3\n#&gt;    religion income             count\n#&gt;                      \n#&gt;  1 Agnostic   2 Agnostic $10-20k               34\n#&gt;  3 Agnostic $20-30k               60\n#&gt;  4 Agnostic $30-40k               81\n#&gt;  5 Agnostic $40-50k               76\n#&gt;  6 Agnostic $50-75k              137\n#&gt;  7 Agnostic $75-100k             122\n#&gt;  8 Agnostic $100-150k            109\n#&gt;  9 Agnostic &gt;150k                 84\n#&gt; 10 Agnostic Don't know\/refused    96\n#&gt; # \u2026 with 170 more rows<\/code><\/pre>\n<p><\/p>\n<p>Argumentet e funksionit <code>pivot_longer()<\/code><\/p>\n<p><\/p>\n<ul>\n<li>Argumenti i par\u00eb <em>cols<\/em>, p\u00ebrshkruan, cilat kolona duhet t\u00eb bashkohen. N\u00eb k\u00ebt\u00eb rast, t\u00eb gjitha kolonat, p\u00ebrve\u00e7 <em>time<\/em>.<\/li>\n<li>Argumenti <em>names_to<\/em> i jep emrin e variablit q\u00eb do t\u00eb krijohet nga emrat e kolonave q\u00eb kemi bashkuar.<\/li>\n<li><em>values_to<\/em> i jep emrin e variablit q\u00eb do t\u00eb krijohet nga t\u00eb dh\u00ebnat q\u00eb ruhen n\u00eb vlerat e qelizave t\u00eb kolonave t\u00eb bashkuara.<\/li>\n<\/ul>\n<p><\/p>\n<h2 id=\"specifikacii\">Specifikimet<\/h2>\n<p><\/p>\n<p>Ky \u00ebsht\u00eb nj\u00eb funksionalitet i ri i paket\u00ebs <strong>tidyr<\/strong>, i cili m\u00eb par\u00eb, duke punuar me funksione t\u00eb vjetruara, nuk ishte n\u00eb dispozicion.<\/p>\n<p><\/p>\n<p>Specifikimi \u00ebsht\u00eb nj\u00eb kad\u00ebr t\u00eb dh\u00ebnash, \u00e7do rresht i t\u00eb cilit i p\u00ebrkon nj\u00eb kolone n\u00eb kadrin e t\u00eb dh\u00ebnave t\u00eb reja, si dhe dy kolona speciale q\u00eb fillojn\u00eb me: <\/p>\n<p><\/p>\n<ul>\n<li><em>.em\u00ebr<\/em> p\u00ebrmban emrin origjinal t\u00eb kolon\u00ebs. <\/li>\n<li><em>.value<\/em> p\u00ebrmban emrin e kolon\u00ebs, n\u00eb t\u00eb cil\u00ebn do t\u00eb futen vlerat e qelizave. <\/li>\n<\/ul>\n<p><\/p>\n<p>Kolonat e tjera t\u00eb specifikimit pasqyrojn\u00eb se si do t\u00eb shfaqet emri i kolonave t\u00eb kompresuara n\u00eb <em>.em\u00ebr<\/em>.<\/p>\n<p><\/p>\n<p>Specifikimi p\u00ebrshkruan metadata q\u00eb ruhen n\u00eb emrin e kolon\u00ebs, me nj\u00eb rresht p\u00ebr \u00e7do kolon\u00eb dhe nj\u00eb kolone p\u00ebr \u00e7do variab\u00ebl t\u00eb bashkuar me emrin e kolon\u00ebs, ndoshta tani ky p\u00ebrkufizim duket i nd\u00ebrlikuar, por pas shqyrtimit t\u00eb disa shembujve gjith\u00e7ka do t\u00eb b\u00ebhet shum\u00eb m\u00eb e qart\u00eb.<\/p>\n<p><\/p>\n<p>K\u00ebrkesa e specifikimit \u00ebsht\u00eb q\u00eb ju mund t\u00eb nxirrni, modifikoni dhe vendosni metadata t\u00eb reja p\u00ebr kadrin e t\u00eb dh\u00ebnave t\u00eb transformuar.<\/p>\n<p><\/p>\n<p>P\u00ebr t\u00eb punuar me specifikacione kur transformoni tabel\u00ebn nga formati i gjer\u00eb n\u00eb t\u00eb gjat\u00eb, sh\u00ebrben funksioni <code>pivot_longer_spec()<\/code>.<\/p>\n<p><\/p>\n<p>Si funksionon ky funksion, ai merr \u00e7do kadrin e t\u00eb dh\u00ebnave dhe formon metadat\u00ebn e tij n\u00eb m\u00ebnyr\u00ebn e p\u00ebrshkruar m\u00eb sip\u00ebr. <\/p>\n<p><\/p>\n<p>P\u00ebr shembull, le t\u00eb marrim grupin e t\u00eb dh\u00ebnave q\u00eb ofrohet me paket\u00ebn <strong>tidyr<\/strong>. Ky grup t\u00eb dh\u00ebnash p\u00ebrmban informacion t\u00eb ofruar nga Organizata Bot\u00ebrore e Sh\u00ebndet\u00ebsis\u00eb mbi s\u00ebmundshm\u00ebrin\u00eb e tuberkulozit.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">who\n#&gt; # Nj\u00eb tibble: 7,240 x 60\n#&gt;    country iso2  iso3   year new_sp_m014 new_sp_m1524 new_sp_m2534\n#&gt;        &lt;chr&gt; &lt;int&gt;       &lt;int&gt;        &lt;int&gt;        &lt;int&gt;\n#&gt;  1 Afghan\u2026 AF    AFG    1980          NA           NA           NA\n#&gt;  2 Afghan\u2026 AF    AFG    1981          NA           NA           NA\n#&gt;  3 Afghan\u2026 AF    AFG    1982          NA           NA           NA\n#&gt;  4 Afghan\u2026 AF    AFG    1983          NA           NA           NA\n#&gt;  5 Afghan\u2026 AF    AFG    1984          NA           NA           NA\n#&gt;  6 Afghan\u2026 AF    AFG    1985          NA           NA           NA\n#&gt;  7 Afghan\u2026 AF    AFG    1986          NA           NA           NA\n#&gt;  8 Afghan\u2026 AF    AFG    1987          NA           NA           NA\n#&gt;  9 Afghan\u2026 AF    AFG    1988          NA           NA           NA\n#&gt; 10 Afghan\u2026 AF    AFG    1989          NA           NA           NA\n#&gt; # \u2026 me 7,230 rreshta t\u00eb tjera, dhe 53 variabla t\u00eb tjer\u00eb<\/code><\/pre>\n<p><\/p>\n<p>Le ta nisim specifikimin e tij.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">spec %\n  pivot_longer_spec(new_sp_m014:newrel_f65, values_to = \"count\")<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 56 x 3\n#&gt;    .name        .value name        \n#&gt;    &lt;chr&gt;        &lt;chr&gt;  &lt;chr&gt;       \n#&gt;  1 new_sp_m014  count  new_sp_m014 \n#&gt;  2 new_sp_m1524 count  new_sp_m1524\n#&gt;  3 new_sp_m2534 count  new_sp_m2534\n#&gt;  4 new_sp_m3544 count  new_sp_m3544\n#&gt;  5 new_sp_m4554 count  new_sp_m4554\n#&gt;  6 new_sp_m5564 count  new_sp_m5564\n#&gt;  7 new_sp_m65   count  new_sp_m65  \n#&gt;  8 new_sp_f014  count  new_sp_f014 \n#&gt;  9 new_sp_f1524 count  new_sp_f1524\n#&gt; 10 new_sp_f2534 count  new_sp_f2534\n#&gt; # \u2026 with 46 more rows<\/code><\/pre>\n<p><\/p>\n<p>Fushat <em>country<\/em>, <em>iso2<\/em>, <em>iso3<\/em> tani q\u00eb jan\u00eb variabla. Detyra jon\u00eb \u00ebsht\u00eb t\u00eb p\u00ebrmbysim kolonat me <em>new_sp_m014<\/em> p\u00ebr <em>newrel_f65<\/em>.<\/p>\n<p><\/p>\n<p>N\u00eb emrat e k\u00ebtyre kolonave ruhet informacioni n\u00eb vijim:<\/p>\n<p><\/p>\n<ul>\n<li>Prefiksi <code>new_<\/code> tregon se p\u00ebrmban t\u00eb dh\u00ebna mbi rastet e reja t\u00eb s\u00ebmundjes s\u00eb tuberkulozit, modeli i tanish\u00ebm i t\u00eb dh\u00ebnave p\u00ebrmban informacion vet\u00ebm p\u00ebr rastet e reja, prandaj ky prefiks nuk ka asnj\u00eb p\u00ebrcaktim n\u00eb k\u00ebt\u00eb kontekst.<\/li>\n<li><code>sp<\/code>\/<code>rel<\/code>\/<code>sp<\/code>\/<code>ep<\/code> p\u00ebrshkruan metod\u00ebn e diagnoz\u00ebs s\u00eb s\u00ebmundjes.<\/li>\n<li><code>m<\/code>\/<code>f<\/code> gjinia e pacientit.<\/li>\n<li><code>014<\/code>\/<code>1524<\/code>\/<code>2535<\/code>\/<code>3544<\/code>\/<code>4554<\/code>\/<code>65<\/code> grupi moshor i pacientit.<\/li>\n<\/ul>\n<p><\/p>\n<p>Ne mund t\u00eb ndajm\u00eb k\u00ebto kolona duke p\u00ebrdorur funksionin <code>extract()<\/code>, duke p\u00ebrdorur shprehjen e rregullt.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">spec %\n        extract(name, c(\"diagnosis\", \"gender\", \"age\"), \"new_?(.*)_(.)(.*)\")<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 56 x 5\n#&gt;    .name        .value diagnosis gender age  \n#&gt;    &lt;chr&gt;        &lt;chr&gt;  &lt;chr&gt;     &lt;chr&gt;  &lt;chr&gt;\n#&gt;  1 new_sp_m014  count  sp        m      014  \n#&gt;  2 new_sp_m1524 count  sp        m      1524 \n#&gt;  3 new_sp_m2534 count  sp        m      2534 \n#&gt;  4 new_sp_m3544 count  sp        m      3544 \n#&gt;  5 new_sp_m4554 count  sp        m      4554 \n#&gt;  6 new_sp_m5564 count  sp        m      5564 \n#&gt;  7 new_sp_m65   count  sp        m      65   \n#&gt;  8 new_sp_f014  count  sp        f      014  \n#&gt;  9 new_sp_f1524 count  sp        f      1524 \n#&gt; 10 new_sp_f2534 count  sp        f      2534 \n#&gt; # \u2026 with 46 more rows<\/code><\/pre>\n<p><\/p>\n<p>Vini re, kolona <em>.em\u00ebr<\/em> duhet t\u00eb mbetet e pandryshuar, pasi \u00ebsht\u00eb indeksi yn\u00eb n\u00eb emrat e kolonave t\u00eb grupit t\u00eb t\u00eb dh\u00ebnave origjinale. <\/p>\n<p><\/p>\n<p>Gjinia dhe mosha (kolonat <em>gender<\/em> dhe <em>age<\/em>) kan\u00eb vlera fikse dhe t\u00eb njohura, prandaj \u00ebsht\u00eb e rekomandueshme t'i transformojm\u00eb k\u00ebto kolona n\u00eb faktor\u00eb:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">spec %\n            mutate(\n              gender = factor(gender, levels = c(\"f\", \"m\")),\n              age = factor(age, levels = unique(age), ordered = TRUE)\n            ) <\/code><\/pre>\n<p><\/p>\n<p>N\u00eb fund, p\u00ebr t\u00eb aplikuar specifikimin q\u00eb krijuam n\u00eb kadrin ton\u00eb t\u00eb t\u00eb dh\u00ebnave <em>who<\/em> na nevojitet t\u00eb p\u00ebrdorim argumentin <em>spec<\/em> n\u00eb funksionin <code>pivot_longer()<\/code>.<\/p>\n<p><\/p>\n<p><code>who %&gt;% pivot_longer(spec = spec)<\/code><\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 405,440 x 8\n#&gt;    country     iso2  iso3   year diagnosis gender age   count\n#&gt;    &lt;chr&gt;       &lt;chr&gt; &lt;chr&gt; &lt;int&gt; &lt;chr&gt;     &lt;fct&gt;  &lt;ord&gt; &lt;int&gt;\n#&gt;  1 Afghanistan AF    AFG    1980 sp        m      014      NA\n#&gt;  2 Afghanistan AF    AFG    1980 sp        m      1524     NA\n#&gt;  3 Afghanistan AF    AFG    1980 sp        m      2534     NA\n#&gt;  4 Afghanistan AF    AFG    1980 sp        m      3544     NA\n#&gt;  5 Afghanistan AF    AFG    1980 sp        m      4554     NA\n#&gt;  6 Afghanistan AF    AFG    1980 sp        m      5564     NA\n#&gt;  7 Afghanistan AF    AFG    1980 sp        m      65       NA\n#&gt;  8 Afghanistan AF    AFG    1980 sp        f      014      NA\n#&gt;  9 Afghanistan AF    AFG    1980 sp        f      1524     NA\n#&gt; 10 Afghanistan AF    AFG    1980 sp        f      2534     NA\n#&gt; # \u2026 with 405,430 more rows<\/code><\/pre>\n<p><\/p>\n<p>Gjith\u00e7ka q\u00eb sapo b\u00ebm\u00eb mund t\u00eb ilustrohet n\u00eb k\u00ebt\u00eb m\u00ebnyr\u00eb:<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider\" src=\"\/wp-content\/uploads\/2020\/04\/77c8c266c205e1b087738d31de8b8523.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<h2 id=\"specifikaciya-s-ispolzovaniem-neskolkih-znacheniyvalue\">Specifikimi duke p\u00ebrdorur disa vlera (.value)<\/h2>\n<p><\/p>\n<p>N\u00eb shembullin e m\u00ebsip\u00ebrm, kolona e specifikimit <em>.value<\/em> p\u00ebrmbante vet\u00ebm nj\u00eb vler\u00eb, n\u00eb shumic\u00ebn e rasteve k\u00ebshtu ndodh. <\/p>\n<p><\/p>\n<p>Por ndodhin her\u00eb pas here situata kur \u00ebsht\u00eb e nevojshme t\u00eb mblidhen t\u00eb dh\u00ebna nga kolona me tipe t\u00eb ndryshme t\u00eb t\u00eb dh\u00ebnave. Me funksionin e vjetruar, <code>spread()<\/code> do t\u00eb ishte mjaft e v\u00ebshtir\u00eb ta b\u00ebnit k\u00ebt\u00eb.<\/p>\n<p><\/p>\n<p>Shembulli i m\u00ebposht\u00ebm \u00ebsht\u00eb marr\u00eb nga <noindex><a rel=\"nofollow\" href=\"https:\/\/cran.r-project.org\/web\/packages\/data.table\/vignettes\/datatable-reshape.html\">vignettes<\/a><\/noindex> n\u00eb paket\u00ebn <strong>data.table<\/strong>.<\/p>\n<p><\/p>\n<p>Le t\u00eb krijojm\u00eb nj\u00eb dataframe p\u00ebr trajnimin.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">family &lt;- tibble::tribble(\n  ~family,  ~dob_child1,  ~dob_child2, ~gender_child1, ~gender_child2,\n       1L, &quot;1998-11-26&quot;, &quot;2000-01-29&quot;,             1L,             2L,\n       2L, &quot;1996-06-22&quot;,           NA,             2L,             NA,\n       3L, &quot;2002-07-11&quot;, &quot;2004-04-05&quot;,             2L,             2L,\n       4L, &quot;2004-10-10&quot;, &quot;2009-08-27&quot;,             1L,             1L,\n       5L, &quot;2000-12-05&quot;, &quot;2005-02-28&quot;,             2L,             1L,\n)\nfamily % mutate_at(vars(starts_with(\"dob\")), parse_date)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 5 x 5\n#&gt;   family dob_child1 dob_child2 gender_child1 gender_child2\n#&gt;    &lt;int&gt; &lt;date&gt;     &lt;date&gt;             &lt;int&gt;         &lt;int&gt;\n#&gt; 1      1 1998-11-26 2000-01-29             1             2\n#&gt; 2      2 1996-06-22 NA                     2            NA\n#&gt; 3      3 2002-07-11 2004-04-05             2             2\n#&gt; 4      4 2004-10-10 2009-08-27             1             1\n#&gt; 5      5 2000-12-05 2005-02-28             2             1<\/code><\/pre>\n<p><\/p>\n<p>Dataframe i krijuar n\u00eb \u00e7do rresht p\u00ebrmban t\u00eb dh\u00ebnat p\u00ebr f\u00ebmij\u00ebt e nj\u00eb familjeje. N\u00eb familje mund t\u00eb ket\u00eb nj\u00eb ose dy f\u00ebmij\u00eb. P\u00ebr secilin f\u00ebmij\u00eb ofrohen t\u00eb dh\u00ebna p\u00ebr dat\u00ebn e lindjes dhe gjinin\u00eb, ku t\u00eb dh\u00ebnat p\u00ebr secilin f\u00ebmij\u00eb jan\u00eb n\u00eb kolona t\u00eb ndara; detyra jon\u00eb \u00ebsht\u00eb t'i sjellim k\u00ebto t\u00eb dh\u00ebna n\u00eb formatin e duhur p\u00ebr analiz\u00eb.<\/p>\n<p><\/p>\n<p>Vini re se kemi dy variabla me informacion p\u00ebr \u00e7do f\u00ebmij\u00eb: gjinia dhe data e lindjes (kolonat me prefiksin <em>dop<\/em> p\u00ebrmbajn\u00eb dat\u00ebn e lindjes, nd\u00ebrsa kolonat me prefiksin <em>gender<\/em> p\u00ebrmbajn\u00eb gjinin\u00eb e f\u00ebmij\u00ebs). N\u00eb rezultatin e pritur ato duhet t\u00eb jen\u00eb n\u00eb kolona t\u00eb ndara. Ne mund ta b\u00ebjm\u00eb k\u00ebt\u00eb duke gjeneruar nj\u00eb specifikim, ku kolona <code>.value<\/code> do t\u00eb ket\u00eb dy vlera t\u00eb ndryshme.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">spec %\n  pivot_longer_spec(-family) %&gt;%\n  separate(col = name, into = c(\".value\", \"child\")) %&gt;%\n  mutate(child = parse_number(child))\n<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 4 x 3\n#&gt;   .name         .value child\n#&gt;   &lt;chr&gt;         &lt;chr&gt;  &lt;dbl&gt;\n#&gt; 1 dob_child1    dob        1\n#&gt; 2 dob_child2    dob        2\n#&gt; 3 gender_child1 gender     1\n#&gt; 4 gender_child2 gender     2<\/code><\/pre>\n<p><\/p>\n<p>Tani le t\u00eb shqyrtojm\u00eb hap pas hapi veprimet q\u00eb kryhen nga kodi i m\u00ebsip\u00ebrm.<\/p>\n<p><\/p>\n<ul>\n<li><code>pivot_longer_spec(-family)<\/code> \u2014 krijon nj\u00eb specifikim q\u00eb ngushton t\u00eb gjitha kolonat e disponueshme, p\u00ebrve\u00e7 kolon\u00ebs family.<\/li>\n<li><code>separate(col = name, into = c(\".value\", \"child\"))<\/code> \u2014 ndan kolon\u00ebn <em>.em\u00ebr<\/em>, e cila p\u00ebrmban emrat e fushave origjinale, sipas n\u00ebnviz\u00ebs dhe regjistron vlerat e marra n\u00eb kolona. <em>.value<\/em> dhe <em>child<\/em>.<\/li>\n<li><code>mutate(child = parse_number(child))<\/code> \u2014 konverton vlerat e fush\u00ebs <em>child<\/em> nga tipin tekstual n\u00eb tipin numerik.<\/li>\n<\/ul>\n<p><\/p>\n<p>Tani ne mund t\u00eb aplikojm\u00eb specifikimin e marr\u00eb n\u00eb dataframe origjinal dhe ta sjellim tabel\u00ebn n\u00eb formatin e d\u00ebshiruar.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">family %&gt;% \n    pivot_longer(spec = spec, na.rm = T)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 9 x 4\n#&gt;   family child dob        gender\n#&gt;    &lt;int&gt; &lt;dbl&gt; &lt;date&gt;      &lt;int&gt;\n#&gt; 1      1     1 1998-11-26      1\n#&gt; 2      1     2 2000-01-29      2\n#&gt; 3      2     1 1996-06-22      2\n#&gt; 4      3     1 2002-07-11      2\n#&gt; 5      3     2 2004-04-05      2\n#&gt; 6      4     1 2004-10-10      1\n#&gt; 7      4     2 2009-08-27      1\n#&gt; 8      5     1 2000-12-05      2\n#&gt; 9      5     2 2005-02-28      1<\/code><\/pre>\n<p><\/p>\n<p>Ne p\u00ebrdorim argumentin <code>na.rm = TRUE<\/code>, sepse forma aktuale e t\u00eb dh\u00ebnave e detyron t\u00eb krijojm\u00eb rreshta t\u00eb panevojsh\u00ebm p\u00ebr v\u00ebzhgimet q\u00eb nuk ekzistojn\u00eb. Meqen\u00ebse familja 2 ka vet\u00ebm nj\u00eb f\u00ebmij\u00eb, <code>na.rm = TRUE<\/code> siguron q\u00eb familja 2 do t\u00eb ket\u00eb nj\u00eb rresht n\u00eb t\u00eb dh\u00ebnat e daljes.<\/p>\n<p><\/p>\n<h2 id=\"preobrazovanie-data-freymov-iz-dlinnogo-formata-k-shirokomu\">Transformimi i frame-ve t\u00eb t\u00eb dh\u00ebnave nga formati i gjat\u00eb n\u00eb t\u00eb gjer\u00eb<\/h2>\n<p><\/p>\n<p><code>pivot_wider()<\/code> \u2014 \u00ebsht\u00eb nj\u00eb transformim n\u00eb t\u00eb kund\u00ebrt, dhe p\u00ebrkundrazi rrit numrin e kolonave t\u00eb dataframe-it duke zvog\u00ebluar numrin e rreshtave.<\/p>\n<p><\/p>\n<p><img decoding=\"async\" alt=\"Paketa R tidyr dhe funksionet e saj t\u00eb reja pivot_longer dhe pivot_wider\" src=\"\/wp-content\/uploads\/2020\/04\/b470664e06f362d6f0ea6df9c1ed426d.jpg\" style=\"display:block;margin: 0 auto;\" \/><\/p>\n<p><\/p>\n<p>Ky lloj transformimi \u00ebsht\u00eb jasht\u00ebzakonisht i rrall\u00eb p\u00ebr t\u00eb sjell\u00eb t\u00eb dh\u00ebnat n\u00eb nj\u00eb pamje t\u00eb past\u00ebr, megjithat\u00eb ky teknik mund t\u00eb jet\u00eb i dobish\u00ebm p\u00ebr t\u00eb krijuar tabela p\u00ebrmbledh\u00ebse q\u00eb p\u00ebrdoren n\u00eb prezantime, ose p\u00ebr integrimin me mjete t\u00eb tjera.<\/p>\n<p><\/p>\n<p>N\u00eb t\u00eb v\u00ebrtet\u00eb, funksionet <code>pivot_longer()<\/code> dhe <code>pivot_wider()<\/code> jan\u00eb simetrike dhe ushtrojn\u00eb veprime t\u00eb kund\u00ebrta ndaj nj\u00ebri-tjetrit, pra: <code>df %&gt;% pivot_longer(spec = spec) %&gt;% pivot_wider(spec = spec)<\/code> dhe <code>df %&gt;% pivot_wider(spec = spec) %&gt;% pivot_longer(spec = spec)<\/code> do t\u00eb kthej\u00eb df-n\u00eb origjinale.<\/p>\n<p><\/p>\n<h3 id=\"prosteyshiy-primer-privedeniya-tablicy-k-shirokomu-formatu\">Shembulli m\u00eb i thjesht\u00eb i sjelljes s\u00eb nj\u00eb tabele n\u00eb format t\u00eb gjer\u00eb<\/h3>\n<p><\/p>\n<p>P\u00ebr t\u00eb demonstruar funksionimin e funksionit <code>pivot_wider()<\/code> ne do t\u00eb p\u00ebrdorim t\u00eb dh\u00ebnat <em>fish_encounters<\/em>, e cila ruan informacion mbi at\u00eb se si stacionet e ndryshme regjistrojn\u00eb l\u00ebvizjen e peshqve n\u00eb lum.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 114 x 3\n#&gt;    fish  station  seen\n#&gt;    &lt;fct&gt; &lt;fct&gt;   &lt;int&gt;\n#&gt;  1 4842  Release     1\n#&gt;  2 4842  I80_1       1\n#&gt;  3 4842  Lisbon      1\n#&gt;  4 4842  Rstr        1\n#&gt;  5 4842  Base_TD     1\n#&gt;  6 4842  BCE         1\n#&gt;  7 4842  BCW         1\n#&gt;  8 4842  BCE2        1\n#&gt;  9 4842  BCW2        1\n#&gt; 10 4842  MAE         1\n#&gt; # \u2026 with 104 more rows<\/code><\/pre>\n<p><\/p>\n<p>N\u00eb shumic\u00ebn e rasteve, kjo tabel\u00eb do t\u00eb jet\u00eb m\u00eb informative dhe e leht\u00eb p\u00ebr t'u p\u00ebrdorur n\u00ebse paraqesim informacionin p\u00ebr \u00e7do stacion n\u00eb nj\u00eb kolon\u00eb t\u00eb ve\u00e7ant\u00eb.<\/p>\n<p><\/p>\n<p><code>fish_encounters %&gt;% pivot_wider(names_from = station, values_from = seen)<\/code><\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">fish_encounters %&gt;% pivot_wider(names_from = station, values_from = seen)\n#&gt; # A tibble: 19 x 12\n#&gt;    fish  Release I80_1 Lisbon  Rstr Base_TD   BCE   BCW  BCE2  BCW2   MAE\n#&gt;        &amp;   &amp;    &amp; &amp; &amp; &amp; &amp;\n#&gt;  1 4842        1     1      1     1       1     1     1     1     1     1\n#&gt;  2 4843        1     1      1     1       1     1     1     1     1     1\n#&gt;  3 4844        1     1      1     1       1     1     1     1     1     1\n#&gt;  4 4845        1     1      1     1       1    NA    NA    NA    NA    NA\n#&gt;  5 4847        1     1      1    NA      NA    NA    NA    NA    NA    NA\n#&gt;  6 4848        1     1      1     1      NA    NA    NA    NA    NA    NA\n#&gt;  7 4849        1     1     NA    NA      NA    NA    NA    NA    NA    NA\n#&gt;  8 4850        1     1     NA     1       1     1     1    NA    NA    NA\n#&gt;  9 4851        1     1     NA    NA      NA    NA    NA    NA    NA    NA\n#&gt; 10 4854        1     1     NA    NA      NA    NA    NA    NA    NA    NA\n#&gt; # \u2026 me 9 rreshta m\u00eb shum\u00eb dhe 1 variab\u00ebl m\u00eb shum\u00eb: MAW<\/code><\/pre>\n<p><\/p>\n<p>Ky set t\u00eb dh\u00ebnash regjistron informacion vet\u00ebm kur peshku \u00ebsht\u00eb konstatuar nga stacioni, pra n\u00ebse ndonj\u00eb peshk nuk \u00ebsht\u00eb regjistruar nga ndonj\u00eb stacion, at\u00ebher\u00eb k\u00ebto t\u00eb dh\u00ebna nuk do t\u00eb jen\u00eb n\u00eb tabel\u00eb. Kjo do t\u00eb thot\u00eb se t\u00eb dh\u00ebnat e daljes do t\u00eb mbushen me NA. <\/p>\n<p><\/p>\n<p>Megjithat\u00eb, n\u00eb k\u00ebt\u00eb rast ne e dim\u00eb se mungesa e regjistrimit do t\u00eb thot\u00eb q\u00eb peshku nuk \u00ebsht\u00eb b\u00ebr\u00eb i duksh\u00ebm, k\u00ebshtu q\u00eb mund t\u00eb p\u00ebrdorim argumentin <em>values_fill<\/em> n\u00eb funksionin <code>pivot_wider()<\/code> dhe t\u00eb mbushim k\u00ebto vlera t\u00eb humbura me zero:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">fish_encounters %&gt;% pivot_wider(\n  names_from = station, \n  values_from = seen,\n  values_fill = list(seen = 0)\n)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 19 x 12\n#&gt;    fish  Release I80_1 Lisbon  Rstr Base_TD   BCE   BCW  BCE2  BCW2   MAE\n#&gt;    &lt;fct&gt;   &lt;int&gt; &lt;int&gt;  &lt;int&gt; &lt;int&gt;   &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt; &lt;int&gt;\n#&gt;  1 4842        1     1      1     1       1     1     1     1     1     1\n#&gt;  2 4843        1     1      1     1       1     1     1     1     1     1\n#&gt;  3 4844        1     1      1     1       1     1     1     1     1     1\n#&gt;  4 4845        1     1      1     1       1     0     0     0     0     0\n#&gt;  5 4847        1     1      1     0       0     0     0     0     0     0\n#&gt;  6 4848        1     1      1     1       0     0     0     0     0     0\n#&gt;  7 4849        1     1      0     0       0     0     0     0     0     0\n#&gt;  8 4850        1     1      0     1       1     1     1     0     0     0\n#&gt;  9 4851        1     1      0     0       0     0     0     0     0     0\n#&gt; 10 4854        1     1      0     0       0     0     0     0     0     0\n#&gt; # \u2026 with 9 more rows, and 1 more variable: MAW &lt;int&gt;<\/code><\/pre>\n<p><\/p>\n<h3 id=\"generaciya-imeni-stolbca-iz-neskolkih-ishodnyh-peremennyh\">Gjenerimi i emrit t\u00eb kolon\u00ebs nga disa variabla burimor\u00eb<\/h3>\n<p><\/p>\n<p>Imagjinoni q\u00eb kemi nj\u00eb tabel\u00eb q\u00eb p\u00ebrmban kombinime produkti, shteti dhe viti. P\u00ebr t\u00eb gjeneruar nj\u00eb data frame testues, mund t\u00eb ekzekutoni k\u00ebt\u00eb kod:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">df %\n  filter((product == \"A\" &amp; country == \"AI\") | product == \"B\") %&gt;% \n  mutate(value = rnorm(nrow(.)))<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 45 x 4\n#&gt;    product country  year    value\n#&gt;    &lt;chr&gt;   &lt;chr&gt;   &lt;int&gt;    &lt;dbl&gt;\n#&gt;  1 A       AI       2000 -2.05   \n#&gt;  2 A       AI       2001 -0.676  \n#&gt;  3 A       AI       2002  1.60   \n#&gt;  4 A       AI       2003 -0.353  \n#&gt;  5 A       AI       2004 -0.00530\n#&gt;  6 A       AI       2005  0.442  \n#&gt;  7 A       AI       2006 -0.610  \n#&gt;  8 A       AI       2007 -2.77   \n#&gt;  9 A       AI       2008  0.899  \n#&gt; 10 A       AI       2009 -0.106  \n#&gt; # \u2026 with 35 more rows<\/code><\/pre>\n<p><\/p>\n<p>Detyra jon\u00eb \u00ebsht\u00eb t\u00eb zgjeronim data frame-in nd\u00ebrsa nj\u00eb kolon\u00eb t\u00eb p\u00ebrmbante t\u00eb dh\u00ebnat p\u00ebr \u00e7do kombinim produkti dhe shteti. P\u00ebr k\u00ebt\u00eb, mjafton t\u00eb kaloni n\u00eb argumentin <em>names_from<\/em> nj\u00eb vektor q\u00eb p\u00ebrmban emrat e fushave q\u00eb do t\u00eb bashkohen.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">df %&gt;% pivot_wider(names_from = c(product, country),\n                 values_from = \"value\")<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 15 x 4\n#&gt;     year     A_AI    B_AI    B_EI\n#&gt;    &lt;int&gt;    &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;\n#&gt;  1  2000 -2.05     0.607   1.20  \n#&gt;  2  2001 -0.676    1.65   -0.114 \n#&gt;  3  2002  1.60    -0.0245  0.501 \n#&gt;  4  2003 -0.353    1.30   -0.459 \n#&gt;  5  2004 -0.00530  0.921  -0.0589\n#&gt;  6  2005  0.442   -1.55    0.594 \n#&gt;  7  2006 -0.610    0.380  -1.28  \n#&gt;  8  2007 -2.77     0.830   0.637 \n#&gt;  9  2008  0.899    0.0175 -1.30  \n#&gt; 10  2009 -0.106   -0.195   1.03  \n#&gt; # \u2026 with 5 more rows<\/code><\/pre>\n<p><\/p>\n<p>Gjashtas mund t\u00eb aplikoni specifikime n\u00eb funksionin <code>pivot_wider()<\/code>. Por n\u00eb parashqitjen e <code>pivot_wider()<\/code> specifikimi b\u00ebn nj\u00eb transformim t\u00eb kund\u00ebrt <code>pivot_longer()<\/code>: krijohen kolonat e p\u00ebrmendur n\u00eb <em>.em\u00ebr<\/em>, duke p\u00ebrdorur vlerat nga <em>.value<\/em> dhe kolonat e tjera.<\/p>\n<p><\/p>\n<p>P\u00ebr k\u00ebt\u00eb set t\u00eb dh\u00ebnash, mund t\u00eb gjeneroni nj\u00eb specifikim t\u00eb personalizuar n\u00ebse d\u00ebshironi q\u00eb \u00e7do kombinim t\u00eb mundsh\u00ebm t\u00eb shtetit dhe produktit t\u00eb ket\u00eb kolon\u00eb t\u00eb vet\u00ebn, jo vet\u00ebm ato q\u00eb jan\u00eb t\u00eb pranishme n\u00eb t\u00eb dh\u00ebna:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">spec % \n  expand(product, country, .value = \"value\") %&gt;% \n  unite(\".name\", product, country, remove = FALSE)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 4 x 4\n#&gt;   .name product country .value\n#&gt;   &lt;chr&gt; &lt;chr&gt;   &lt;chr&gt;   &lt;chr&gt; \n#&gt; 1 A_AI  A       AI      value \n#&gt; 2 A_EI  A       EI      value \n#&gt; 3 B_AI  B       AI      value \n#&gt; 4 B_EI  B       EI      value<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">df %&gt;% pivot_wider(spec = spec) %&gt;% head()<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 6 x 5\n#&gt;    year     A_AI  A_EI    B_AI    B_EI\n#&gt;   &lt;int&gt;    &lt;dbl&gt; &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;\n#&gt; 1  2000 -2.05       NA  0.607   1.20  \n#&gt; 2  2001 -0.676      NA  1.65   -0.114 \n#&gt; 3  2002  1.60       NA -0.0245  0.501 \n#&gt; 4  2003 -0.353      NA  1.30   -0.459 \n#&gt; 5  2004 -0.00530    NA  0.921  -0.0589\n#&gt; 6  2005  0.442      NA -1.55    0.594<\/code><\/pre>\n<p><\/p>\n<h2 id=\"neskolko-prodvinutyh-primerov-raboty-s-novoy-koncepciey-tidyr\">Disa shembuj m\u00eb t\u00eb avancuar t\u00eb pun\u00ebs me konceptin e ri tidyr<\/h2>\n<p><\/p>\n<h3 id=\"privedenie-dannyh-k-akkuratnomu-vidu-na-primere-nabora-dannyh-o-perepisi-dohoda-i-arendnoy-platy-v-ssha\">Shtyrja e t\u00eb dh\u00ebnave n\u00eb nj\u00eb form\u00eb t\u00eb organizuar me shembuj nga kompleti i t\u00eb dh\u00ebnave p\u00ebr popullsin\u00eb dhe qiradh\u00ebnien n\u00eb SHBA<\/h3>\n<p><\/p>\n<p>Seti i t\u00eb dh\u00ebnave <em>us_rent_income<\/em> p\u00ebrmban informacione mbi mesataren e t\u00eb ardhurave dhe qirave p\u00ebr \u00e7do shtet n\u00eb SHBA p\u00ebr vitin 2017 (seti i t\u00eb dh\u00ebnave \u00ebsht\u00eb n\u00eb paket\u00ebn <strong>tidycensus<\/strong>).<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">us_rent_income\n#&gt; # A tibble: 104 x 5\n#&gt;    GEOID NAME       variable estimate   moe\n#&gt;                   \n#&gt;  1 01    Alabama    income      24476   136\n#&gt;  2 01    Alabama    rent          747     3\n#&gt;  3 02    Alaska     income      32940   508\n#&gt;  4 02    Alaska     rent         1200    13\n#&gt;  5 04    Arizona    income      27517   148\n#&gt;  6 04    Arizona    rent          972     4\n#&gt;  7 05    Arkansas   income      23789   165\n#&gt;  8 05    Arkansas   rent          709     5\n#&gt;  9 06    California income      29454   109\n#&gt; 10 06    California rent         1358     3\n#&gt; # \u2026 me 94 rreshta t\u00eb tjer\u00eb<\/code><\/pre>\n<p><\/p>\n<p>N\u00eb form\u00ebn e saj, si\u00e7 ruhen t\u00eb dh\u00ebnat n\u00eb datasetin <em>us_rent_income<\/em> punimi me to \u00ebsht\u00eb ekstremisht i v\u00ebshtir\u00eb, prandaj do t\u00eb doja t\u00eb krijoja nj\u00eb set t\u00eb dh\u00ebnash me kolonat: <em>rent<\/em>, <em>rent_moe<\/em>, <em>come<\/em>, <em>income_moe<\/em>. Ekzistojn\u00eb shum\u00eb m\u00ebnyra p\u00ebr t\u00eb krijuar k\u00ebt\u00eb specifikim, por e r\u00ebnd\u00ebsishme \u00ebsht\u00eb q\u00eb duhet t\u00eb gjenerojm\u00eb \u00e7do kombinim t\u00eb vlerave t\u00eb variables dhe <em>estimate\/moe<\/em>, dhe m\u00eb pas t\u00eb krijojm\u00eb emrin e kolon\u00ebs.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">  spec % \n    expand(variable, .value = c(\"estimate\", \"moe\")) %&gt;% \n    mutate(\n      .name = paste0(variable, ifelse(.value == \"moe\", \"_moe\", \"\"))\n    )<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 4 x 3\n#&gt;   variable .value   .name     \n#&gt;   &lt;chr&gt;    &lt;chr&gt;    &lt;chr&gt;     \n#&gt; 1 income   estimate income    \n#&gt; 2 income   moe      income_moe\n#&gt; 3 rent     estimate rent      \n#&gt; 4 rent     moe      rent_moe<\/code><\/pre>\n<p><\/p>\n<p>Ofrimi i k\u00ebtij specifikimi <code>pivot_wider()<\/code> na jep rezultatin q\u00eb k\u00ebrkojm\u00eb:<\/p>\n<p><\/p>\n<p><code>us_rent_income %&gt;% pivot_wider(spec = spec)<\/code><\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 52 x 6\n#&gt;    GEOID NAME                 income income_moe  rent rent_moe\n#&gt;    &lt;chr&gt; &lt;chr&gt;                 &lt;dbl&gt;      &lt;dbl&gt; &lt;dbl&gt;    &lt;dbl&gt;\n#&gt;  1 01    Alabama               24476        136   747        3\n#&gt;  2 02    Alaska                32940        508  1200       13\n#&gt;  3 04    Arizona               27517        148   972        4\n#&gt;  4 05    Arkansas              23789        165   709        5\n#&gt;  5 06    California            29454        109  1358        3\n#&gt;  6 08    Colorado              32401        109  1125        5\n#&gt;  7 09    Connecticut           35326        195  1123        5\n#&gt;  8 10    Delaware              31560        247  1076       10\n#&gt;  9 11    District of Columbia  43198        681  1424       17\n#&gt; 10 12    Florida               25952         70  1077        3\n#&gt; # \u2026 with 42 more rows<\/code><\/pre>\n<p><\/p>\n<h3 id=\"vsemirnyy-bank\">Bank\u00ebn Bot\u00ebrore<\/h3>\n<p><\/p>\n<p>Ndonj\u00ebher\u00eb, t\u00eb sjell\u00ebsh setin e t\u00eb dh\u00ebnave n\u00eb form\u00ebn e duhur k\u00ebrkon disa hapa.<br \/>\nDataseti <em>world_bank_pop<\/em> p\u00ebrmban t\u00eb dh\u00ebna nga banka bot\u00ebrore mbi popullsin\u00eb e \u00e7do vendi n\u00eb periudh\u00ebn 2000 deri n\u00eb 2018.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 1,056 x 20\n#&gt;    country indicator `2000` `2001` `2002` `2003`  `2004`  `2005`   `2006`\n#&gt;    &lt;chr&gt;   &lt;chr&gt;      &lt;dbl&gt;  &lt;dbl&gt;  &lt;dbl&gt;  &lt;dbl&gt;   &lt;dbl&gt;   &lt;dbl&gt;    &lt;dbl&gt;\n#&gt;  1 ABW     SP.URB.T\u2026 4.24e4 4.30e4 4.37e4 4.42e4 4.47e+4 4.49e+4  4.49e+4\n#&gt;  2 ABW     SP.URB.G\u2026 1.18e0 1.41e0 1.43e0 1.31e0 9.51e-1 4.91e-1 -1.78e-2\n#&gt;  3 ABW     SP.POP.T\u2026 9.09e4 9.29e4 9.50e4 9.70e4 9.87e+4 1.00e+5  1.01e+5\n#&gt;  4 ABW     SP.POP.G\u2026 2.06e0 2.23e0 2.23e0 2.11e0 1.76e+0 1.30e+0  7.98e-1\n#&gt;  5 AFG     SP.URB.T\u2026 4.44e6 4.65e6 4.89e6 5.16e6 5.43e+6 5.69e+6  5.93e+6\n#&gt;  6 AFG     SP.URB.G\u2026 3.91e0 4.66e0 5.13e0 5.23e0 5.12e+0 4.77e+0  4.12e+0\n#&gt;  7 AFG     SP.POP.T\u2026 2.01e7 2.10e7 2.20e7 2.31e7 2.41e+7 2.51e+7  2.59e+7\n#&gt;  8 AFG     SP.POP.G\u2026 3.49e0 4.25e0 4.72e0 4.82e0 4.47e+0 3.87e+0  3.23e+0\n#&gt;  9 AGO     SP.URB.T\u2026 8.23e6 8.71e6 9.22e6 9.77e6 1.03e+7 1.09e+7  1.15e+7\n#&gt; 10 AGO     SP.URB.G\u2026 5.44e0 5.59e0 5.70e0 5.76e0 5.75e+0 5.69e+0  4.92e+0\n#&gt; # \u2026 with 1,046 more rows, and 11 more variables: `2007` &lt;dbl&gt;,\n#&gt; #   `2008` &lt;dbl&gt;, `2009` &lt;dbl&gt;, `2010` &lt;dbl&gt;, `2011` &lt;dbl&gt;, `2012` &lt;dbl&gt;,\n#&gt; #   `2013` &lt;dbl&gt;, `2014` &lt;dbl&gt;, `2015` &lt;dbl&gt;, `2016` &lt;dbl&gt;, `2017` &lt;dbl&gt;<\/code><\/pre>\n<p><\/p>\n<p>Q\u00ebllimi yn\u00eb \u00ebsht\u00eb t\u00eb krijojm\u00eb nj\u00eb set t\u00eb dh\u00ebnash t\u00eb rregullt ku \u00e7do variable ndodhet n\u00eb nj\u00eb kolon\u00eb t\u00eb ve\u00e7ant\u00eb. Deri tani, \u00ebsht\u00eb e paqart\u00eb se cilat hapa jan\u00eb t\u00eb nevojsh\u00ebm, por do t\u00eb fillojm\u00eb me problemin m\u00eb t\u00eb duksh\u00ebm: viti \u00ebsht\u00eb shp\u00ebrndar\u00eb n\u00eb disa kolona.<\/p>\n<p><\/p>\n<p>P\u00ebr ta korrigjuar at\u00eb, \u00ebsht\u00eb e nevojshme t\u00eb p\u00ebrdoret funksioni <code>pivot_longer()<\/code>.<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">pop2 % \n  pivot_longer(`2000`:`2017`, names_to = \"year\")<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 19,008 x 4\n#&gt;    country indicator   year  value\n#&gt;    &lt;chr&gt;   &lt;chr&gt;       &lt;chr&gt; &lt;dbl&gt;\n#&gt;  1 ABW     SP.URB.TOTL 2000  42444\n#&gt;  2 ABW     SP.URB.TOTL 2001  43048\n#&gt;  3 ABW     SP.URB.TOTL 2002  43670\n#&gt;  4 ABW     SP.URB.TOTL 2003  44246\n#&gt;  5 ABW     SP.URB.TOTL 2004  44669\n#&gt;  6 ABW     SP.URB.TOTL 2005  44889\n#&gt;  7 ABW     SP.URB.TOTL 2006  44881\n#&gt;  8 ABW     SP.URB.TOTL 2007  44686\n#&gt;  9 ABW     SP.URB.TOTL 2008  44375\n#&gt; 10 ABW     SP.URB.TOTL 2009  44052\n#&gt; # \u2026 with 18,998 more rows<\/code><\/pre>\n<p><\/p>\n<p>Hapi tjet\u00ebr \u00ebsht\u00eb t\u00eb shqyrtojm\u00eb variable-n indicator.<br \/>\n<code>pop2 %&gt;% count(indicator)<\/code><\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 4 x 2\n#&gt;   indicator       n\n#&gt;   &lt;chr&gt;       &lt;int&gt;\n#&gt; 1 SP.POP.GROW  4752\n#&gt; 2 SP.POP.TOTL  4752\n#&gt; 3 SP.URB.GROW  4752\n#&gt; 4 SP.URB.TOTL  4752<\/code><\/pre>\n<p><\/p>\n<p>Ku SP.POP.GROW \u00ebsht\u00eb rritja e popullsis\u00eb, SP.POP.TOTL \u00ebsht\u00eb numri total i popullsis\u00eb, dhe SP.URB. * \u00ebsht\u00eb e nj\u00ebjta gj\u00eb, por vet\u00ebm p\u00ebr zonat urbane. Le t\u00eb ndarim k\u00ebto vlera n\u00eb dy variable: area \u2014 vendi (total ose urban) dhe nj\u00eb variable q\u00eb p\u00ebrmban t\u00eb dh\u00ebnat efektive (population ose growth):<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">pop3 % \n  separate(indicator, c(NA, \"area\", \"variable\"))<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 19,008 x 5\n#&gt;    country area  variable year  value\n#&gt;    &lt;chr&gt;   &lt;chr&gt; &lt;chr&gt;    &lt;chr&gt; &lt;dbl&gt;\n#&gt;  1 ABW     URB   TOTL     2000  42444\n#&gt;  2 ABW     URB   TOTL     2001  43048\n#&gt;  3 ABW     URB   TOTL     2002  43670\n#&gt;  4 ABW     URB   TOTL     2003  44246\n#&gt;  5 ABW     URB   TOTL     2004  44669\n#&gt;  6 ABW     URB   TOTL     2005  44889\n#&gt;  7 ABW     URB   TOTL     2006  44881\n#&gt;  8 ABW     URB   TOTL     2007  44686\n#&gt;  9 ABW     URB   TOTL     2008  44375\n#&gt; 10 ABW     URB   TOTL     2009  44052\n#&gt; # \u2026 with 18,998 more rows<\/code><\/pre>\n<p><\/p>\n<p>Tani na mbetet vet\u00ebm t\u00eb ndajm\u00eb variable-n variable n\u00eb dy kolona:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">pop3 %&gt;% \n  pivot_wider(names_from = variable, values_from = value)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 9,504 x 5\n#&gt;    country area  year   TOTL    GROW\n#&gt;    &lt;chr&gt;   &lt;chr&gt; &lt;chr&gt; &lt;dbl&gt;   &lt;dbl&gt;\n#&gt;  1 ABW     URB   2000  42444  1.18  \n#&gt;  2 ABW     URB   2001  43048  1.41  \n#&gt;  3 ABW     URB   2002  43670  1.43  \n#&gt;  4 ABW     URB   2003  44246  1.31  \n#&gt;  5 ABW     URB   2004  44669  0.951 \n#&gt;  6 ABW     URB   2005  44889  0.491 \n#&gt;  7 ABW     URB   2006  44881 -0.0178\n#&gt;  8 ABW     URB   2007  44686 -0.435 \n#&gt;  9 ABW     URB   2008  44375 -0.698 \n#&gt; 10 ABW     URB   2009  44052 -0.731 \n#&gt; # \u2026 with 9,494 more rows<\/code><\/pre>\n<p><\/p>\n<h3 id=\"spisok-kontaktov\">Lista e kontakteve<\/h3>\n<p><\/p>\n<p>Shembulli i fundit, imagjinoni q\u00eb keni nj\u00eb list\u00eb kontaktesh q\u00eb e keni kopjuar dhe ngjitur nga nj\u00eb web faqe:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">contacts &lt;- tribble(\n  ~field, ~value,\n  &quot;name&quot;, &quot;Jiena McLellan&quot;,\n  &quot;company&quot;, &quot;Toyota&quot;, \n  &quot;name&quot;, &quot;John Smith&quot;, \n  &quot;company&quot;, &quot;google&quot;, \n  &quot;email&quot;, &quot;john@google.com&quot;,\n  &quot;name&quot;, &quot;Huxley Ratcliffe&quot;\n)<\/code><\/pre>\n<p><\/p>\n<p>Transformimi i k\u00ebtij list\u00eb n\u00eb nj\u00eb format tabelar \u00ebsht\u00eb mjaft i komplikuar, pasi nuk ka nj\u00eb variab\u00ebl q\u00eb identifikon cilat t\u00eb dh\u00ebna i p\u00ebrkasin cilit kontakt. Mund ta zgjidhim k\u00ebt\u00eb, duke v\u00ebn\u00eb re se t\u00eb dh\u00ebnat p\u00ebr \u00e7do kontakt t\u00eb ri fillojn\u00eb me emrin (\"name\"), k\u00ebshtu q\u00eb mund t\u00eb krijojm\u00eb nj\u00eb identifikues unik dhe ta rrisim at\u00eb me nj\u00eb \u00e7do her\u00eb q\u00eb n\u00eb kolon\u00ebn field hasim vler\u00ebn \"name\":<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">contacts % \n  mutate(\n    person_id = cumsum(field == \"name\")\n  )\ncontacts<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 6 x 3\n#&gt;   field   value            person_id\n#&gt;   &lt;chr&gt;   &lt;chr&gt;                &lt;int&gt;\n#&gt; 1 name    Jiena McLellan           1\n#&gt; 2 company Toyota                   1\n#&gt; 3 name    John Smith               2\n#&gt; 4 company google                   2\n#&gt; 5 email   john@google.com          2\n#&gt; 6 name    Huxley Ratcliffe         3<\/code><\/pre>\n<p><\/p>\n<p>Tani, kur kemi nj\u00eb identifikues unik p\u00ebr \u00e7do kontakt, mund t\u00eb kthejm\u00eb fush\u00ebn dhe vler\u00ebn n\u00eb kolona:<\/p>\n<p><\/p>\n<pre><code class=\"plaintext\">contacts %&gt;% \n  pivot_wider(names_from = field, values_from = value)<\/code><\/pre>\n<p><\/p>\n<pre><code class=\"plaintext\">#&gt; # A tibble: 3 x 4\n#&gt;   person_id name             company email          \n#&gt;       &lt;int&gt; &lt;chr&gt;            &lt;chr&gt;   &lt;chr&gt;          \n#&gt; 1         1 Jiena McLellan   Toyota  &lt;NA&gt;           \n#&gt; 2         2 John Smith       google  john@google.com\n#&gt; 3         3 Huxley Ratcliffe &lt;NA&gt;    &lt;NA&gt;<\/code><\/pre>\n<p><\/p>\n<h2 id=\"zaklyuchenie\">P\u00ebrfundimi<\/h2>\n<p><\/p>\n<p>Mendimi im personal \u00ebsht\u00eb se koncepti i ri <strong>tidyr<\/strong> \u00ebsht\u00eb v\u00ebrtet intuitivisht m\u00eb i qart\u00eb, dhe ndjesh\u00ebm superior n\u00eb funksionalitet ndaj funksioneve t\u00eb t\u00eb kaluara <code>spread()<\/code> dhe <code>gather()<\/code>. Shpresoj q\u00eb ky artikull ju ka ndihmuar t\u00eb kuptoni <code>pivot_longer()<\/code> dhe <code>pivot_wider()<\/code>.<\/p>\n<p>Burimi: <a content=\"nofollow\" rel=\"nofollow\" href=\"https:\/\/habr.com\/ru\/post\/444622\/\">habr.com<\/a> <\/p>","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"excerpt":{"rendered":"<p>\u041f\u0430\u043a\u0435\u0442 tidyr \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R \u2014 tidyverse. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0430\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u0443, \u043d\u043e \u0434\u0430\u0442\u0438\u0440\u0443\u044e\u0435\u0442\u0441\u044f \u043e\u043d\u0430 2015 \u0433\u043e\u0434\u043e\u043c. \u0410 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0425\u0435\u0434\u043b\u0438 \u0412\u0438\u043a\u0445\u0435\u043c. [&hellip;]<\/p>\n","protected":false,"gt_translate_keys":[{"key":"rendered","format":"html"}]},"author":1,"featured_media":76292,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[688],"tags":[],"class_list":["post-76291","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-administrirovanie"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"\u041f\u0430\u043a\u0435\u0442 tidyr \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R \u2014 tidyverse. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0430\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u0443, \u043d\u043e \u0434\u0430\u0442\u0438\u0440\u0443\u044e\u0435\u0442\u0441\u044f \u043e\u043d\u0430 2015 \u0433\u043e\u0434\u043e\u043c. \u0410 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0425\u0435\u0434\u043b\u0438 \u0412\u0438\u043a\u0445\u0435\u043c.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Yuri Gagarin\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"sq_AL\" \/>\n\t\t<meta property=\"og:site_name\" content=\"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"\ud83e\udd47R \u043f\u0430\u043a\u0435\u0442 tidyr \u0438 \u0435\u0433\u043e \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 pivot_longer \u0438 pivot_wider | ProHoster\" \/>\n\t\t<meta property=\"og:description\" content=\"\u041f\u0430\u043a\u0435\u0442 tidyr \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R \u2014 tidyverse. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0430\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u0443, \u043d\u043e \u0434\u0430\u0442\u0438\u0440\u0443\u044e\u0435\u0442\u0441\u044f \u043e\u043d\u0430 2015 \u0433\u043e\u0434\u043e\u043c. \u0410 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0425\u0435\u0434\u043b\u0438 \u0412\u0438\u043a\u0445\u0435\u043c.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg\" \/>\n\t\t<meta property=\"og:image:width\" content=\"350\" \/>\n\t\t<meta property=\"og:image:height\" content=\"350\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2020-04-01T11:42:28+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-04-01T11:42:28+00:00\" \/>\n\t\t<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/prohoster\" \/>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"\ud83e\udd47Pako R tidyr dhe funksionet e tij t\u00eb reja pivot_longer dhe pivot_wider | ProHoster","description":"Pako tidyr p\u00ebrfshihet n\u00eb thelbin e nj\u00eb prej bibliotekave m\u00eb t\u00eb njohura n\u00eb gjuh\u00ebn R \u2014 tidyverse. Q\u00ebllimi kryesor i paket\u00ebs \u00ebsht\u00eb t\u00eb sjell\u00eb t\u00eb dh\u00ebnat n\u00eb nj\u00eb format t\u00eb rregullt. N\u00eb Habr ka nj\u00eb publikim q\u00eb i kushtohet k\u00ebsaj pakete, por daton nga viti 2015. Un\u00eb dua t\u00eb flas p\u00ebr ndryshimet m\u00eb t\u00eb r\u00ebnd\u00ebsishme, p\u00ebr t\u00eb cilat autori i saj, Hadley Wickham, njoftoi disa dit\u00eb m\u00eb par\u00eb.","canonical_url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":null,"og:locale":"sq_AL","og:site_name":"ProHoster | \u041a\u0443\u043f\u0438\u0442\u044c \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u0439 \u0445\u043e\u0441\u0442\u0438\u043d\u0433 \u0434\u043b\u044f \u0441\u0430\u0439\u0442\u043e\u0432 \u0441 \u0437\u0430\u0449\u0438\u0442\u043e\u0439 \u043e\u0442 DDoS, VPS VDS \u0441\u0435\u0440\u0432\u0435\u0440\u044b","og:type":"article","og:title":"\ud83e\udd47R \u043f\u0430\u043a\u0435\u0442 tidyr \u0438 \u0435\u0433\u043e \u043d\u043e\u0432\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 pivot_longer \u0438 pivot_wider | ProHoster","og:description":"\u041f\u0430\u043a\u0435\u0442 tidyr \u0432\u0445\u043e\u0434\u0438\u0442 \u0432 \u044f\u0434\u0440\u043e \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 R \u2014 tidyverse. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u0430\u043a\u0435\u0442\u0430 \u2014 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u043c\u0443 \u0432\u0438\u0434\u0443. \u041d\u0430 \u0425\u0430\u0431\u0440\u0435 \u0443\u0436\u0435 \u0435\u0441\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0451\u043d\u043d\u0430\u044f \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0430\u043a\u0435\u0442\u0443, \u043d\u043e \u0434\u0430\u0442\u0438\u0440\u0443\u044e\u0435\u0442\u0441\u044f \u043e\u043d\u0430 2015 \u0433\u043e\u0434\u043e\u043c. \u0410 \u044f \u0445\u043e\u0447\u0443 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u0445, \u043e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u043d\u0435\u0439 \u043d\u0430\u0437\u0430\u0434 \u0441\u043e\u043e\u0431\u0449\u0438\u043b \u0435\u0433\u043e \u0430\u0432\u0442\u043e\u0440 \u0425\u0435\u0434\u043b\u0438 \u0412\u0438\u043a\u0445\u0435\u043c.","og:url":"https:\/\/prohoster.info\/sq\/blog\/administrirovanie\/r-paket-tidyr-i-ego-novye-funkczii-pivot_longer-i-pivot_wider","og:image":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:secure_url":"https:\/\/prohoster.info\/wp-content\/uploads\/2021\/11\/logo-350.jpg","og:image:width":350,"og:image:height":350,"article:published_time":"2020-04-01T11:42:28+00:00","article:modified_time":"2020-04-01T11:42:28+00:00","article:publisher":"https:\/\/www.facebook.com\/prohoster","article:author":"https:\/\/www.facebook.com\/prohoster"},"aioseo_meta_data":{"post_id":"76291","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":null,"breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"ai":null,"created":"2021-02-28 17:39:23","updated":"2022-09-28 03:21:22"},"gt_translate_keys":[{"key":"link","format":"url"}],"_links":{"self":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/76291","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/comments?post=76291"}],"version-history":[{"count":0,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/posts\/76291\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media\/76292"}],"wp:attachment":[{"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/media?parent=76291"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/categories?post=76291"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/prohoster.info\/sq\/wp-json\/wp\/v2\/tags?post=76291"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}