{"id":1829,"date":"2014-07-01T14:36:08","date_gmt":"2014-07-01T20:36:08","guid":{"rendered":"http:\/\/cienciauanl.uanl.mx\/?p=1829"},"modified":"2015-02-08T20:43:08","modified_gmt":"2015-02-09T02:43:08","slug":"tema-36-r-commander-r-markdown-ii","status":"publish","type":"post","link":"https:\/\/cienciauanl.uanl.mx\/?p=1829","title":{"rendered":"Tema 36: R Commander R Markdown II"},"content":{"rendered":"<p style=\"text-align: left;\"><a href=\"http:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1832\" src=\"http:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2.png\" alt=\"rcommander2\" width=\"600\" height=\"350\" srcset=\"https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2.png 600w, https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2-300x175.png 300w, https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2-216x125.png 216w, https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2-146x85.png 146w, https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommander2-205x120.png 205w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p style=\"text-align: right;\">PETER B. MANDEVILLE*<\/p>\n<p style=\"text-align: right;\"><a href=\"http:\/\/eprints.uanl.mx\/3591\/1\/Ciencia_UANL_17-67.pdf\" target=\"_blank\">CIENCIA UANL \/ A\u00d1O 17, No. 67, MAYO-JUNIO 2014<\/a><\/p>\n<p style=\"text-align: right;\"><a href=\"http:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommanderrmarkdown111767.pdf\" target=\"_blank\">Art\u00edculo en PDF<\/a><\/p>\n<p style=\"text-align: right;\">Far out in the uncharted backwaters of the unfashionable\u00a0end of the western spiral arm of the Galaxy lies\u00a0a small unregarded yellow sun.\u00a0Orbiting this at a distance of roughly ninety-two million miles\u00a0is an utterly insignificant little blue green planet\u00a0whose ape-descended life forms are so amazingly primitive\u00a0that they still think digital watches are a pretty neat idea.<\/p>\n<p style=\"text-align: right;\">D. Adams (1)<\/p>\n<p>En el tema 35 (2) se present\u00f3 c\u00f3mo escribir code chunks\u00a0en R Commander -&gt; R Markdown. Entre los code\u00a0chunks se puede incluir texto que es b\u00e1sicamente Hyper\u00a0Text Markup Language (HTML). Para incluir caracteres\u00a0que no son American Standard Code for Information\u00a0Interchange (ASCII), se utilizan los c\u00f3digos de\u00a0ASCII extendido, en la tabla siguiente se muestran\u00a0algunos de los m\u00e1s importantes:<\/p>\n<p><a href=\"http:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommandermarkdown1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-1892\" src=\"http:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommandermarkdown1.jpg\" alt=\"rcommandermarkdown1\" width=\"854\" height=\"99\" srcset=\"https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommandermarkdown1.jpg 854w, https:\/\/cienciauanl.uanl.mx\/wp-content\/uploads\/2014\/07\/rcommandermarkdown1-300x34.jpg 300w\" sizes=\"auto, (max-width: 854px) 100vw, 854px\" \/><\/a><\/p>\n<p>N\u00f3tese que solamente los caracteres ASCII que\u00a0utiliza Notepad funcionan en los comandos de R3, y\u00a0que los caracteres ASCII extendidos que utiliza Word\u00a0no funcionan.<\/p>\n<p>R Commander4 versi\u00f3n 2.0-4 introduce los\u00a0comandos siguientes en los men\u00fas:<\/p>\n<p>File -&gt; Open R Markdown file\u2026<\/p>\n<p>Edit -&gt; Edit R Markdown document<\/p>\n<p>Se copia y pega el c\u00f3digo R Markdown Cheat\u00a0Sheet, que sigue en el archivo This PC -&gt; Documents\u00a0-&gt; CheatSheet.txt.<\/p>\n<p>Entonces se introduce el archivo de c\u00f3digo en\u00a0Rcmdr con File -&gt; Open R Markdown file o con Edit-&gt; Edit R Markdown document.<\/p>\n<p>Se puede almacenar el archivo de c\u00f3digo como un\u00a0archivo R Markdown (.Rmd), con File -&gt; Save R\u00a0Markdown file\u2026 o con File -&gt; Save R Markdown file\u00a0as&#8230;<\/p>\n<p>Entonces, se puede generar el documento HTML\u00a0con R Markdown -&gt; Generate HTML report. Tambi\u00e9n\u00a0se puede generar el documento HTML en R con:<\/p>\n<p>library(knitr)<br \/>\nknit2html(\u00abCheatSheet.Rmd\u00bb)<\/p>\n<p>o con:<\/p>\n<p>library(knitr)<br \/>\nknit2html(\u00abCheatSheet.txt\u00bb)<\/p>\n<p>Si se hacen cambios en el archivo en Rcmdr, sin\u00a0guardar los cambios con File -&gt; Save R Markdown\u00a0file\u2026 o con File -&gt; Save R Markdown file as\u2026, \u00e9stos\u00a0se perder\u00e1n al salir de Rcmdr.<\/p>\n<p>Despu\u00e9s se pueden comparar los resultados de la\u00a0generaci\u00f3n HTML con los comandos de formateo en\u00a0el art\u00edculo.<\/p>\n<p>R Markdown Cheat Sheet<br \/>\n=======================<br \/>\n### pbm<br \/>\n### \u2018r as.character(Sys.Date())\u2018<br \/>\n\u201c\u2018{r echo=FALSE}<br \/>\nopts_chunk$set(comment=NA, prompt=TRUE,<br \/>\nout.width=750, fig.height=8, fig.width=8)<br \/>\nlibrary(Rcmdr)<br \/>\n\u201c\u2018<br \/>\n\u201c\u2018{r}<br \/>\nsetwd(\u00abE:\/CIENCIA UANL\/Tips 36\u00bb)<br \/>\n\u201c\u2018<br \/>\n\u201c\u2018{r}<br \/>\nsessionInfo()<br \/>\n\u201c\u2018<br \/>\n### Secciones<\/p>\n<p>#### Titulo<\/p>\n<p># Titulo<\/p>\n<p>Titulo<br \/>\n=====<\/p>\n<p>### Secci&amp;#243;n<\/p>\n<p>Secci&amp;#243;n<br \/>\n\u2014\u2014\u2014<\/p>\n<p>### Subsecci&amp;#243;n<\/p>\n<p>#### SubSubsecci&amp;#243;n<\/p>\n<p>###### SubSubSubSubsecci&amp;#243;n<\/p>\n<p>### P&amp;#226;rrafos<\/p>\n<p>#### Se separa p&amp;#225;rrafos con una<br \/>\nl&amp;#237;nea (rengl&amp;#243;n) vac&amp;#237;a<\/p>\n<p>This planet has &amp;#45; or rather had &amp;#45; a\u00a0problem, which was this: most of the people living\u00a0on it were unhappy for pretty much of the time.\u00a0Many solutions were suggested for this problem,\u00a0but most of these were largely concerned with the\u00a0movements of small green pieces of paper, which is\u00a0odd because on the whole it wasn\u2019t the small green\u00a0pieces of paper that were unhappy. [1]<\/p>\n<p>And so the problem remained; lots of the people\u00a0were mean, and most of them were miserable, even\u00a0the ones with digital watches. [1]<\/p>\n<p>#### Se puede escribir un p&amp;#225;rrafo en una\u00a0l&amp;#237;nea larga<\/p>\n<p>Many were increasingly of the opinion that\u00a0they\u2019d all made a big mistake in coming down from\u00a0the trees in the first place. And some said that even\u00a0the trees had been a bad move, and that no one\u00a0should ever have left the oceans. [1]<\/p>\n<p>#### o en l&amp;#237;neas separadas<\/p>\n<p>And then,\u00a0one Thursday,\u00a0nearly two thousand years after one man had\u00a0been nailed to a tree\u00a0for saying how great it would be to be nice to\u00a0people for a change,\u2026[1]<\/p>\n<p>### &amp;#201;nfasis<\/p>\n<p>*Cursiva* y **negrito** son f&amp;#225;ciles,<\/p>\n<p>_Cursiva_ y __negrito__ son f&amp;#225;ciles.<\/p>\n<p>### Ligas<\/p>\n<p>Se pueden crear ligas<\/p>\n<p>[c&amp;#243;digos html ascii extendido]( http:\/\/techmantium.com\/html-entity-codes-ascii-unicodesymbols\/)<\/p>\n<p>### Listas<\/p>\n<p>#### Lista con vi&amp;#241;etas de c\u00edrculos\u00a0cerrados<\/p>\n<p>* Bullet 1<br \/>\n* Bullet 2<br \/>\n* Bullet 2a<br \/>\n* Bullet 2b<br \/>\n* Bullet 3<\/p>\n<p>#### Lista anidada con vi&amp;#241;etas de\u00a0c\u00edrculos cerrados y vi\/#241;etas abiertos<\/p>\n<p>* Bullet 1<br \/>\n* Bullet 2<br \/>\n* Bullet 2a<br \/>\n* Bullet 2b<br \/>\n* Bullet 3<\/p>\n<p>#### Lista enumerada<\/p>\n<p>1. Media<br \/>\n2. Mediana<br \/>\n3. Moda<\/p>\n<p>### Tablas<\/p>\n<p>\u201c\u2018{r results=\u00bbasis\u00bb}<br \/>\nkable(head(iris[,1:3]),align=c(\u00abl\u00bb,\u00bbr\u00bb,\u00bbc\u00bb))<br \/>\n\u201c\u2018<br \/>\nPara hacer el comando invisible, modifica el<br \/>\n*chunk* as&amp;#237;:<\/p>\n<p>\u201c\u2018{r results=\u00bbasis\u00bb, echo=FALSE}<br \/>\nkable(head(iris[,1:3]),align=c(\u00abl\u00bb,\u00bbr\u00bb,\u00bbc\u00bb))<br \/>\n\u201c\u2018<\/p>\n<p><strong>Referencias<\/strong><\/p>\n<p>1. Adams D. The Hitchhiker\u2019s Guide to the Galaxy. London:\u00a0Pan Books; 1979.<\/p>\n<p>2. Mandeville PB, Tema 35: Investigaci\u00f3n reproducible\u00a0con R Commander. CiENCiAUANL. Ene.-Feb.\u00a02014;17(65):77-80.<\/p>\n<p>3. R Core Team. R: A language and environment for\u00a0statistical computing. R Foundation for Statistical\u00a0Computing, Vienna; 2014. URL http:\/\/www.Rproject.\u00a0org\/<\/p>\n<p>4. Fox J. The R Commander: A Basic Statistics Graphical\u00a0User Interface to R. Journal of Statistical Software.\u00a02005;14(9):1-42.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>PETER B. MANDEVILLE* CIENCIA UANL \/ A\u00d1O 17, No. 67, MAYO-JUNIO 2014 Art\u00edculo en PDF Far out in the uncharted backwaters of the unfashionable\u00a0end of the western spiral arm of the Galaxy lies\u00a0a small unregarded yellow sun.\u00a0Orbiting this at a distance of roughly ninety-two million miles\u00a0is an utterly insignificant little blue green planet\u00a0whose ape-descended life forms are so amazingly primitive\u00a0that [&#8230;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[19],"tags":[],"class_list":["post-1829","post","type-post","status-publish","format-standard","hentry","category-tips-bioestadisticos"],"_links":{"self":[{"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/posts\/1829","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1829"}],"version-history":[{"count":6,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions"}],"predecessor-version":[{"id":3460,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=\/wp\/v2\/posts\/1829\/revisions\/3460"}],"wp:attachment":[{"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1829"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1829"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cienciauanl.uanl.mx\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1829"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}