[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"doc-seo-685847-105":3,"detail-sidebar-cat-0-en-105":80,"doc-detail-685847-en":130,"doc-similar-685847":154},{"code":4,"msg":5,"data":6},0,"ok",{"site_id":7,"language":8,"slug":9,"title":10,"keywords":11,"description":12,"schema_data":13,"social_meta":73,"head_meta":75,"extra_data":77,"updated_unix":79},105,"en","r-markdown-an-introduction","R Markdown - An Introduction","","R Markdown is introduced as a practical file format for creating dynamic documents with R by combining easy-to-write markdown text and embedded code chunks. The guide contrasts R’s basics with related programming knowledge, notes common R conventions, and explains how rendering via the Knit button produces both narrative content and computed outputs. Examples show summaries of datasets, inline and block mathematical expressions, chunk-defined variables, plot embedding, and key markdown syntax for structure, formatting, references, and tables.",{"@graph":14,"@context":72},[15,34,55],{"@type":16,"itemListElement":17},"BreadcrumbList",[18,23,27,31],{"item":19,"name":20,"@type":21,"position":22},"https://docshare.wps.com","Home","ListItem",1,{"item":24,"name":25,"@type":21,"position":26},"https://docshare.wps.com/document/","Document",2,{"item":28,"name":29,"@type":21,"position":30},"https://docshare.wps.com/document/technology/","Technology",3,{"item":32,"name":10,"@type":21,"position":33},"https://docshare.wps.com/document/r-markdown-an-introduction/685847/",4,{"url":32,"name":10,"@type":35,"image":36,"author":41,"headline":10,"publisher":44,"fileFormat":47,"inLanguage":8,"description":12,"dateModified":48,"datePublished":49,"encodingFormat":47,"isAccessibleForFree":50,"interactionStatistic":51},"DigitalDocument",{"url":37,"@type":38,"width":39,"height":40},"https://docshare.wps.com/thumbnails/r-markdown-an-introduction/685847.png","ImageObject",300,407,{"name":42,"@type":43},"Rainbow Cat","Person",{"url":19,"name":45,"@type":46},"DocShare","Organization","application/pdf","2026-11-11","2026-11-07",true,{"@type":52,"interactionType":53,"userInteractionCount":30},"InteractionCounter",{"@type":54},"ViewAction",{"@type":56,"mainEntity":57},"FAQPage",[58,64,68],{"name":59,"@type":60,"acceptedAnswer":61},"What is R Markdown used for?","Question",{"text":62,"@type":63},"R Markdown is used to create dynamic documents with R by writing markdown text and embedding R code chunks that produce outputs.","Answer",{"name":65,"@type":60,"acceptedAnswer":66},"How does the Knit button work in R Markdown?",{"text":67,"@type":63},"When you click Knit, a document is generated that includes both the written content and the results of embedded R code chunks.",{"name":69,"@type":60,"acceptedAnswer":70},"Can R Markdown include plots and control code output?",{"text":71,"@type":63},"Yes. You can embed plots generated from R code, and you can use chunk options such as echo=FALSE to suppress printing the R code while keeping the figure output.","https://schema.org",{"og:url":32,"og:type":74,"og:title":10,"og:site_name":45,"og:description":12},"article",{"robots":76,"canonical":32},"index,follow",{"doc_id":78,"site_id":7},685847,1794019543,{"code":4,"msg":81,"data":82},"success",[83,87,91,95,100,104,109,114,119,122,126],{"id":22,"doc_module":4,"doc_module_name":25,"category_name":84,"show_sort_weight":85,"slug":86},"Story & Novel",90,"story-novel",{"id":26,"doc_module":4,"doc_module_name":25,"category_name":88,"show_sort_weight":89,"slug":90},"Literature",80,"literature",{"id":33,"doc_module":4,"doc_module_name":25,"category_name":92,"show_sort_weight":93,"slug":94},"Exam",70,"exam",{"id":96,"doc_module":4,"doc_module_name":25,"category_name":97,"show_sort_weight":98,"slug":99},5,"Comic",60,"comic",{"id":101,"doc_module":4,"doc_module_name":25,"category_name":29,"show_sort_weight":102,"slug":103},6,50,"technology",{"id":105,"doc_module":4,"doc_module_name":25,"category_name":106,"show_sort_weight":107,"slug":108},7,"Healthcare",40,"healthcare",{"id":110,"doc_module":4,"doc_module_name":25,"category_name":111,"show_sort_weight":112,"slug":113},8,"Research & Report",30,"research-report",{"id":115,"doc_module":4,"doc_module_name":25,"category_name":116,"show_sort_weight":117,"slug":118},9,"Religion & Spirituality",20,"religion-spirituality",{"id":117,"doc_module":4,"doc_module_name":25,"category_name":120,"show_sort_weight":117,"slug":121},"World Cup","world-cup",{"id":123,"doc_module":4,"doc_module_name":25,"category_name":124,"show_sort_weight":123,"slug":125},10,"Lifestyle","lifestyle",{"id":127,"doc_module":4,"doc_module_name":25,"category_name":128,"show_sort_weight":96,"slug":129},19,"General","general",{"code":4,"msg":81,"data":131},{"doc_id":78,"user_id":132,"nickname":42,"user_avatar":133,"doc_module":4,"category_id":101,"category_name":29,"doc_title":10,"doc_description":12,"doc_content":134,"file_id":135,"file_url":136,"file_type":137,"file_size":138,"view_count":30,"is_deleted":4,"is_public":22,"is_downloadable":22,"audit_status":22,"page_count":139,"language":140,"language_code":8,"site_id":7,"html_lang":8,"table_of_contents":141,"faqs":142,"seo_title":143,"seo_description":12,"update_tm":79,"read_time":144,"preview_page_count":26,"preview_urls":145},962090769181,"https://ap-avatar.wpscdn.com/davatar_6f874abed73319feea01a86fa6f0fab8","A short introduction to R markdown  \nLars H. B. Olsen  \n2023-01-30  \nR  \nAs STK1100 (maybe you use python there) is recommended previous knowledge and many of you have taken STK1110, we assume that you have basic knowledge in coding. The R language is reasonable similar to Python, but with some diﬀerences, e.g., arrays, list, start counting at 1, and so on. R is often used in statistical analysis.  \nFor an introduction to R, I would recommend [https://education.rstudio.com/learn/beginner/](https://education.rstudio.com/learn/beginner/ and/or)[ and/or](https://education.rstudio.com/learn/beginner/ and/or)[ ](https://education.rstudio.com/learn/beginner/ and/or)[https://moderndive.netlify.app/1-getting-started.html](https://moderndive.netlify.app/1-getting-started.html. One)[. One](https://moderndive.netlify.app/1-getting-started.html. One) can always Google when you have questions, and the ISLR book has very nice lab chapters where they include code and describe it in details. The corresponding code is also available at [https://www.statlearning.com/resources-second-edition](https://www.statlearning.com/resources-second-edition).  \nR Markdown  \nR markdown is a ﬁle format for making dynamic documents with R. An R Markdown document is written in markdown (an easy-to-write plain text format) and contains chunks of embedded code. Very similar to jupyter notebooks.  \nMany excellent guides and resources to get to know R markdown:  \n• [https://rmarkdown.rstudio.com](https://rmarkdown.rstudio.com)  \n• [https://rmarkdown.rstudio.com/lesson-1.html](https://rmarkdown.rstudio.com/lesson-1.html) (All lessons are excellent)  \n• [https://rmarkdown.rstudio.com/authoring_basics.html](https://rmarkdown.rstudio.com/authoring_basics.html)  \n• [https://rmarkdown.rstudio.com/gallery.html](https://rmarkdown.rstudio.com/gallery.html) (Gallery examples)  \n• [https://bookdown.org/yihui/rmarkdown/](https://bookdown.org/yihui/rmarkdown/)  \n• [https://bookdown.org/yihui/rmarkdown-cookbook/](https://bookdown.org/yihui/rmarkdown-cookbook/)  \n• [https://bookdown.org/yihui/rmarkdown-cookbook/install-latex.html](https://bookdown.org/yihui/rmarkdown-cookbook/install-latex.html) (tinytex::install_tinytex())  \n• [https://bookdown.org/yihui/bookdown/](https://bookdown.org/yihui/bookdown/)  \n• [https://bookdown.org/dalzelnm/bookdown-demo/](https://bookdown.org/dalzelnm/bookdown-demo/)  \n• [https://rmd4sci.njtierney.com](https://rmd4sci.njtierney.com)  \n• [https://www.statlearning.com/resources-second-edition](https://www.statlearning.com/resources-second-edition) has Rmarkdown ﬁles for each chapter in the ISLR book you can look at.  \nThis is an R Markdown document. Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents. For more details on using R Markdown see [http://rmarkdown.rstudio.com](http://rmarkdown.rstudio.com).  \nWhen you click the Knit button a document will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:  \nsummary (cars)  \n\\#\\# speed  \n\\#\\# Min . : 4 .0  \n\\#\\# 1st Qu . :12 .0  \n\\#\\# Median :15 .0  \n\\#\\# Mean :15 .4  \ndist Min . : 2 .00  \n1st Qu . : 26 .00  \nMedian : 36 .00  \nMean : 42 .98  \n\\#\\# 3rd Qu . :19 .0  \n\\#\\# Max . :25 .0  \n3rd Qu . : 56 .00  \nMax . :120 .00  \nYou can include latex code just as usual. Both inline (P1n1 xi = . . . ) and on separate lines  \na = b  \nX ∼ N (0, 1)  \nYou can even run deﬁne variable in chunks  \nx \u003C -5 \\# radius of a circle  \nand then use it in the text. E.g., for a circle with the radius 5, its area is 78.54, and there are 50 cars in the data.  \nIncluding Plots  \nYou can also embed plots, for example:  \npressure  \n0 200 400 600 800  \n\n| |  |  |  |  |  |  |  |  |  |  |  |  |\n| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |\n| | | | | | | | | | | | |  |\n\n0 50 100 150 200 250 300 350  \ntemperature  \nFigure 1: This is a ﬁgure caption! You cannot see me before","cbCais8rUZjHsmkK","https://ap.wps.com/l/cbCais8rUZjHsmkK","pdf",614856,14,"English","# R Markdown\n## What is R Markdown\n## Writing and knitting documents\n## Embedding code, equations, and variables\n## Including plots and figure captions\n## Core Markdown syntax and formatting\n## Section references and footnotes","[{\"question\":\"What is R Markdown used for?\",\"answer\":\"R Markdown is used to create dynamic documents with R by writing markdown text and embedding R code chunks that produce outputs.\"},{\"question\":\"How does the Knit button work in R Markdown?\",\"answer\":\"When you click Knit, a document is generated that includes both the written content and the results of embedded R code chunks.\"},{\"question\":\"Can R Markdown include plots and control code output?\",\"answer\":\"Yes. You can embed plots generated from R code, and you can use chunk options such as echo=FALSE to suppress printing the R code while keeping the figure output.\"}]","R Markdown - An Introduction | PDF",35,[146,150],{"page_no":22,"url":147,"width":148,"height":149},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/d4f595c1ed24798153849cf86cd51ae9.webp",983,1272,{"page_no":26,"url":151,"width":152,"height":153},"https://res-academy.cache.wpscdn.com/upload/kdocshare/2026-11-09/13f2dfabf95fd2346503686b8285cb27.webp",982,1270,{"list":155,"token":11},[156,162,169,175,181,187,193,199,205,211],{"doc_id":157,"doc_title":158,"file_type":137,"home_preview_img_url":159,"slug":160,"view_count":30,"category_name":29,"create_tm":161},703189,"R Markdown Tutorial - Basic Knowledge - Codes and Tables","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230012260744/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=gno%2FGRIFqgTwUw92003lqoqR2Xg%3D","r-markdown-tutorial-basic-knowledge-codes-and-tables",1794562577,{"doc_id":163,"doc_title":164,"file_type":137,"home_preview_img_url":165,"slug":166,"view_count":167,"category_name":29,"create_tm":168},348237,"rmarkdown Cheatsheet 2.0","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911603589/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=QlaNlXUbkL9xUj3vD7gwTKniOdc%3D","rmarkdown-cheatsheet-20",15,1790071904,{"doc_id":170,"doc_title":171,"file_type":137,"home_preview_img_url":172,"slug":173,"view_count":30,"category_name":29,"create_tm":174},701084,"R Markdown: The Definitive Guide","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011578502/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=Y%2FOcwHklIdhUktn8mQSEtpVzAAU%3D","r-markdown-the-definitive-guide",1794523292,{"doc_id":176,"doc_title":177,"file_type":137,"home_preview_img_url":178,"slug":179,"view_count":33,"category_name":29,"create_tm":180},685845,"Markdown Cheatsheet","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000227815/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=V9ywGTRJ8Udi43CAi2UK4qHip2I%3D","markdown-cheatsheet-685845",1794019540,{"doc_id":182,"doc_title":183,"file_type":137,"home_preview_img_url":184,"slug":185,"view_count":33,"category_name":29,"create_tm":186},697999,"gluedown - Title Wrap Vectors in Markdown Formatting Version 1.0.9 - Package description and R functions","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230010155709/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=ndmFTk4MOCr6LbWsNsSbq3NqZHI%3D","gluedown-title-wrap-vectors-in-markdown-formatting-version-109-package-description-and-r-functions",1794446933,{"doc_id":188,"doc_title":189,"file_type":137,"home_preview_img_url":190,"slug":191,"view_count":30,"category_name":29,"create_tm":192},701086,"Getting Started with R Markdown - A Short Introduction","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230011578532/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=928FaoJC1vP6vG4V1sEjH9hxl%2Bs%3D","getting-started-with-r-markdown-a-short-introduction",1794523303,{"doc_id":194,"doc_title":195,"file_type":137,"home_preview_img_url":196,"slug":197,"view_count":96,"category_name":29,"create_tm":198},685841,"Markdown Syntax Guide - Quick Reference","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110230000227664/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=LP8AqWtE4zVgkpeRp%2FIG74NkHpo%3D","markdown-syntax-guide-quick-reference",1794019531,{"doc_id":200,"doc_title":201,"file_type":137,"home_preview_img_url":202,"slug":203,"view_count":167,"category_name":29,"create_tm":204},348238,"Markdown Cheat Sheet - Every common Markdown syntax in one page","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911603538/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=XYPNRLGFgCLdxloYLqFbdLfpWic%3D","markdown-cheat-sheet-every-common-markdown-syntax-in-one-page",1790071906,{"doc_id":206,"doc_title":207,"file_type":137,"home_preview_img_url":208,"slug":209,"view_count":123,"category_name":29,"create_tm":210},657500,"CS&SS 569 Visualizing Data and Models - Lab 2 - Intro to LATEX with R Markdown and Overleaf","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229975094700/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=cJhr3sr7lN6hUlh0qU0sr4TcFkM%3D","csss-569-visualizing-data-and-models-lab-2-intro-to-latex-with-r-markdown-and-overleaf",1792981475,{"doc_id":212,"doc_title":213,"file_type":137,"home_preview_img_url":214,"slug":215,"view_count":216,"category_name":29,"create_tm":217},348235,"Markdown Cheat Sheet for Beginners and Experts","https://weboffice-temporary-prod-sg.obs.ap-southeast-3.myhuaweicloud.com:443/export/thumbnail/export/thumbnail/110229911078336/last/300/407?AWSAccessKeyId=HPUAE6OPDRI9QZXR6WJG&Expires=1796111999&Signature=dQFs475tBQVYXNeZWS8IgoOq5zk%3D","markdown-cheat-sheet-for-beginners-and-experts",16,1790071903]