Documentation in R

Question

How to do work on documentation using R markdown (including pdfs, word, html and many more formats) ?

solved 0
shikhagaur16@gmail.com 3 years 1 Answer 562 views Member 0

Answer ( 1 )

  1. R markdown is an implicitly loaded package in the R studio which provides a framework for data science by combining codes and its results to turn the whole analysis into high quality documents, reports or presentations so that the analysis is nicely represented as a story. R Markdown file, a plain-text file that has the extension .Rmd. It is fully reproducible .

    HOW TO OPEN R MARKDOWN FILE IN R STUDIO ?
    To open a new file, click File
    > New File
    > R Markdown in the RStudio menu bar.
    > A window will pop up that helps you build the YAML frontmatter for the . Rmd file.

    BASICS OF WRITING A CODE WITH R MARKDOWN :
    1. An (optional) YAML header surrounded by —s.
    2. Chunks of R code surrounded by “`.
    3. Text mixed with simple text formatting like # heading and
    _italics_.

    For example :

    title: “FOR EXAMPLE”
    output: pdf_document

    “`{r setup, include=FALSE}
    knitr::opts_chunk$set(echo = TRUE)
    “`
    ## R Markdown
    This is an R Markdown document.

    “`{r cars}
    summary(cars)
    “`
    ## Including Plots

    You can also embed plots, for example:

    “`{r pressure, echo=FALSE}
    plot(pressure)
    “`
    Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.
    The result for above code is being attached with the answer.
    To produce a complete report containing all text, code, and results, click “Knit” or press Cmd/Ctrl-Shift-K.
    It can also be done by Commanding in console:
    rmarkdown::render(“filename.Rmd”)

    SOME TEXT FORMATTS ARE:
    *italic* or _italic_
    **bold** __bold__
    Headings:
    # For 1st Level Header
    ## 2nd Level Header
    ### 3rd Level Header
    Lists:
    * Bulleted list item 1
    * Item 2
    * Item 2a
    * Item 2b
    1. Numbered list item 1
    1. Item 2.
    These are some basic steps to work on a documentation using R markdown. You can also take help by using help() in the r studio.


    Attachment
    Best answer

Leave an answer

Browse
Browse