[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573407-105":53,"doc-detail-573407-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","r-markdown-cheat-sheet-quick-start-and-syntax","R Markdown Cheat Sheet - quick start and syntax","","R Markdown Cheat Sheet provides a practical workflow for creating reports in RStudio using .Rmd files. It explains how to start a new R Markdown document, choose output formats via a YAML header, and write content using Markdown syntax for headings, lists, tables, and formatting. It also covers embedding R code with knitr, configuring chunk options, rendering with rmarkdown::render or the knit button, creating interactive Shiny docs, and publishing results through online hosting services.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/r-markdown-cheat-sheet-quick-start-and-syntax/573407/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/r-markdown-cheat-sheet-quick-start-and-syntax/573407.png","ImageObject",442,249,{"name":88,"@type":89},"Chumphorn","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-18","2026-10-14",true,{"@type":98,"interactionType":99,"userInteractionCount":79},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"How do I create a new R Markdown document in RStudio?","Question",{"text":108,"@type":109},"Save or open a text file with the .Rmd extension, then use the menu path File > New File > R Markdown. Choose the output class and select the output type before clicking OK.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"What is the purpose of the YAML header in an .Rmd file?",{"text":113,"@type":109},"The YAML header is a set of key:value pairs at the top of the file, enclosed by three dashes. It determines which output type R builds, such as html_document, pdf_document, word_document, beamer_presentation, or ioslides_presentation.",{"name":115,"@type":106,"acceptedAnswer":116},"How do I embed R code and control knitr chunk behavior?",{"text":117,"@type":109},"Use knitr syntax for code chunks, starting with ```{r} and ending with ```. Add chunk options in brackets above the chunk (e.g., eval, echo, warning, results, cache, fig.width, fig.height) to control execution and display.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573407,1792014125,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":79,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":73,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":9},2336475401981,"https://ap-avatar.wpscdn.com/avatar/22000c94efd8d5204d?x-image-process=image/resize,m_fixed,w_180,h_180&k=1786935347598174694","R Markdown Cheat Sheet learn more at [rmarkdown. rstudio.com](rmarkdown. rstudio.com)  \nrmarkdown 0.2.50 Updated: 8/14  \n2. Open File Start by saving a text file with the extension . Rmd, or open an RStudio Rmd template  \n• In the menu bar, click  \nFile ▶ New File ▶ R Markdown    \n• A window will open. Select the class of output you would like to make with your . Rmd file  \n• Select the specific type of output to make with the radio buttons (you can change this later)  \n• Click OK  \n4. Choose Output Write a YAML header that explains what type of document to build from your R Markdown file.  \nYAML  \nA YAML header is a set of key: value pairs at the start of your file. Begin and end the header with a line of three dashes (- - -)  \nThe output value determines which type of file R will build from your .Rmd file (in Step 6)  \noutput: html_document  html file (web page)  \noutput: pdf_document  pdf document  \noutput: word_document  Microsoft Word .docx output: beamer_presentation  beamer slideshow (pdf) output: ioslides_presentation  ioslides slideshow (html)  \nRStudio® is a trademark of RStudio, Inc. • CC BY  RStudio • [info@rstudio.com](info@rstudio.com) • 844-448-1212 •  [rstudio.com](rstudio.com)  \n3. Markdown Next, write your report in plain text. Use markdown syntax to describe how to format text in the final report.  \nsyntax becomes  \nPlain text  \nEnd a line with two spaces to start a new paragraph.  \n*italics* and _italics_  \n**bold** and   bold   superscript^2^~~strikethrough~~[link]([www. rstudio.com](www. rstudio.com) )  \n\\# Header 1  \n\\#\\# Header 2  \n\\#\\#\\# Header 3  \n\\#\\#\\#\\# Header 4  \n\\#\\#\\#\\#\\# Header 5  \n\\#\\#\\#\\#\\#\\# Header 6  \nendash: --  \nemdash: ---  \nellipsis: ...  \ninline equation: $A = \\pi*r^{2}$  \nimage: horizontal rule (or slide break):***  \n> block quote  \n* unordered list  \n* item 2 + sub-item 1 + sub-item 2  \n1. ordered list  \n2. item 2  \n+ sub-item 1  \n+ sub-item 2  \nTable Header | Second Header------------- | -------------Table Cell | Cell 2  \nCell 3 | Cell 4  \n5. Embed Code Use knitr syntax to embed R code into your report. R will run the code and include the results when you render your report.  \ninline code  \nSurround code with back ticks and r. R replaces inline code with its results.  \ncode chunks  \nStart a chunk with ```{r} . End a chunk with ```  \ndisplay options  \nUse knitr options to style the output of a chunk. Place options in brackets above the chunk.  \nHere’s some code ```{r echo=FALSE } dim(iris)  \n```  \noption default eﬀect  \neval TRUE Whether to evaluate the code and include its results  \necho TRUE Whether to display code along with its results  \nwarning TRUE Whether to display warnings  \nerror FALSE Whether to display errors  \nmessage TRUE Whether to display messages  \ntidy FALSE Whether to reformat code in a tidy way when displaying it  \nresults \"markup\" \"markup\", \"asis\", \"hold\", or \"hide\"  \ncache FALSE Whether to cache results for future renders  \ncomment \"\\#\\#\" Comment character to preface results with  \nfig.width 7 Width in inches for plots created in chunk  \nfig.height 7 Height in inches for plots created in chunk  \n[For more details visit](For more details visit yihui.name/knitr/)[ ](For more details visit yihui.name/knitr/)[yihui.name/knitr/](For more details visit yihui.name/knitr/)  \n6. Render Use your . Rmd file as a blueprint to build a finished report.  \nRender your report in one of two ways  \n1. Run rmarkdown::render(\"\u003Cfile path>\")  \n2. Click the knit HTML button at the top of the RStudio scripts pane  \nWhen you render, R will  \n• execute each embedded code chunk and insert the results into your report  \n• build a new version of your report in the output file type  \n• open a preview of the output file in the viewer pane  \n• save the output file in your working directory  \n7. Interactive Docs Turn your report into an interactive Shiny document in 3 steps  \n1  \nAdd runtime: shiny to theYAML header  \n2  \nIn the code chunks, add Shiny input functions to embed widgets. Add Shiny ","cbCait4dSBcRAEAX","https://ap.wps.com/l/cbCait4dSBcRAEAX","pdf",1041427,"English","# Create an R Markdown file\n# Choose output with YAML\n# Write content using Markdown syntax\n# Embed R code with knitr\n# Render and preview the report\n# Create interactive Shiny documents\n# Publish the report online\n# Learn more resources","[{\"question\":\"How do I create a new R Markdown document in RStudio?\",\"answer\":\"Save or open a text file with the .Rmd extension, then use the menu path File \\u003e New File \\u003e R Markdown. Choose the output class and select the output type before clicking OK.\"},{\"question\":\"What is the purpose of the YAML header in an .Rmd file?\",\"answer\":\"The YAML header is a set of key:value pairs at the top of the file, enclosed by three dashes. It determines which output type R builds, such as html_document, pdf_document, word_document, beamer_presentation, or ioslides_presentation.\"},{\"question\":\"How do I embed R code and control knitr chunk behavior?\",\"answer\":\"Use knitr syntax for code chunks, starting with ```{r} and ending with ```. Add chunk options in brackets above the chunk (e.g., eval, echo, warning, results, cache, fig.width, fig.height) to control execution and display.\"}]","R Markdown Cheat Sheet - quick start and syntax | PDF",1791939196]